[U-Boot] [PATCH 11/57] x86: Move gdt_addr, new_gd_addr to arch_global_data

Simon Glass sjg at chromium.org
Fri Nov 16 22:19:56 CET 2012


Move these field into arch_global_data and tidy up.

Signed-off-by: Simon Glass <sjg at chromium.org>
---
 arch/x86/include/asm/global_data.h |    4 ++--
 arch/x86/lib/init_helpers.c        |   10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h
index b4b749b..ce96efb 100644
--- a/arch/x86/include/asm/global_data.h
+++ b/arch/x86/include/asm/global_data.h
@@ -28,6 +28,8 @@
 
 /* Architecture-specific global data */
 struct arch_global_data {
+	unsigned long gdt_addr;		/* Location of GDT */
+	unsigned long new_gd_addr;	/* New location of Global Data */
 };
 
 /*
@@ -56,8 +58,6 @@ typedef	struct global_data {
 	unsigned long	bus_clk;
 	unsigned long	relocaddr;	/* Start address of U-Boot in RAM */
 	unsigned long	start_addr_sp;	/* start_addr_stackpointer */
-	unsigned long	gdt_addr;	/* Location of GDT */
-	unsigned long	new_gd_addr;	/* New location of Global Data */
 	phys_size_t	ram_size;	/* RAM size */
 	unsigned long	reset_status;	/* reset status register at boot */
 	void		**jt;		/* jump table */
diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c
index 9ec34ff..05cadcd 100644
--- a/arch/x86/lib/init_helpers.c
+++ b/arch/x86/lib/init_helpers.c
@@ -87,12 +87,12 @@ int calculate_relocation_address(void)
 	dest_addr = gd->ram_size;
 	dest_addr -= GENERATED_GBL_DATA_SIZE;
 	dest_addr &= ~15;
-	gd->new_gd_addr = dest_addr;
+	gd->arch.new_gd_addr = dest_addr;
 
 	/* GDT is below Global Data */
 	dest_addr -= X86_GDT_SIZE;
 	dest_addr &= ~15;
-	gd->gdt_addr = dest_addr;
+	gd->arch.gdt_addr = dest_addr;
 
 	/* Stack is below GDT */
 	gd->start_addr_sp = dest_addr;
@@ -113,12 +113,12 @@ int copy_gd_to_ram_f_r(void)
 
 	/*
 	 * Global data is still in temporary memory (the CPU cache).
-	 * calculate_relocation_address() has set gd->new_gd_addr to
+	 * calculate_relocation_address() has set gd->arch.new_gd_addr to
 	 * where the global data lives in RAM but getting it there
 	 * safely is a bit tricky due to the 'F-Segment Hack' that
 	 * we need to use for x86
 	 */
-	ram_gd = (gd_t *)gd->new_gd_addr;
+	ram_gd = (gd_t *)gd->arch.new_gd_addr;
 	memcpy((void *)ram_gd, gd, sizeof(gd_t));
 
 	/*
@@ -127,7 +127,7 @@ int copy_gd_to_ram_f_r(void)
 	 * has already calculated the in-RAM location of the GDT)
 	 */
 	ram_gd->gd_addr = (ulong)ram_gd;
-	init_gd(ram_gd, (u64 *)gd->gdt_addr);
+	init_gd(ram_gd, (u64 *)gd->arch.gdt_addr);
 
 	return 0;
 }
-- 
1.7.7.3



More information about the U-Boot mailing list