]>
Commit | Line | Data |
---|---|---|
fbdf2161 PBG |
1 | #ifndef __ASM_HOST_LDT_X86_64_H |
2 | #define __ASM_HOST_LDT_X86_64_H | |
858259cf | 3 | |
efb21cc2 | 4 | #include <asm/ldt.h> |
858259cf | 5 | |
858259cf | 6 | /* |
4cd7ed94 | 7 | * macros stolen from include/asm-x86_64/desc.h |
858259cf BS |
8 | */ |
9 | #define LDT_entry_a(info) \ | |
10 | ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff)) | |
11 | ||
4cd7ed94 PBG |
12 | /* Don't allow setting of the lm bit. It is useless anyways because |
13 | * 64bit system calls require __USER_CS. */ | |
858259cf BS |
14 | #define LDT_entry_b(info) \ |
15 | (((info)->base_addr & 0xff000000) | \ | |
16 | (((info)->base_addr & 0x00ff0000) >> 16) | \ | |
17 | ((info)->limit & 0xf0000) | \ | |
18 | (((info)->read_exec_only ^ 1) << 9) | \ | |
19 | ((info)->contents << 10) | \ | |
20 | (((info)->seg_not_present ^ 1) << 15) | \ | |
21 | ((info)->seg_32bit << 22) | \ | |
22 | ((info)->limit_in_pages << 23) | \ | |
23 | ((info)->useable << 20) | \ | |
4cd7ed94 | 24 | /* ((info)->lm << 21) | */ \ |
858259cf BS |
25 | 0x7000) |
26 | ||
27 | #define LDT_empty(info) (\ | |
28 | (info)->base_addr == 0 && \ | |
29 | (info)->limit == 0 && \ | |
30 | (info)->contents == 0 && \ | |
31 | (info)->read_exec_only == 1 && \ | |
32 | (info)->seg_32bit == 0 && \ | |
33 | (info)->limit_in_pages == 0 && \ | |
34 | (info)->seg_not_present == 1 && \ | |
4cd7ed94 PBG |
35 | (info)->useable == 0 && \ |
36 | (info)->lm == 0) | |
858259cf BS |
37 | |
38 | #endif |