Commit 4edc8f54 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Ingo Molnar

x86: clean up include/asm-x86/desc_64.h

White space and coding style clenaup.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 78aa1f66
...@@ -51,9 +51,11 @@ static inline void store_gdt(struct desc_ptr *ptr) ...@@ -51,9 +51,11 @@ static inline void store_gdt(struct desc_ptr *ptr)
asm("sgdt %w0":"=m" (*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; struct gate_struct s;
s.offset_low = PTR_LOW(func); s.offset_low = PTR_LOW(func);
s.segment = __KERNEL_CS; s.segment = __KERNEL_CS;
s.ist = ist; s.ist = ist;
...@@ -64,7 +66,10 @@ static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsig ...@@ -64,7 +66,10 @@ static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsig
s.type = type; s.type = type;
s.offset_middle = PTR_MIDDLE(func); s.offset_middle = PTR_MIDDLE(func);
s.offset_high = PTR_HIGH(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); memcpy(adr, &s, 16);
} }
...@@ -101,11 +106,12 @@ static inline void store_idt(struct desc_ptr *dtr) ...@@ -101,11 +106,12 @@ static inline void store_idt(struct desc_ptr *dtr)
asm("sidt %w0":"=m" (*dtr)); asm("sidt %w0":"=m" (*dtr));
} }
static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned type, static inline void set_tssldt_descriptor(void *ptr, unsigned long tss,
unsigned size) unsigned type, unsigned size)
{ {
struct ldttss_desc d; struct ldttss_desc d;
memset(&d,0,sizeof(d));
memset(&d, 0, sizeof(d));
d.limit0 = size & 0xFFFF; d.limit0 = size & 0xFFFF;
d.base0 = PTR_LOW(tss); d.base0 = PTR_LOW(tss);
d.base1 = PTR_MIDDLE(tss) & 0xFF; d.base1 = PTR_MIDDLE(tss) & 0xFF;
...@@ -177,7 +183,7 @@ static inline void load_TLS(struct thread_struct *t, unsigned int cpu) ...@@ -177,7 +183,7 @@ static inline void load_TLS(struct thread_struct *t, unsigned int cpu)
/* /*
* load one particular LDT into the current CPU * load one particular LDT into the current CPU
*/ */
static inline void load_LDT_nolock (mm_context_t *pc, int cpu) static inline void load_LDT_nolock(mm_context_t *pc, int cpu)
{ {
int count = pc->size; int count = pc->size;
...@@ -193,6 +199,7 @@ static inline void load_LDT_nolock (mm_context_t *pc, int cpu) ...@@ -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) static inline void load_LDT(mm_context_t *pc)
{ {
int cpu = get_cpu(); int cpu = get_cpu();
load_LDT_nolock(pc, cpu); load_LDT_nolock(pc, cpu);
put_cpu(); put_cpu();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment