diff options
Diffstat (limited to 'include/asm-x86_64/desc.h')
-rw-r--r-- | include/asm-x86_64/desc.h | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/include/asm-x86_64/desc.h b/include/asm-x86_64/desc.h index eb7723a46790..913d6ac00033 100644 --- a/include/asm-x86_64/desc.h +++ b/include/asm-x86_64/desc.h | |||
@@ -9,64 +9,13 @@ | |||
9 | 9 | ||
10 | #include <linux/string.h> | 10 | #include <linux/string.h> |
11 | #include <linux/smp.h> | 11 | #include <linux/smp.h> |
12 | #include <asm/desc_defs.h> | ||
12 | 13 | ||
13 | #include <asm/segment.h> | 14 | #include <asm/segment.h> |
14 | #include <asm/mmu.h> | 15 | #include <asm/mmu.h> |
15 | 16 | ||
16 | // 8 byte segment descriptor | ||
17 | struct desc_struct { | ||
18 | u16 limit0; | ||
19 | u16 base0; | ||
20 | unsigned base1 : 8, type : 4, s : 1, dpl : 2, p : 1; | ||
21 | unsigned limit : 4, avl : 1, l : 1, d : 1, g : 1, base2 : 8; | ||
22 | } __attribute__((packed)); | ||
23 | |||
24 | struct n_desc_struct { | ||
25 | unsigned int a,b; | ||
26 | }; | ||
27 | |||
28 | extern struct desc_struct cpu_gdt_table[GDT_ENTRIES]; | 17 | extern struct desc_struct cpu_gdt_table[GDT_ENTRIES]; |
29 | 18 | ||
30 | enum { | ||
31 | GATE_INTERRUPT = 0xE, | ||
32 | GATE_TRAP = 0xF, | ||
33 | GATE_CALL = 0xC, | ||
34 | }; | ||
35 | |||
36 | // 16byte gate | ||
37 | struct gate_struct { | ||
38 | u16 offset_low; | ||
39 | u16 segment; | ||
40 | unsigned ist : 3, zero0 : 5, type : 5, dpl : 2, p : 1; | ||
41 | u16 offset_middle; | ||
42 | u32 offset_high; | ||
43 | u32 zero1; | ||
44 | } __attribute__((packed)); | ||
45 | |||
46 | #define PTR_LOW(x) ((unsigned long)(x) & 0xFFFF) | ||
47 | #define PTR_MIDDLE(x) (((unsigned long)(x) >> 16) & 0xFFFF) | ||
48 | #define PTR_HIGH(x) ((unsigned long)(x) >> 32) | ||
49 | |||
50 | enum { | ||
51 | DESC_TSS = 0x9, | ||
52 | DESC_LDT = 0x2, | ||
53 | }; | ||
54 | |||
55 | // LDT or TSS descriptor in the GDT. 16 bytes. | ||
56 | struct ldttss_desc { | ||
57 | u16 limit0; | ||
58 | u16 base0; | ||
59 | unsigned base1 : 8, type : 5, dpl : 2, p : 1; | ||
60 | unsigned limit1 : 4, zero0 : 3, g : 1, base2 : 8; | ||
61 | u32 base3; | ||
62 | u32 zero1; | ||
63 | } __attribute__((packed)); | ||
64 | |||
65 | struct desc_ptr { | ||
66 | unsigned short size; | ||
67 | unsigned long address; | ||
68 | } __attribute__((packed)) ; | ||
69 | |||
70 | #define load_TR_desc() asm volatile("ltr %w0"::"r" (GDT_ENTRY_TSS*8)) | 19 | #define load_TR_desc() asm volatile("ltr %w0"::"r" (GDT_ENTRY_TSS*8)) |
71 | #define load_LDT_desc() asm volatile("lldt %w0"::"r" (GDT_ENTRY_LDT*8)) | 20 | #define load_LDT_desc() asm volatile("lldt %w0"::"r" (GDT_ENTRY_LDT*8)) |
72 | #define clear_LDT() asm volatile("lldt %w0"::"r" (0)) | 21 | #define clear_LDT() asm volatile("lldt %w0"::"r" (0)) |