7 #include <utility/tagitem.h>
17 unsigned long long ti_Tag
;
18 unsigned long long ti_Data
;
21 #define TAG_DONE 0x00000000ULL
22 #define TAG_USER 0x80000000ULL
31 struct Task
*ThisTask
;
32 struct ExecBase
*SysBase
;
33 void * *KernelBase
; /* Base of kernel.resource */
36 #define TLS_OFFSET(name) ((char *)&(((tls_t *)0)->name)-(char *)0)
38 #define TLS_GET(name) \
40 tls_t *__tls = (tls_t *)0; \
41 typeof(__tls -> name) __ret; \
42 switch (sizeof(__tls -> name)) { \
43 case 2: asm volatile("movw %%gs:%P1,%0":"=r"(__ret):"n"(TLS_OFFSET(name)):"memory"); break; \
44 case 4: asm volatile("movl %%gs:%P1,%0":"=r"(__ret):"n"(TLS_OFFSET(name)):"memory"); break; \
45 case 8: asm volatile("movq %%gs:%P1,%0":"=r"(__ret):"n"(TLS_OFFSET(name)):"memory"); break; \
50 #define TLS_SET(name, val) \
52 tls_t *__tls = (tls_t *)0; \
53 typeof(__tls -> name) __set = val; \
54 switch (sizeof(__tls -> name)) { \
55 case 2: asm volatile("movw %0,%%gs:%P1"::"r"(__set),"n"(TLS_OFFSET(name)):"memory"); break; \
56 case 4: asm volatile("movl %0,%%gs:%P1"::"r"(__set),"n"(TLS_OFFSET(name)):"memory"); break; \
57 case 8: asm volatile("movq %0,%%gs:%P1"::"r"(__set),"n"(TLS_OFFSET(name)):"memory"); break; \
62 #define KRN_Dummy (TAG_USER + 0x03d00000)
63 #define KRN_KernelBase (KRN_Dummy + 1)
64 #define KRN_KernelLowest (KRN_Dummy + 2)
65 #define KRN_KernelHighest (KRN_Dummy + 3)
66 #define KRN_KernelBss (KRN_Dummy + 4)
67 #define KRN_GDT (KRN_Dummy + 5)
68 #define KRN_IDT (KRN_Dummy + 6)
69 #define KRN_PL4 (KRN_Dummy + 7)
70 #define KRN_VBEModeInfo (KRN_Dummy + 8)
71 #define KRN_VBEControllerInfo (KRN_Dummy + 9)
72 #define KRN_MMAPAddress (KRN_Dummy + 10)
73 #define KRN_MMAPLength (KRN_Dummy + 11)
74 #define KRN_CmdLine (KRN_Dummy + 12)
75 #define KRN_ProtAreaStart (KRN_Dummy + 13)
76 #define KRN_ProtAreaEnd (KRN_Dummy + 14)
77 #define KRN_VBEMode (KRN_Dummy + 15)
78 #define KRN_VBEPaletteWidth (KRN_Dummy + 16)
81 * The target base address of 64-bit kernel
84 #define KERNEL_TARGET_ADDRESS 0x01000000
85 //#define KERNEL_HIGH_OFFSET 0x1ffULL
86 //#define KERNEL_HIGH_OFFSET 0x1ffULL
87 //#define KERNEL_HIGH_OFFSET 31ULL
88 //#define KERNEL_OFFSET 0x01000000
89 #define KERNEL_OFFSET 0
90 //#define KERNEL_OFFSET 0xfffffffff8000000ULL
91 //#define KERNEL_OFFSET 0x0000000000000000ULL
93 #endif /*AROS_ KERNEL_H*/