Merge sysdeps/alpha/elf/ into sysdeps/alpha/.
[glibc-ports.git] / sysdeps / alpha / tls-macros.h
blob0385d93e2a3918c5ad922a613ae29031e1016427
1 /* Macros to support TLS testing in times of missing compiler support. */
3 extern void *__tls_get_addr (void *);
5 # define TLS_GD(x) \
6 ({ void *__result; \
7 asm ("lda %0, " #x "($gp) !tlsgd" : "=r" (__result)); \
8 __tls_get_addr (__result); })
10 # define TLS_LD(x) \
11 ({ void *__result; \
12 asm ("lda %0, " #x "($gp) !tlsldm" : "=r" (__result)); \
13 __result = __tls_get_addr (__result); \
14 asm ("lda %0, " #x "(%0) !dtprel" : "+r" (__result)); \
15 __result; })
17 # define TLS_IE(x) \
18 ({ long ofs; \
19 asm ("ldq %0, " #x "($gp) !gottprel" : "=r"(ofs)); \
20 __builtin_thread_pointer () + ofs; })
22 # define TLS_LE(x) \
23 ({ void *__result = __builtin_thread_pointer (); \
24 asm ("lda %0, " #x "(%0) !tprel" : "+r" (__result)); \
25 __result; })