Back to index

glibc  2.9
Defines | Functions
sysdep.h File Reference
#include <sysdeps/unix/i386/sysdep.h>
#include <bp-sym.h>
#include <bp-asm.h>
#include <dl-sysdep.h>
#include <tls.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define SYS_ify(syscall_name)   __NR_##syscall_name
#define INLINE_SYSCALL(name, nr, args...)
#define INTERNAL_SYSCALL(name, err, nr, args...)
#define INTERNAL_SYSCALL_NCS(name, err, nr, args...)
#define INTERNAL_SYSCALL_DECL(err)   do { } while (0)
#define INTERNAL_SYSCALL_ERROR_P(val, err)   ((unsigned int) (val) >= 0xfffff001u)
#define INTERNAL_SYSCALL_ERRNO(val, err)   (-(val))
#define LOADARGS_0
#define LOADARGS_1
#define LOADARGS_2
#define LOADARGS_3
#define LOADARGS_4
#define LOADARGS_5
#define RESTOREARGS_0
#define RESTOREARGS_1
#define RESTOREARGS_2
#define RESTOREARGS_3
#define RESTOREARGS_4
#define RESTOREARGS_5
#define ASMFMT_0()
#define ASMFMT_1(arg1)   , "b" (arg1)
#define ASMFMT_2(arg1, arg2)   , "b" (arg1), "c" (arg2)
#define ASMFMT_3(arg1, arg2, arg3)   , "b" (arg1), "c" (arg2), "d" (arg3)
#define ASMFMT_4(arg1, arg2, arg3, arg4)   , "b" (arg1), "c" (arg2), "d" (arg3), "S" (arg4)
#define ASMFMT_5(arg1, arg2, arg3, arg4, arg5)   , "b" (arg1), "c" (arg2), "d" (arg3), "S" (arg4), "D" (arg5)
#define EXTRAVAR_0
#define EXTRAVAR_1
#define EXTRAVAR_2
#define EXTRAVAR_3
#define EXTRAVAR_4
#define EXTRAVAR_5
#define PTR_MANGLE(var)
#define PTR_DEMANGLE(var)

Functions

 asm (".L__X'%ebx = 1\n\t"".L__X'%ecx = 2\n\t"".L__X'%edx = 2\n\t"".L__X'%eax = 3\n\t"".L__X'%esi = 3\n\t"".L__X'%edi = 3\n\t"".L__X'%ebp = 3\n\t"".L__X'%esp = 3\n\t"".macro bpushl name reg\n\t"".if 1 - \\name\n\t"".if 2 - \\name\n\t""error\n\t"".else\n\t""xchgl \\reg, %ebx\n\t"".endif\n\t"".endif\n\t"".endm\n\t"".macro bpopl name reg\n\t"".if 1 - \\name\n\t"".if 2 - \\name\n\t""error\n\t"".else\n\t""xchgl \\reg, %ebx\n\t"".endif\n\t"".endif\n\t"".endm\n\t")

Define Documentation

#define ASMFMT_0 ( )

Definition at line 500 of file sysdep.h.

#define ASMFMT_1 (   arg1)    , "b" (arg1)

Definition at line 513 of file sysdep.h.

#define ASMFMT_2 (   arg1,
  arg2 
)    , "b" (arg1), "c" (arg2)

Definition at line 515 of file sysdep.h.

#define ASMFMT_3 (   arg1,
  arg2,
  arg3 
)    , "b" (arg1), "c" (arg2), "d" (arg3)

Definition at line 517 of file sysdep.h.

#define ASMFMT_4 (   arg1,
  arg2,
  arg3,
  arg4 
)    , "b" (arg1), "c" (arg2), "d" (arg3), "S" (arg4)

Definition at line 519 of file sysdep.h.

#define ASMFMT_5 (   arg1,
  arg2,
  arg3,
  arg4,
  arg5 
)    , "b" (arg1), "c" (arg2), "d" (arg3), "S" (arg4), "D" (arg5)

Definition at line 521 of file sysdep.h.

#define EXTRAVAR_0

Definition at line 525 of file sysdep.h.

#define EXTRAVAR_1

Definition at line 526 of file sysdep.h.

#define EXTRAVAR_2

Definition at line 527 of file sysdep.h.

#define EXTRAVAR_3

Definition at line 528 of file sysdep.h.

#define EXTRAVAR_4

Definition at line 529 of file sysdep.h.

#define EXTRAVAR_5

Definition at line 533 of file sysdep.h.

#define INLINE_SYSCALL (   name,
  nr,
  args... 
)
Value:
({                                                                   \
    unsigned int resultvar = INTERNAL_SYSCALL (name, , nr, args);           \
    if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (resultvar, ), 0))       \
      {                                                                     \
       __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, ));                  \
       resultvar = 0xffffffff;                                              \
      }                                                                     \
    (int) resultvar; })

Definition at line 342 of file sysdep.h.

#define INTERNAL_SYSCALL (   name,
  err,
  nr,
  args... 
)
Value:
({                                                                   \
    register unsigned int resultvar;                                        \
    EXTRAVAR_##nr                                                    \
    asm volatile (                                                   \
    LOADARGS_##nr                                                    \
    "movl %1, %%eax\n\t"                                             \
    "int $0x80\n\t"                                                  \
    RESTOREARGS_##nr                                                 \
    : "=a" (resultvar)                                                      \
    : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc");                \
    (int) resultvar; })

Definition at line 413 of file sysdep.h.

#define INTERNAL_SYSCALL_DECL (   err)    do { } while (0)

Definition at line 439 of file sysdep.h.

#define INTERNAL_SYSCALL_ERRNO (   val,
  err 
)    (-(val))

Definition at line 446 of file sysdep.h.

#define INTERNAL_SYSCALL_ERROR_P (   val,
  err 
)    ((unsigned int) (val) >= 0xfffff001u)

Definition at line 442 of file sysdep.h.

#define INTERNAL_SYSCALL_NCS (   name,
  err,
  nr,
  args... 
)
Value:
({                                                                   \
    register unsigned int resultvar;                                        \
    EXTRAVAR_##nr                                                    \
    asm volatile (                                                   \
    LOADARGS_##nr                                                    \
    "int $0x80\n\t"                                                  \
    RESTOREARGS_##nr                                                 \
    : "=a" (resultvar)                                                      \
    : "0" (name) ASMFMT_##nr(args) : "memory", "cc");                       \
    (int) resultvar; })

Definition at line 425 of file sysdep.h.

#define LOADARGS_0

Definition at line 448 of file sysdep.h.

#define LOADARGS_1

Definition at line 468 of file sysdep.h.

#define LOADARGS_2

Definition at line 469 of file sysdep.h.

#define LOADARGS_3

Definition at line 470 of file sysdep.h.

#define LOADARGS_4

Definition at line 471 of file sysdep.h.

#define LOADARGS_5

Definition at line 472 of file sysdep.h.

#define PTR_DEMANGLE (   var)
Value:
asm ("rorl $9, %0\n"                     \
                                 "xorl %%gs:%c2, %0"                 \
                                 : "=r" (var)                        \
                                 : "0" (var),                        \
                                   "i" (offsetof (tcbhead_t,         \
                                                pointer_guard)))

Definition at line 580 of file sysdep.h.

#define PTR_MANGLE (   var)
Value:
asm ("xorl %%gs:%c2, %0\n"               \
                                 "roll $9, %0"                       \
                                 : "=r" (var)                        \
                                 : "0" (var),                        \
                                   "i" (offsetof (tcbhead_t,         \
                                                pointer_guard)))

Definition at line 574 of file sysdep.h.

#define RESTOREARGS_0

Definition at line 475 of file sysdep.h.

#define RESTOREARGS_1

Definition at line 493 of file sysdep.h.

#define RESTOREARGS_2

Definition at line 494 of file sysdep.h.

#define RESTOREARGS_3

Definition at line 495 of file sysdep.h.

#define RESTOREARGS_4

Definition at line 496 of file sysdep.h.

#define RESTOREARGS_5

Definition at line 497 of file sysdep.h.

#define SYS_ify (   syscall_name)    __NR_##syscall_name

Definition at line 38 of file sysdep.h.


Function Documentation

asm ( ".L__X'%  ebx = 1\n\t"".L__X'%ecx = 2\n\t"".L__X'%edx = 2\n\t"".L__X'%eax = 3\n\t"".L__X'%esi = 3\n\t"".L__X'%edi = 3\n\t"".L__X'%ebp = 3\n\t"".L__X'%esp = 3\n\t"".macro bpushl name reg\n\t"".if 1 - \\name\n\t"".if 2 - \\name\n\t""error\n\t"".else\n\t""xchgl \\reg,
%ebx\n\t"".endif\n\t"".endif\n\t"".endm\n\t"".macro bpopl name reg\n\t"".if 1-\\name\n\t"".if 2-\\name\n\t""error\n\t"".else\n\t""xchgl\\  reg,
%ebx\n\t"".endif\n\t"".endif\n\t"".endm\n\t  
)