diff mbox

[U-Boot,13/20] x86: Store the GDT pointer in global_data

Message ID 1430174911-27538-14-git-send-email-sjg@chromium.org
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass April 27, 2015, 10:48 p.m. UTC
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>
---

 arch/x86/cpu/cpu.c                 | 1 +
 arch/x86/include/asm/global_data.h | 1 +
 2 files changed, 2 insertions(+)

Comments

Bin Meng April 28, 2015, 7:55 a.m. UTC | #1
On Tue, Apr 28, 2015 at 6:48 AM, Simon Glass <sjg@chromium.org> wrote:
> 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>
> ---
>
>  arch/x86/cpu/cpu.c                 | 1 +
>  arch/x86/include/asm/global_data.h | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
> index 13b3baa..74bfed2 100644
> --- a/arch/x86/cpu/cpu.c
> +++ b/arch/x86/cpu/cpu.c
> @@ -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);
>
> diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h
> index 5ee06eb..4d9eac6 100644
> --- a/arch/x86/include/asm/global_data.h
> +++ b/arch/x86/include/asm/global_data.h
> @@ -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
> --

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
diff mbox

Patch

diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index 13b3baa..74bfed2 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -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);
 
diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h
index 5ee06eb..4d9eac6 100644
--- a/arch/x86/include/asm/global_data.h
+++ b/arch/x86/include/asm/global_data.h
@@ -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