From patchwork Sun Apr 29 12:00:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,2/5] x86: Forward declate gd_t Date: Sun, 29 Apr 2012 02:00:20 -0000 From: Graeme Russ X-Patchwork-Id: 155728 Message-Id: <1335700823-15144-3-git-send-email-graeme.russ@gmail.com> To: u-boot@lists.denx.de So it can be used as a type in struct global_data and remove an ugly typecast Signed-off-by: Graeme Russ Acked-by: Marek Vasut --- arch/x86/cpu/cpu.c | 2 +- arch/x86/include/asm/global_data.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index e9bb0d7..67de6bc 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -92,7 +92,7 @@ static void load_gdt(const u64 *boot_gdt, u16 num_entries) void init_gd(gd_t *id, u64 *gdt_addr) { - id->gd_addr = (ulong)id; + id->gd_addr = id; setup_gdt(id, gdt_addr); } diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h index 908a02c..8a8896e 100644 --- a/arch/x86/include/asm/global_data.h +++ b/arch/x86/include/asm/global_data.h @@ -35,9 +35,11 @@ #ifndef __ASSEMBLY__ +typedef struct global_data gd_t; + typedef struct global_data { /* NOTE: gd_addr MUST be first member of struct global_data! */ - unsigned long gd_addr; /* Location of Global Data */ + gd_t *gd_addr; /* Location of Global Data */ bd_t *bd; unsigned long flags; unsigned long baudrate;