aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/desc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/desc.h')
-rw-r--r--include/asm-x86/desc.h35
1 files changed, 22 insertions, 13 deletions
diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
index a44c4dc70590..f06adac7938c 100644
--- a/include/asm-x86/desc.h
+++ b/include/asm-x86/desc.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_DESC_H_ 1#ifndef ASM_X86__DESC_H
2#define _ASM_DESC_H_ 2#define ASM_X86__DESC_H
3 3
4#ifndef __ASSEMBLY__ 4#ifndef __ASSEMBLY__
5#include <asm/desc_defs.h> 5#include <asm/desc_defs.h>
@@ -24,6 +24,11 @@ static inline void fill_ldt(struct desc_struct *desc,
24 desc->d = info->seg_32bit; 24 desc->d = info->seg_32bit;
25 desc->g = info->limit_in_pages; 25 desc->g = info->limit_in_pages;
26 desc->base2 = (info->base_addr & 0xff000000) >> 24; 26 desc->base2 = (info->base_addr & 0xff000000) >> 24;
27 /*
28 * Don't allow setting of the lm bit. It is useless anyway
29 * because 64bit system calls require __USER_CS:
30 */
31 desc->l = 0;
27} 32}
28 33
29extern struct desc_ptr idt_descr; 34extern struct desc_ptr idt_descr;
@@ -97,7 +102,15 @@ static inline int desc_empty(const void *ptr)
97 native_write_gdt_entry(dt, entry, desc, type) 102 native_write_gdt_entry(dt, entry, desc, type)
98#define write_idt_entry(dt, entry, g) \ 103#define write_idt_entry(dt, entry, g) \
99 native_write_idt_entry(dt, entry, g) 104 native_write_idt_entry(dt, entry, g)
100#endif 105
106static inline void paravirt_alloc_ldt(struct desc_struct *ldt, unsigned entries)
107{
108}
109
110static inline void paravirt_free_ldt(struct desc_struct *ldt, unsigned entries)
111{
112}
113#endif /* CONFIG_PARAVIRT */
101 114
102static inline void native_write_idt_entry(gate_desc *idt, int entry, 115static inline void native_write_idt_entry(gate_desc *idt, int entry,
103 const gate_desc *gate) 116 const gate_desc *gate)
@@ -338,20 +351,16 @@ static inline void set_system_intr_gate(unsigned int n, void *addr)
338 _set_gate(n, GATE_INTERRUPT, addr, 0x3, 0, __KERNEL_CS); 351 _set_gate(n, GATE_INTERRUPT, addr, 0x3, 0, __KERNEL_CS);
339} 352}
340 353
341static inline void set_trap_gate(unsigned int n, void *addr) 354static inline void set_system_trap_gate(unsigned int n, void *addr)
342{ 355{
343 BUG_ON((unsigned)n > 0xFF); 356 BUG_ON((unsigned)n > 0xFF);
344 _set_gate(n, GATE_TRAP, addr, 0, 0, __KERNEL_CS); 357 _set_gate(n, GATE_TRAP, addr, 0x3, 0, __KERNEL_CS);
345} 358}
346 359
347static inline void set_system_gate(unsigned int n, void *addr) 360static inline void set_trap_gate(unsigned int n, void *addr)
348{ 361{
349 BUG_ON((unsigned)n > 0xFF); 362 BUG_ON((unsigned)n > 0xFF);
350#ifdef CONFIG_X86_32 363 _set_gate(n, GATE_TRAP, addr, 0, 0, __KERNEL_CS);
351 _set_gate(n, GATE_TRAP, addr, 0x3, 0, __KERNEL_CS);
352#else
353 _set_gate(n, GATE_INTERRUPT, addr, 0x3, 0, __KERNEL_CS);
354#endif
355} 364}
356 365
357static inline void set_task_gate(unsigned int n, unsigned int gdt_entry) 366static inline void set_task_gate(unsigned int n, unsigned int gdt_entry)
@@ -366,7 +375,7 @@ static inline void set_intr_gate_ist(int n, void *addr, unsigned ist)
366 _set_gate(n, GATE_INTERRUPT, addr, 0, ist, __KERNEL_CS); 375 _set_gate(n, GATE_INTERRUPT, addr, 0, ist, __KERNEL_CS);
367} 376}
368 377
369static inline void set_system_gate_ist(int n, void *addr, unsigned ist) 378static inline void set_system_intr_gate_ist(int n, void *addr, unsigned ist)
370{ 379{
371 BUG_ON((unsigned)n > 0xFF); 380 BUG_ON((unsigned)n > 0xFF);
372 _set_gate(n, GATE_INTERRUPT, addr, 0x3, ist, __KERNEL_CS); 381 _set_gate(n, GATE_INTERRUPT, addr, 0x3, ist, __KERNEL_CS);
@@ -397,4 +406,4 @@ static inline void set_system_gate_ist(int n, void *addr, unsigned ist)
397 406
398#endif /* __ASSEMBLY__ */ 407#endif /* __ASSEMBLY__ */
399 408
400#endif 409#endif /* ASM_X86__DESC_H */