aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/traps.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2007-05-02 13:27:11 -0400
committerAndi Kleen <andi@basil.nowhere.org>2007-05-02 13:27:11 -0400
commit4fbb5968810b237e81977f131986b9efd5245368 (patch)
treee2d67eee96c143da26ccad791b3e1f23c3bcbe03 /arch/i386/kernel/traps.c
parent141f9cfe0a948c8fe26e5669364ee62c03ea42e8 (diff)
[PATCH] i386: cleanup GDT Access
Now we have an explicit per-cpu GDT variable, we don't need to keep the descriptors around to use them to find the GDT: expose cpu_gdt directly. We could go further and make load_gdt() pack the descriptor for us, or even assume it means "load the current cpu's GDT" which is what it always does. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'arch/i386/kernel/traps.c')
-rw-r--r--arch/i386/kernel/traps.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 58dfecc8e36c..8722444cacaa 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -1030,9 +1030,7 @@ fastcall void do_spurious_interrupt_bug(struct pt_regs * regs,
1030fastcall unsigned long patch_espfix_desc(unsigned long uesp, 1030fastcall unsigned long patch_espfix_desc(unsigned long uesp,
1031 unsigned long kesp) 1031 unsigned long kesp)
1032{ 1032{
1033 int cpu = smp_processor_id(); 1033 struct desc_struct *gdt = __get_cpu_var(cpu_gdt);
1034 struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, cpu);
1035 struct desc_struct *gdt = (struct desc_struct *)cpu_gdt_descr->address;
1036 unsigned long base = (kesp - uesp) & -THREAD_SIZE; 1034 unsigned long base = (kesp - uesp) & -THREAD_SIZE;
1037 unsigned long new_kesp = kesp - base; 1035 unsigned long new_kesp = kesp - base;
1038 unsigned long lim_pages = (new_kesp | (THREAD_SIZE - 1)) >> PAGE_SHIFT; 1036 unsigned long lim_pages = (new_kesp | (THREAD_SIZE - 1)) >> PAGE_SHIFT;