aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86/boot
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/boot')
-rw-r--r--src/arch/x86/boot/gdt.c12
-rw-r--r--src/arch/x86/boot/tables.c2
2 files changed, 6 insertions, 8 deletions
diff --git a/src/arch/x86/boot/gdt.c b/src/arch/x86/boot/gdt.c
index 7ebf92ae85..7b64af7c2e 100644
--- a/src/arch/x86/boot/gdt.c
+++ b/src/arch/x86/boot/gdt.c
@@ -20,12 +20,8 @@
#include <types.h>
#include <string.h>
#include <cbmem.h>
-#include <lib.h>
#include <console/console.h>
-
-// Global Descriptor Table, defined in c_start.S
-extern char gdt;
-extern char gdt_end;
+#include <cpu/x86/gdt.h>
/* i386 lgdt argument */
struct gdtarg {
@@ -33,11 +29,13 @@ struct gdtarg {
u32 base;
} __attribute__((packed));
-// Copy GDT to new location and reload it
+/* Copy GDT to new location and reload it.
+ * FIXME: We only do this for BSP CPU.
+ */
void move_gdt(void)
{
void *newgdt;
- u16 num_gdt_bytes = &gdt_end - &gdt;
+ u16 num_gdt_bytes = (u32)&gdt_end - (u32)&gdt;
struct gdtarg gdtarg;
newgdt = cbmem_find(CBMEM_ID_GDT);
diff --git a/src/arch/x86/boot/tables.c b/src/arch/x86/boot/tables.c
index 9f2afd4a2f..8685ed48df 100644
--- a/src/arch/x86/boot/tables.c
+++ b/src/arch/x86/boot/tables.c
@@ -21,6 +21,7 @@
#include <console/console.h>
#include <cpu/cpu.h>
+#include <cpu/x86/gdt.h>
#include <boot/tables.h>
#include <boot/coreboot_tables.h>
#include <arch/pirq_routing.h>
@@ -28,7 +29,6 @@
#include <arch/acpi.h>
#include <string.h>
#include <cbmem.h>
-#include <lib.h>
#include <smbios.h>