Back to index

glibc  2.9
Defines
sysdep.h File Reference
#include <asm/unistd.h>
#include <sysdeps/generic/sysdep.h>
#include <sys/syscall.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define ASM_LINE_SEP   !
#define SYS_ify(syscall_name)   (__NR_##syscall_name)
#define TREG   %r3
#define SAVE_PIC(SREG)   nop ASM_LINE_SEP
#define LOAD_PIC(LREG)   nop ASM_LINE_SEP
#define TREG_ASM
#define SAVE_ASM_PIC   "nop \n"
#define LOAD_ASM_PIC   "nop \n"
#define CLOB_TREG
#define PIC_REG_DEF
#define PIC_REG_USE
#define CALL_CLOB_REGS
#define INLINE_SYSCALL(name, nr, args...)
#define INTERNAL_SYSCALL_DECL(err)
#define INTERNAL_SYSCALL_ERROR_P(val, err)   ((val < 0) && (val > -4095))
#define INTERNAL_SYSCALL_ERRNO(val, err)   (-(val))
#define INTERNAL_SYSCALL(name, err, nr, args...)
#define INTERNAL_SYSCALL_NCS(name, err, nr, args...)
#define LOAD_ARGS_0()
#define LOAD_ARGS_1(r26)
#define LOAD_ARGS_2(r26, r25)
#define LOAD_ARGS_3(r26, r25, r24)
#define LOAD_ARGS_4(r26, r25, r24, r23)
#define LOAD_ARGS_5(r26, r25, r24, r23, r22)
#define LOAD_ARGS_6(r26, r25, r24, r23, r22, r21)
#define ASM_ARGS_0
#define ASM_ARGS_1   ASM_ARGS_0, "r" (__r26)
#define ASM_ARGS_2   ASM_ARGS_1, "r" (__r25)
#define ASM_ARGS_3   ASM_ARGS_2, "r" (__r24)
#define ASM_ARGS_4   ASM_ARGS_3, "r" (__r23)
#define ASM_ARGS_5   ASM_ARGS_4, "r" (__r22)
#define ASM_ARGS_6   ASM_ARGS_5, "r" (__r21)
#define CLOB_ARGS_6
#define CLOB_ARGS_5   CLOB_ARGS_6, "%r21"
#define CLOB_ARGS_4   CLOB_ARGS_5, "%r22"
#define CLOB_ARGS_3   CLOB_ARGS_4, "%r23"
#define CLOB_ARGS_2   CLOB_ARGS_3, "%r24"
#define CLOB_ARGS_1   CLOB_ARGS_2, "%r25"
#define CLOB_ARGS_0   CLOB_ARGS_1, "%r26"
#define PTR_MANGLE(var)   (void) (var)
#define PTR_DEMANGLE(var)   (void) (var)

Define Documentation

#define ASM_ARGS_0

Definition at line 472 of file sysdep.h.

#define ASM_ARGS_1   ASM_ARGS_0, "r" (__r26)

Definition at line 473 of file sysdep.h.

#define ASM_ARGS_2   ASM_ARGS_1, "r" (__r25)

Definition at line 474 of file sysdep.h.

#define ASM_ARGS_3   ASM_ARGS_2, "r" (__r24)

Definition at line 475 of file sysdep.h.

#define ASM_ARGS_4   ASM_ARGS_3, "r" (__r23)

Definition at line 476 of file sysdep.h.

#define ASM_ARGS_5   ASM_ARGS_4, "r" (__r22)

Definition at line 477 of file sysdep.h.

#define ASM_ARGS_6   ASM_ARGS_5, "r" (__r21)

Definition at line 478 of file sysdep.h.

#define ASM_LINE_SEP   !

Definition at line 28 of file sysdep.h.

#define CALL_CLOB_REGS
Value:
"%r1", "%r2", CLOB_TREG \
                     "%r20", "%r29", "%r31"

Definition at line 352 of file sysdep.h.

#define CLOB_ARGS_0   CLOB_ARGS_1, "%r26"

Definition at line 487 of file sysdep.h.

#define CLOB_ARGS_1   CLOB_ARGS_2, "%r25"

Definition at line 486 of file sysdep.h.

#define CLOB_ARGS_2   CLOB_ARGS_3, "%r24"

Definition at line 485 of file sysdep.h.

#define CLOB_ARGS_3   CLOB_ARGS_4, "%r23"

Definition at line 484 of file sysdep.h.

#define CLOB_ARGS_4   CLOB_ARGS_5, "%r22"

Definition at line 483 of file sysdep.h.

#define CLOB_ARGS_5   CLOB_ARGS_6, "%r21"

Definition at line 482 of file sysdep.h.

#define CLOB_ARGS_6

Definition at line 481 of file sysdep.h.

#define CLOB_TREG

Definition at line 55 of file sysdep.h.

#define INLINE_SYSCALL (   name,
  nr,
  args... 
)
Value:
({                                                             \
       long __sys_res;                                                \
       {                                                       \
              register unsigned long __res asm("r28");         \
              PIC_REG_DEF                                      \
              LOAD_ARGS_##nr(args)                             \
              /* FIXME: HACK save/load r19 around syscall */          \
              asm volatile(                                    \
                     SAVE_ASM_PIC                              \
                     "      ble  0x100(%%sr2, %%r0)\n"         \
                     "      ldi %1, %%r20\n"                   \
                     LOAD_ASM_PIC                              \
                     : "=r" (__res)                                   \
                     : "i" (SYS_ify(name)) PIC_REG_USE ASM_ARGS_##nr  \
                     : "memory", CALL_CLOB_REGS CLOB_ARGS_##nr \
              );                                               \
              __sys_res = (long)__res;                         \
       }                                                       \
       if ( (unsigned long)__sys_res >= (unsigned long)-4095 ){       \
              __set_errno(-__sys_res);                         \
              __sys_res = -1;                                         \
       }                                                       \
       __sys_res;                                              \
})

Definition at line 356 of file sysdep.h.

#define INTERNAL_SYSCALL (   name,
  err,
  nr,
  args... 
)
Value:
({                                                             \
       long __sys_res;                                                \
       {                                                       \
              register unsigned long __res asm("r28");         \
              PIC_REG_DEF                                      \
              LOAD_ARGS_##nr(args)                             \
              /* FIXME: HACK save/load r19 around syscall */          \
              asm volatile(                                    \
                     SAVE_ASM_PIC                              \
                     "      ble  0x100(%%sr2, %%r0)\n"         \
                     "      ldi %1, %%r20\n"                   \
                     LOAD_ASM_PIC                              \
                     : "=r" (__res)                                   \
                     : "i" (SYS_ify(name)) PIC_REG_USE ASM_ARGS_##nr  \
                     : "memory", CALL_CLOB_REGS CLOB_ARGS_##nr \
              );                                               \
              __sys_res = (long)__res;                         \
       }                                                       \
       __sys_res;                                              \
 })

Definition at line 402 of file sysdep.h.

#define INTERNAL_SYSCALL_DECL (   err)

Definition at line 391 of file sysdep.h.

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

Definition at line 398 of file sysdep.h.

#define INTERNAL_SYSCALL_ERROR_P (   val,
  err 
)    ((val < 0) && (val > -4095))

Definition at line 394 of file sysdep.h.

#define INTERNAL_SYSCALL_NCS (   name,
  err,
  nr,
  args... 
)
Value:
({                                                             \
       long __sys_res;                                                \
       {                                                       \
              register unsigned long __res asm("r28");         \
              PIC_REG_DEF                                      \
              LOAD_ARGS_##nr(args)                             \
              /* FIXME: HACK save/load r19 around syscall */          \
              asm volatile(                                    \
                     SAVE_ASM_PIC                              \
                     "      ble  0x100(%%sr2, %%r0)\n"         \
                     "      copy %1, %%r20\n"                  \
                     LOAD_ASM_PIC                              \
                     : "=r" (__res)                                   \
                     : "r" (name) PIC_REG_USE ASM_ARGS_##nr           \
                     : "memory", CALL_CLOB_REGS CLOB_ARGS_##nr \
              );                                               \
              __sys_res = (long)__res;                         \
       }                                                       \
       __sys_res;                                              \
 })

Definition at line 427 of file sysdep.h.

#define LOAD_ARGS_0 ( )

Definition at line 451 of file sysdep.h.

#define LOAD_ARGS_1 (   r26)
Value:
register unsigned long __r26 __asm__("r26") = (unsigned long)(r26);   \
  LOAD_ARGS_0()

Definition at line 452 of file sysdep.h.

#define LOAD_ARGS_2 (   r26,
  r25 
)
Value:
register unsigned long __r25 __asm__("r25") = (unsigned long)(r25);   \
  LOAD_ARGS_1(r26)

Definition at line 455 of file sysdep.h.

#define LOAD_ARGS_3 (   r26,
  r25,
  r24 
)
Value:
register unsigned long __r24 __asm__("r24") = (unsigned long)(r24);   \
  LOAD_ARGS_2(r26,r25)

Definition at line 458 of file sysdep.h.

#define LOAD_ARGS_4 (   r26,
  r25,
  r24,
  r23 
)
Value:
register unsigned long __r23 __asm__("r23") = (unsigned long)(r23);   \
  LOAD_ARGS_3(r26,r25,r24)

Definition at line 461 of file sysdep.h.

#define LOAD_ARGS_5 (   r26,
  r25,
  r24,
  r23,
  r22 
)
Value:
register unsigned long __r22 __asm__("r22") = (unsigned long)(r22);   \
  LOAD_ARGS_4(r26,r25,r24,r23)

Definition at line 464 of file sysdep.h.

#define LOAD_ARGS_6 (   r26,
  r25,
  r24,
  r23,
  r22,
  r21 
)
Value:
register unsigned long __r21 __asm__("r21") = (unsigned long)(r21);   \
  LOAD_ARGS_5(r26,r25,r24,r23,r22)

Definition at line 467 of file sysdep.h.

#define LOAD_ASM_PIC   "nop \n"

Definition at line 54 of file sysdep.h.

#define LOAD_PIC (   LREG)    nop ASM_LINE_SEP

Definition at line 50 of file sysdep.h.

#define PIC_REG_DEF

Definition at line 56 of file sysdep.h.

#define PIC_REG_USE

Definition at line 57 of file sysdep.h.

#define PTR_DEMANGLE (   var)    (void) (var)

Definition at line 493 of file sysdep.h.

#define PTR_MANGLE (   var)    (void) (var)

Definition at line 492 of file sysdep.h.

#define SAVE_ASM_PIC   "nop \n"

Definition at line 53 of file sysdep.h.

#define SAVE_PIC (   SREG)    nop ASM_LINE_SEP

Definition at line 49 of file sysdep.h.

#define SYS_ify (   syscall_name)    (__NR_##syscall_name)

Definition at line 31 of file sysdep.h.

#define TREG   %r3

Definition at line 48 of file sysdep.h.

#define TREG_ASM

Definition at line 52 of file sysdep.h.