|
Packit |
6c4009 |
#define TLS_LE(x) \
|
|
Packit |
6c4009 |
({ unsigned long __offset; \
|
|
Packit |
6c4009 |
__asm__ ("bras %0,1f\n" \
|
|
Packit |
6c4009 |
"0:\t.long " #x "@ntpoff\n" \
|
|
Packit |
6c4009 |
"1:\tl %0,0(%0)" \
|
|
Packit |
6c4009 |
: "=a" (__offset) : : "cc" ); \
|
|
Packit |
6c4009 |
(int *) (__builtin_thread_pointer() + __offset); })
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifdef PIC
|
|
Packit |
6c4009 |
# define TLS_IE(x) \
|
|
Packit |
6c4009 |
({ unsigned long __offset, __save12; \
|
|
Packit |
6c4009 |
__asm__ ("bras %0,1f\n" \
|
|
Packit |
6c4009 |
"0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \
|
|
Packit |
6c4009 |
".long " #x "@gotntpoff\n" \
|
|
Packit |
6c4009 |
"1:\tlr %1,%%r12\n\t" \
|
|
Packit |
6c4009 |
"l %%r12,0(%0)\n\t" \
|
|
Packit |
6c4009 |
"la %%r12,0(%0,%%r12)\n\t" \
|
|
Packit |
6c4009 |
"l %0,4(%0)\n\t" \
|
|
Packit |
6c4009 |
"l %0,0(%0,%%r12):tls_load:" #x "\n\t" \
|
|
Packit |
6c4009 |
"lr %%r12,%1\n" \
|
|
Packit |
6c4009 |
: "=&a" (__offset), "=&a" (__save12) : : "cc" ); \
|
|
Packit |
6c4009 |
(int *) (__builtin_thread_pointer() + __offset); })
|
|
Packit |
6c4009 |
#else
|
|
Packit |
6c4009 |
# define TLS_IE(x) \
|
|
Packit |
6c4009 |
({ unsigned long __offset; \
|
|
Packit |
6c4009 |
__asm__ ("bras %0,1f\n" \
|
|
Packit |
6c4009 |
"0:\t.long " #x "@indntpoff\n" \
|
|
Packit |
6c4009 |
"1:\t l %0,0(%0)\n\t" \
|
|
Packit |
6c4009 |
"l %0,0(%0):tls_load:" #x \
|
|
Packit |
6c4009 |
: "=&a" (__offset) : : "cc" ); \
|
|
Packit |
6c4009 |
(int *) (__builtin_thread_pointer() + __offset); })
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifdef PIC
|
|
Packit |
6c4009 |
# define TLS_LD(x) \
|
|
Packit |
6c4009 |
({ unsigned long __offset, __save12; \
|
|
Packit |
6c4009 |
__asm__ ("bras %0,1f\n" \
|
|
Packit |
6c4009 |
"0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \
|
|
Packit |
6c4009 |
".long __tls_get_offset@plt-0b\n\t" \
|
|
Packit |
6c4009 |
".long " #x "@tlsldm\n\t" \
|
|
Packit |
6c4009 |
".long " #x "@dtpoff\n" \
|
|
Packit |
6c4009 |
"1:\tlr %1,%%r12\n\t" \
|
|
Packit |
6c4009 |
"l %%r12,0(%0)\n\t" \
|
|
Packit |
6c4009 |
"la %%r12,0(%%r12,%0)\n\t" \
|
|
Packit |
6c4009 |
"l %%r1,4(%0)\n\t" \
|
|
Packit |
6c4009 |
"l %%r2,8(%0)\n\t" \
|
|
Packit |
6c4009 |
"bas %%r14,0(%%r1,%0):tls_ldcall:" #x "\n\t" \
|
|
Packit |
6c4009 |
"l %0,12(%0)\n\t" \
|
|
Packit |
6c4009 |
"alr %0,%%r2\n\t" \
|
|
Packit |
6c4009 |
"lr %%r12,%1" \
|
|
Packit |
6c4009 |
: "=&a" (__offset), "=&a" (__save12) \
|
|
Packit |
6c4009 |
: : "cc", "0", "1", "2", "3", "4", "5", "14"); \
|
|
Packit |
6c4009 |
(int *) (__builtin_thread_pointer() + __offset); })
|
|
Packit |
6c4009 |
#else
|
|
Packit |
6c4009 |
# define TLS_LD(x) \
|
|
Packit |
6c4009 |
({ unsigned long __offset; \
|
|
Packit |
6c4009 |
__asm__ ("bras %0,1f\n" \
|
|
Packit |
6c4009 |
"0:\t.long _GLOBAL_OFFSET_TABLE_\n\t" \
|
|
Packit |
6c4009 |
".long __tls_get_offset@plt\n\t" \
|
|
Packit |
6c4009 |
".long " #x "@tlsldm\n\t" \
|
|
Packit |
6c4009 |
".long " #x "@dtpoff\n" \
|
|
Packit |
6c4009 |
"1:\tl %%r12,0(%0)\n\t" \
|
|
Packit |
6c4009 |
"l %%r1,4(%0)\n\t" \
|
|
Packit |
6c4009 |
"l %%r2,8(%0)\n\t" \
|
|
Packit |
6c4009 |
"bas %%r14,0(%%r1):tls_ldcall:" #x "\n\t" \
|
|
Packit |
6c4009 |
"l %0,12(%0)\n\t" \
|
|
Packit |
6c4009 |
"alr %0,%%r2" \
|
|
Packit |
6c4009 |
: "=&a" (__offset) \
|
|
Packit |
6c4009 |
: : "cc", "0", "1", "2", "3", "4", "5", "12", "14"); \
|
|
Packit |
6c4009 |
(int *) (__builtin_thread_pointer() + __offset); })
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifdef PIC
|
|
Packit |
6c4009 |
# define TLS_GD(x) \
|
|
Packit |
6c4009 |
({ unsigned long __offset, __save12; \
|
|
Packit |
6c4009 |
__asm__ ("bras %0,1f\n" \
|
|
Packit |
6c4009 |
"0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \
|
|
Packit |
6c4009 |
".long __tls_get_offset@plt-0b\n\t" \
|
|
Packit |
6c4009 |
".long " #x "@tlsgd\n" \
|
|
Packit |
6c4009 |
"1:\tlr %1,%%r12\n\t" \
|
|
Packit |
6c4009 |
"l %%r12,0(%0)\n\t" \
|
|
Packit |
6c4009 |
"la %%r12,0(%%r12,%0)\n\t" \
|
|
Packit |
6c4009 |
"l %%r1,4(%0)\n\t" \
|
|
Packit |
6c4009 |
"l %%r2,8(%0)\n\t" \
|
|
Packit |
6c4009 |
"bas %%r14,0(%%r1,%0):tls_gdcall:" #x "\n\t" \
|
|
Packit |
6c4009 |
"lr %0,%%r2\n\t" \
|
|
Packit |
6c4009 |
"lr %%r12,%1" \
|
|
Packit |
6c4009 |
: "=&a" (__offset), "=&a" (__save12) \
|
|
Packit |
6c4009 |
: : "cc", "0", "1", "2", "3", "4", "5", "14"); \
|
|
Packit |
6c4009 |
(int *) (__builtin_thread_pointer() + __offset); })
|
|
Packit |
6c4009 |
#else
|
|
Packit |
6c4009 |
# define TLS_GD(x) \
|
|
Packit |
6c4009 |
({ unsigned long __offset; \
|
|
Packit |
6c4009 |
__asm__ ("bras %0,1f\n" \
|
|
Packit |
6c4009 |
"0:\t.long _GLOBAL_OFFSET_TABLE_\n\t" \
|
|
Packit |
6c4009 |
".long __tls_get_offset@plt\n\t" \
|
|
Packit |
6c4009 |
".long " #x "@tlsgd\n" \
|
|
Packit |
6c4009 |
"1:\tl %%r12,0(%0)\n\t" \
|
|
Packit |
6c4009 |
"l %%r1,4(%0)\n\t" \
|
|
Packit |
6c4009 |
"l %%r2,8(%0)\n\t" \
|
|
Packit |
6c4009 |
"bas %%r14,0(%%r1):tls_gdcall:" #x "\n\t" \
|
|
Packit |
6c4009 |
"lr %0,%%r2" \
|
|
Packit |
6c4009 |
: "=&a" (__offset) \
|
|
Packit |
6c4009 |
: : "cc", "0", "1", "2", "3", "4", "5", "12", "14"); \
|
|
Packit |
6c4009 |
(int *) (__builtin_thread_pointer() + __offset); })
|
|
Packit |
6c4009 |
#endif
|