]> git.sur5r.net Git - u-boot/commitdiff
x86: Store the GDT pointer in global_data
authorSimon Glass <sjg@chromium.org>
Wed, 29 Apr 2015 02:25:15 +0000 (20:25 -0600)
committerSimon Glass <sjg@chromium.org>
Thu, 30 Apr 2015 03:02:34 +0000 (21:02 -0600)
When we start up additional CPUs we want them to use the same Global
Descriptor Table. Store the address of this in global_data so we can
reference it later.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/cpu.c
arch/x86/include/asm/global_data.h

index 02e66d80dbeefd27b440f5af2f12b0e1c251d7a8..78eb3feb3b14ca97888b38079f526bca20eeca8c 100644 (file)
@@ -133,6 +133,7 @@ static void load_gdt(const u64 *boot_gdt, u16 num_entries)
 
 void setup_gdt(gd_t *id, u64 *gdt_addr)
 {
+       id->arch.gdt = gdt_addr;
        /* CS: code, read/execute, 4 GB, base 0 */
        gdt_addr[X86_GDT_ENTRY_32BIT_CS] = GDT_ENTRY(0xc09b, 0, 0xfffff);
 
index 5ee06eb70d97da4323ed00e66a3d718f759c9631..4d9eac676ee91030221533c7a63131cd80d8ffdb 100644 (file)
@@ -68,6 +68,7 @@ struct arch_global_data {
        /* MRC training data to save for the next boot */
        char *mrc_output;
        unsigned int mrc_output_len;
+       void *gdt;                      /* Global descriptor table */
 };
 
 #endif