diff options
Diffstat (limited to 'i386/i386/ldt.h')
-rw-r--r-- | i386/i386/ldt.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/i386/i386/ldt.h b/i386/i386/ldt.h index 1f0d7014..51867f47 100644 --- a/i386/i386/ldt.h +++ b/i386/i386/ldt.h @@ -43,11 +43,16 @@ * User descriptors for Mach - 32-bit flat address space */ #define USER_SCALL 0x07 /* system call gate */ -#ifdef __x86_64__ +#if defined(__x86_64__) && ! defined(USER32) /* Call gate needs two entries */ -#endif + +/* The sysret instruction puts some constraints on the user segment indexes */ +#define USER_CS 0x1f /* user code segment */ +#define USER_DS 0x17 /* user data segment */ +#else #define USER_CS 0x17 /* user code segment */ #define USER_DS 0x1f /* user data segment */ +#endif #define LDTSZ 4 @@ -57,14 +62,15 @@ extern struct real_descriptor ldt[LDTSZ]; /* Fill a 32bit segment descriptor in the LDT. */ -#define fill_ldt_descriptor(selector, base, limit, access, sizebits) \ - fill_descriptor(&ldt[sel_idx(selector)], base, limit, access, sizebits) +#define fill_ldt_descriptor(_ldt, selector, base, limit, access, sizebits) \ + fill_descriptor(&_ldt[sel_idx(selector)], base, limit, access, sizebits) -#define fill_ldt_gate(selector, offset, dest_selector, access, word_count) \ - fill_gate((struct real_gate*)&ldt[sel_idx(selector)], \ +#define fill_ldt_gate(_ldt, selector, offset, dest_selector, access, word_count) \ + fill_gate((struct real_gate*)&_ldt[sel_idx(selector)], \ offset, dest_selector, access, word_count) void ldt_init(void); +void ap_ldt_init(int cpu); #endif /* !__ASSEMBLER__ */ |