From patchwork Fri Nov 16 21:19:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,11/57] x86: Move gdt_addr, new_gd_addr to arch_global_data Date: Fri, 16 Nov 2012 11:19:56 -0000 From: Simon Glass X-Patchwork-Id: 199738 Message-Id: <1353100842-20126-12-git-send-email-sjg@chromium.org> To: U-Boot Mailing List Cc: Tom Rini Move these field into arch_global_data and tidy up. Signed-off-by: Simon Glass --- 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; }