From a939098afcfa5f81d3474782ec15c6d114e57763 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Wed, 28 May 2008 16:19:53 -0700 Subject: x86: move x86_64 gdt closer to i386 i386 and x86_64 used two different schemes for maintaining the gdt. With this patch, x86_64 initial gdt table is defined in a .c file, same way as i386 is now. Also, we call it "gdt_page", and the descriptor, "early_gdt_descr". This way we achieve common naming, which can allow for more code integration. Signed-off-by: Glauber Costa Signed-off-by: Ingo Molnar --- arch/x86/kernel/setup_64.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'arch/x86/kernel/setup_64.c') diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c index 504caeaffd5..a93300de4da 100644 --- a/arch/x86/kernel/setup_64.c +++ b/arch/x86/kernel/setup_64.c @@ -81,8 +81,6 @@ #define ARCH_SETUP #endif -#include "cpu/cpu.h" - /* * Machine setup.. */ @@ -228,6 +226,23 @@ static inline void copy_edd(void) } #endif +/* Overridden in paravirt.c if CONFIG_PARAVIRT */ +void __attribute__((weak)) __init memory_setup(void) +{ + machine_specific_memory_setup(); +} + +/* Current gdt points %fs at the "master" per-cpu area: after this, + * it's on the real one. */ +void switch_to_new_gdt(void) +{ + struct desc_ptr gdt_descr; + + gdt_descr.address = (long)get_cpu_gdt_table(smp_processor_id()); + gdt_descr.size = GDT_SIZE - 1; + load_gdt(&gdt_descr); +} + /* * setup_arch - architecture-specific boot-time initializations * -- cgit v1.2.3