diff options
Diffstat (limited to 'include/asm-x86/desc.h')
-rw-r--r-- | include/asm-x86/desc.h | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h index b3875d4b4fab..07f9f2b17be8 100644 --- a/include/asm-x86/desc.h +++ b/include/asm-x86/desc.h | |||
@@ -29,11 +29,17 @@ static inline void fill_ldt(struct desc_struct *desc, | |||
29 | extern struct desc_ptr idt_descr; | 29 | extern struct desc_ptr idt_descr; |
30 | extern gate_desc idt_table[]; | 30 | extern gate_desc idt_table[]; |
31 | 31 | ||
32 | struct gdt_page { | ||
33 | struct desc_struct gdt[GDT_ENTRIES]; | ||
34 | } __attribute__((aligned(PAGE_SIZE))); | ||
35 | DECLARE_PER_CPU(struct gdt_page, gdt_page); | ||
36 | |||
37 | static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu) | ||
38 | { | ||
39 | return per_cpu(gdt_page, cpu).gdt; | ||
40 | } | ||
41 | |||
32 | #ifdef CONFIG_X86_64 | 42 | #ifdef CONFIG_X86_64 |
33 | extern struct desc_struct cpu_gdt_table[GDT_ENTRIES]; | ||
34 | extern struct desc_ptr cpu_gdt_descr[]; | ||
35 | /* the cpu gdt accessor */ | ||
36 | #define get_cpu_gdt_table(x) ((struct desc_struct *)cpu_gdt_descr[x].address) | ||
37 | 43 | ||
38 | static inline void pack_gate(gate_desc *gate, unsigned type, unsigned long func, | 44 | static inline void pack_gate(gate_desc *gate, unsigned type, unsigned long func, |
39 | unsigned dpl, unsigned ist, unsigned seg) | 45 | unsigned dpl, unsigned ist, unsigned seg) |
@@ -51,16 +57,6 @@ static inline void pack_gate(gate_desc *gate, unsigned type, unsigned long func, | |||
51 | } | 57 | } |
52 | 58 | ||
53 | #else | 59 | #else |
54 | struct gdt_page { | ||
55 | struct desc_struct gdt[GDT_ENTRIES]; | ||
56 | } __attribute__((aligned(PAGE_SIZE))); | ||
57 | DECLARE_PER_CPU(struct gdt_page, gdt_page); | ||
58 | |||
59 | static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu) | ||
60 | { | ||
61 | return per_cpu(gdt_page, cpu).gdt; | ||
62 | } | ||
63 | |||
64 | static inline void pack_gate(gate_desc *gate, unsigned char type, | 60 | static inline void pack_gate(gate_desc *gate, unsigned char type, |
65 | unsigned long base, unsigned dpl, unsigned flags, | 61 | unsigned long base, unsigned dpl, unsigned flags, |
66 | unsigned short seg) | 62 | unsigned short seg) |