wip.. store the idletask in TLS. move the execsmp bootstrap code into its own file...
[AROS.git] / arch / arm-native / kernel / tls.h
blobfbb63ff09f634a964f277daacb95ae162ab9692d
1 #ifndef ASM_TLS_H
2 #define ASM_TLS_H
4 typedef struct tls
6 struct ExecBase *SysBase;
7 void * *KernelBase; /* Base of kernel.resource */
8 struct Task *ThisTask; /* Currently running task on this core */
9 struct Task *IdleTask;
10 } tls_t;
12 #define TLS_OFFSET(name) ((char *)&(((tls_t *)0)->name)-(char *)0)
14 ////
16 #define TLS_GET(name) \
17 ({ \
18 tls_t *__tls; \
19 asm volatile("mrc p15, 0, %0, c13, c0, 3":"=r"(__tls)); \
20 typeof(__tls -> name) __ret = (__tls -> name); \
21 __ret; \
24 #define TLS_SET(name, val) \
25 do { \
26 tls_t *__tls; \
27 asm volatile("mrc p15, 0, %0, c13, c0, 3":"=r"(__tls)); \
28 (__tls -> name) = val; \
29 } while(0);
31 #endif