|
Packit |
6c4009 |
#define TLS_LE(x) \
|
|
Packit |
6c4009 |
({ int *__l; void *__tp; \
|
|
Packit |
6c4009 |
asm ("stc gbr,%1\n\t" \
|
|
Packit |
6c4009 |
"mov.l 1f,%0\n\t" \
|
|
Packit |
6c4009 |
"bra 2f\n\t" \
|
|
Packit |
6c4009 |
" add %1,%0\n\t" \
|
|
Packit |
6c4009 |
".align 2\n\t" \
|
|
Packit |
6c4009 |
"1: .long " #x "@tpoff\n\t" \
|
|
Packit |
6c4009 |
"2:" \
|
|
Packit |
6c4009 |
: "=r" (__l), "=r" (__tp)); \
|
|
Packit |
6c4009 |
__l; })
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifdef PIC
|
|
Packit |
6c4009 |
# define TLS_IE(x) \
|
|
Packit |
6c4009 |
({ int *__l; void *__tp; \
|
|
Packit |
6c4009 |
register void *__gp __asm__("r12"); \
|
|
Packit |
6c4009 |
asm ("mov.l 1f,r0\n\t" \
|
|
Packit |
6c4009 |
"stc gbr,%1\n\t" \
|
|
Packit |
6c4009 |
"mov.l @(r0,r12),%0\n\t" \
|
|
Packit |
6c4009 |
"bra 2f\n\t" \
|
|
Packit |
6c4009 |
" add %1,%0\n\t" \
|
|
Packit |
6c4009 |
".align 2\n\t" \
|
|
Packit |
6c4009 |
"1: .long " #x "@gottpoff\n\t" \
|
|
Packit |
6c4009 |
"2:" \
|
|
Packit |
6c4009 |
: "=r" (__l), "=r" (__tp) : "r" (__gp) : "r0"); \
|
|
Packit |
6c4009 |
__l; })
|
|
Packit |
6c4009 |
#else
|
|
Packit |
6c4009 |
# define TLS_IE(x) \
|
|
Packit |
6c4009 |
({ int *__l; void *__tp; \
|
|
Packit |
6c4009 |
asm ("mov.l r12,@-r15\n\t" \
|
|
Packit |
6c4009 |
"mova 0f,r0\n\t" \
|
|
Packit |
6c4009 |
"mov.l 0f,r12\n\t" \
|
|
Packit |
6c4009 |
"add r0,r12\n\t" \
|
|
Packit |
6c4009 |
"mov.l 1f,r0\n\t" \
|
|
Packit |
6c4009 |
"stc gbr,%1\n\t" \
|
|
Packit |
6c4009 |
"mov.l @(r0,r12),%0\n\t" \
|
|
Packit |
6c4009 |
"bra 2f\n\t" \
|
|
Packit |
6c4009 |
" add %1,%0\n\t" \
|
|
Packit |
6c4009 |
".align 2\n\t" \
|
|
Packit |
6c4009 |
"1: .long " #x "@gottpoff\n\t" \
|
|
Packit |
6c4009 |
"0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
|
|
Packit |
6c4009 |
"2: mov.l @r15+,r12" \
|
|
Packit |
6c4009 |
: "=r" (__l), "=r" (__tp) : : "r0"); \
|
|
Packit |
6c4009 |
__l; })
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifdef PIC
|
|
Packit |
6c4009 |
# define TLS_LD(x) \
|
|
Packit |
6c4009 |
({ int *__l; \
|
|
Packit |
6c4009 |
register void *__gp __asm__("r12"); \
|
|
Packit |
6c4009 |
asm ("mov.l 1f,r4\n\t" \
|
|
Packit |
6c4009 |
"mova 2f,r0\n\t" \
|
|
Packit |
6c4009 |
"mov.l 2f,r1\n\t" \
|
|
Packit |
6c4009 |
"add r0,r1\n\t" \
|
|
Packit |
6c4009 |
"jsr @r1\n\t" \
|
|
Packit |
6c4009 |
" add r12,r4\n\t" \
|
|
Packit |
6c4009 |
"bra 4f\n\t" \
|
|
Packit |
6c4009 |
" nop\n\t" \
|
|
Packit |
6c4009 |
".align 2\n\t" \
|
|
Packit |
6c4009 |
"1: .long " #x "@tlsldm\n\t" \
|
|
Packit |
6c4009 |
"2: .long __tls_get_addr@plt\n\t" \
|
|
Packit |
6c4009 |
"4: mov.l 3f,%0\n\t" \
|
|
Packit |
6c4009 |
"bra 5f\n\t" \
|
|
Packit |
6c4009 |
" add r0,%0\n\t" \
|
|
Packit |
6c4009 |
".align 2\n\t" \
|
|
Packit |
6c4009 |
"3: .long " #x "@dtpoff\n\t" \
|
|
Packit |
6c4009 |
"5:" \
|
|
Packit |
6c4009 |
: "=r" (__l) : "r" (__gp) : "r0", "r1", "r2", "r3", "r4", "r5", \
|
|
Packit |
6c4009 |
"r6", "r7", "pr", "t"); \
|
|
Packit |
6c4009 |
__l; })
|
|
Packit |
6c4009 |
#else
|
|
Packit |
6c4009 |
# define TLS_LD(x) \
|
|
Packit |
6c4009 |
({ int *__l; \
|
|
Packit |
6c4009 |
asm ("mov.l r12,@-r15\n\t" \
|
|
Packit |
6c4009 |
"mova 0f,r0\n\t" \
|
|
Packit |
6c4009 |
"mov.l 0f,r12\n\t" \
|
|
Packit |
6c4009 |
"add r0,r12\n\t" \
|
|
Packit |
6c4009 |
"mov.l 1f,r4\n\t" \
|
|
Packit |
6c4009 |
"mova 2f,r0\n\t" \
|
|
Packit |
6c4009 |
"mov.l 2f,r1\n\t" \
|
|
Packit |
6c4009 |
"add r0,r1\n\t" \
|
|
Packit |
6c4009 |
"jsr @r1\n\t" \
|
|
Packit |
6c4009 |
" add r12,r4\n\t" \
|
|
Packit |
6c4009 |
"bra 4f\n\t" \
|
|
Packit |
6c4009 |
" nop\n\t" \
|
|
Packit |
6c4009 |
".align 2\n\t" \
|
|
Packit |
6c4009 |
"1: .long " #x "@tlsldm\n\t" \
|
|
Packit |
6c4009 |
"2: .long __tls_get_addr@plt\n\t" \
|
|
Packit |
6c4009 |
"0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
|
|
Packit |
6c4009 |
"4: mov.l 3f,%0\n\t" \
|
|
Packit |
6c4009 |
"bra 5f\n\t" \
|
|
Packit |
6c4009 |
" add r0,%0\n\t" \
|
|
Packit |
6c4009 |
".align 2\n\t" \
|
|
Packit |
6c4009 |
"3: .long " #x "@dtpoff\n\t" \
|
|
Packit |
6c4009 |
"5: mov.l @r15+,r12" \
|
|
Packit |
6c4009 |
: "=r" (__l) : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
|
|
Packit |
6c4009 |
"pr", "t"); \
|
|
Packit |
6c4009 |
__l; })
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifdef PIC
|
|
Packit |
6c4009 |
# define TLS_GD(x) \
|
|
Packit |
6c4009 |
({ int *__l; \
|
|
Packit |
6c4009 |
register void *__gp __asm__("r12"); \
|
|
Packit |
6c4009 |
asm ("mov.l 1f,r4\n\t" \
|
|
Packit |
6c4009 |
"mova 2f,r0\n\t" \
|
|
Packit |
6c4009 |
"mov.l 2f,r1\n\t" \
|
|
Packit |
6c4009 |
"add r0,r1\n\t" \
|
|
Packit |
6c4009 |
"jsr @r1\n\t" \
|
|
Packit |
6c4009 |
" add r12,r4\n\t" \
|
|
Packit |
6c4009 |
"bra 3f\n\t" \
|
|
Packit |
6c4009 |
" mov r0,%0\n\t" \
|
|
Packit |
6c4009 |
".align 2\n\t" \
|
|
Packit |
6c4009 |
"1: .long " #x "@tlsgd\n\t" \
|
|
Packit |
6c4009 |
"2: .long __tls_get_addr@plt\n\t" \
|
|
Packit |
6c4009 |
"3:" \
|
|
Packit |
6c4009 |
: "=r" (__l) : "r" (__gp) : "r0", "r1", "r2", "r3", "r4", "r5", \
|
|
Packit |
6c4009 |
"r6", "r7", "pr", "t"); \
|
|
Packit |
6c4009 |
__l; })
|
|
Packit |
6c4009 |
#else
|
|
Packit |
6c4009 |
# define TLS_GD(x) \
|
|
Packit |
6c4009 |
({ int *__l; \
|
|
Packit |
6c4009 |
asm ("mov.l r12,@-r15\n\t" \
|
|
Packit |
6c4009 |
"mova 0f,r0\n\t" \
|
|
Packit |
6c4009 |
"mov.l 0f,r12\n\t" \
|
|
Packit |
6c4009 |
"add r0,r12\n\t" \
|
|
Packit |
6c4009 |
"mov.l 1f,r4\n\t" \
|
|
Packit |
6c4009 |
"mova 2f,r0\n\t" \
|
|
Packit |
6c4009 |
"mov.l 2f,r1\n\t" \
|
|
Packit |
6c4009 |
"add r0,r1\n\t" \
|
|
Packit |
6c4009 |
"jsr @r1\n\t" \
|
|
Packit |
6c4009 |
" add r12,r4\n\t" \
|
|
Packit |
6c4009 |
"bra 3f\n\t" \
|
|
Packit |
6c4009 |
" mov r0,%0\n\t" \
|
|
Packit |
6c4009 |
".align 2\n\t" \
|
|
Packit |
6c4009 |
"1: .long " #x "@tlsgd\n\t" \
|
|
Packit |
6c4009 |
"2: .long __tls_get_addr@plt\n\t" \
|
|
Packit |
6c4009 |
"0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
|
|
Packit |
6c4009 |
"3: mov.l @r15+,r12" \
|
|
Packit |
6c4009 |
: "=r" (__l) : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
|
|
Packit |
6c4009 |
"pr", "t"); \
|
|
Packit |
6c4009 |
__l; })
|
|
Packit |
6c4009 |
#endif
|