6 struct ExecBase
*SysBase
;
7 void * *KernelBase
; /* Base of kernel.resource */
10 #define TLS_OFFSET(name) ((char *)&(((tls_t *)0)->name)-(char *)0)
12 #define TLS_GET(name) \
14 tls_t *__tls = (tls_t *)0; \
15 typeof(__tls -> name) __ret; \
16 switch (sizeof(__tls -> name)) { \
17 case 2: asm volatile("movw %%gs:%P1,%0":"=r"(__ret):"n"(TLS_OFFSET(name)):"memory"); break; \
18 case 4: asm volatile("movl %%gs:%P1,%0":"=r"(__ret):"n"(TLS_OFFSET(name)):"memory"); break; \
19 case 8: asm volatile("movq %%gs:%P1,%0":"=r"(__ret):"n"(TLS_OFFSET(name)):"memory"); break; \
24 #define TLS_SET(name, val) \
26 tls_t *__tls = (tls_t *)0; \
27 typeof(__tls -> name) __set = val; \
28 switch (sizeof(__tls -> name)) { \
29 case 2: asm volatile("movw %0,%%gs:%P1"::"r"(__set),"n"(TLS_OFFSET(name)):"memory"); break; \
30 case 4: asm volatile("movl %0,%%gs:%P1"::"r"(__set),"n"(TLS_OFFSET(name)):"memory"); break; \
31 case 8: asm volatile("movq %0,%%gs:%P1"::"r"(__set),"n"(TLS_OFFSET(name)):"memory"); break; \