4 #include <aros/config.h>
6 #if defined(__AROSEXEC_SMP__)
7 #include <kernel_scheduler.h>
14 struct ExecBase
*SysBase
;
15 void *KernelBase
; /* Base of kernel.resource */
16 #if defined(__AROSEXEC_SMP__)
17 struct X86SchedulerPrivate
*ScheduleData
;
22 #define TLSSF_Quantum (1 << 0)
23 #define TLSSF_Switch (1 << 1)
24 #define TLSSF_Dispatch (1 << 2)
26 #define TLS_OFFSET(name) ((char *)&(((tls_t *)0)->name)-(char *)0)
28 #define TLS_GET(name) \
30 tls_t *__tls = (tls_t *)0; \
31 typeof(__tls -> name) __ret; \
32 switch (sizeof(__tls -> name)) { \
33 case 2: asm volatile("movw %%gs:%P1,%0":"=r"(__ret):"n"(TLS_OFFSET(name)):"memory"); break; \
34 case 4: asm volatile("movl %%gs:%P1,%0":"=r"(__ret):"n"(TLS_OFFSET(name)):"memory"); break; \
35 case 8: asm volatile("movq %%gs:%P1,%0":"=r"(__ret):"n"(TLS_OFFSET(name)):"memory"); break; \
40 #define TLS_SET(name, val) \
42 tls_t *__tls = (tls_t *)0; \
43 typeof(__tls -> name) __set = val; \
44 switch (sizeof(__tls -> name)) { \
45 case 2: asm volatile("movw %0,%%gs:%P1"::"r"(__set),"n"(TLS_OFFSET(name)):"memory"); break; \
46 case 4: asm volatile("movl %0,%%gs:%P1"::"r"(__set),"n"(TLS_OFFSET(name)):"memory"); break; \
47 case 8: asm volatile("movq %0,%%gs:%P1"::"r"(__set),"n"(TLS_OFFSET(name)):"memory"); break; \