Loading include/asm-x86/desc_64.h +52 −45 Original line number Diff line number Diff line Loading @@ -51,9 +51,11 @@ static inline void store_gdt(struct desc_ptr *ptr) asm("sgdt %w0":"=m" (*ptr)); } static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsigned dpl, unsigned ist) static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsigned dpl, unsigned ist) { struct gate_struct s; s.offset_low = PTR_LOW(func); s.segment = __KERNEL_CS; s.ist = ist; Loading @@ -64,7 +66,10 @@ static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsig s.type = type; s.offset_middle = PTR_MIDDLE(func); s.offset_high = PTR_HIGH(func); /* does not need to be atomic because it is only done once at setup time */ /* * does not need to be atomic because it is only done once at * setup time */ memcpy(adr, &s, 16); } Loading Loading @@ -101,10 +106,11 @@ static inline void store_idt(struct desc_ptr *dtr) asm("sidt %w0":"=m" (*dtr)); } static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned type, unsigned size) static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned type, unsigned size) { struct ldttss_desc d; memset(&d, 0, sizeof(d)); d.limit0 = size & 0xFFFF; d.base0 = PTR_LOW(tss); Loading Loading @@ -193,6 +199,7 @@ static inline void load_LDT_nolock (mm_context_t *pc, int cpu) static inline void load_LDT(mm_context_t *pc) { int cpu = get_cpu(); load_LDT_nolock(pc, cpu); put_cpu(); } Loading Loading
include/asm-x86/desc_64.h +52 −45 Original line number Diff line number Diff line Loading @@ -51,9 +51,11 @@ static inline void store_gdt(struct desc_ptr *ptr) asm("sgdt %w0":"=m" (*ptr)); } static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsigned dpl, unsigned ist) static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsigned dpl, unsigned ist) { struct gate_struct s; s.offset_low = PTR_LOW(func); s.segment = __KERNEL_CS; s.ist = ist; Loading @@ -64,7 +66,10 @@ static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsig s.type = type; s.offset_middle = PTR_MIDDLE(func); s.offset_high = PTR_HIGH(func); /* does not need to be atomic because it is only done once at setup time */ /* * does not need to be atomic because it is only done once at * setup time */ memcpy(adr, &s, 16); } Loading Loading @@ -101,10 +106,11 @@ static inline void store_idt(struct desc_ptr *dtr) asm("sidt %w0":"=m" (*dtr)); } static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned type, unsigned size) static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned type, unsigned size) { struct ldttss_desc d; memset(&d, 0, sizeof(d)); d.limit0 = size & 0xFFFF; d.base0 = PTR_LOW(tss); Loading Loading @@ -193,6 +199,7 @@ static inline void load_LDT_nolock (mm_context_t *pc, int cpu) static inline void load_LDT(mm_context_t *pc) { int cpu = get_cpu(); load_LDT_nolock(pc, cpu); put_cpu(); } Loading