Back to index

glibc  2.9
Defines
tls-macros.h File Reference
#include <sys/cdefs.h>
#include <sys/asm.h>

Go to the source code of this file.

Defines

#define __STRING2(X)   __STRING(X)
#define ADDU   __STRING2(PTR_ADDU)
#define ADDIU   __STRING2(PTR_ADDIU)
#define LW   __STRING2(PTR_L)
#define LOAD_GP   "move %[tmp], $28\n\tdla $28, __gnu_local_gp\n\t"
#define UNLOAD_GP   "\n\tmove $28, %[tmp]"
#define TLS_GD(x)
#define TLS_LD(x)
#define TLS_IE(x)
#define TLS_LE(x)

Define Documentation

#define __STRING2 (   X)    __STRING(X)

Definition at line 6 of file tls-macros.h.

#define ADDIU   __STRING2(PTR_ADDIU)

Definition at line 8 of file tls-macros.h.

#define ADDU   __STRING2(PTR_ADDU)

Definition at line 7 of file tls-macros.h.

#define LOAD_GP   "move %[tmp], $28\n\tdla $28, __gnu_local_gp\n\t"

Definition at line 17 of file tls-macros.h.

#define LW   __STRING2(PTR_L)

Definition at line 9 of file tls-macros.h.

#define TLS_GD (   x)
Value:
({ void *__result, *__tmp;                       \
     extern void *__tls_get_addr (void *);              \
     asm (LOAD_GP ADDIU " %0, $28, %%tlsgd(" #x ")"     \
         UNLOAD_GP                               \
         : "=r" (__result), [tmp] "=&r" (__tmp));       \
     (int *)__tls_get_addr (__result); })

Definition at line 25 of file tls-macros.h.

#define TLS_IE (   x)
Value:
({ void *__result, *__tmp;                       \
     asm (".set push\n\t.set mips32r2\n\t"              \
         "rdhwr\t%0,$29\n\t.set pop"                    \
         : "=v" (__result));                            \
     asm (LOAD_GP LW " $3,%%gottprel(" #x ")($28)\n\t"  \
         ADDU " %0,%0,$3"                        \
         UNLOAD_GP                               \
         : "+r" (__result), [tmp] "=&r" (__tmp)  \
         : : "$3");                              \
     __result; })

Definition at line 44 of file tls-macros.h.

#define TLS_LD (   x)
Value:
({ void *__result, *__tmp;                       \
     extern void *__tls_get_addr (void *);              \
     asm (LOAD_GP ADDIU " %0, $28, %%tlsldm(" #x ")"    \
         UNLOAD_GP                               \
         : "=r" (__result), [tmp] "=&r" (__tmp));       \
     __result = __tls_get_addr (__result);              \
     asm ("lui $3,%%dtprel_hi(" #x ")\n\t"              \
         "addiu $3,$3,%%dtprel_lo(" #x ")\n\t"          \
         ADDU " %0,%0,$3"                        \
         : "+r" (__result) : : "$3");                   \
     __result; })

Definition at line 32 of file tls-macros.h.

#define TLS_LE (   x)
Value:
({ void *__result;                               \
     asm (".set push\n\t.set mips32r2\n\t"              \
         "rdhwr\t%0,$29\n\t.set pop"                    \
         : "=v" (__result));                            \
     asm ("lui $3,%%tprel_hi(" #x ")\n\t"        \
         "addiu $3,$3,%%tprel_lo(" #x ")\n\t"           \
         ADDU " %0,%0,$3"                        \
         : "+r" (__result) : : "$3");                   \
     __result; })

Definition at line 55 of file tls-macros.h.

#define UNLOAD_GP   "\n\tmove $28, %[tmp]"

Definition at line 19 of file tls-macros.h.