]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
x86: Forward declare gd_t
authorGraeme Russ <graeme.russ@gmail.com>
Tue, 27 Nov 2012 15:38:35 +0000 (15:38 +0000)
committerSimon Glass <sjg@chromium.org>
Wed, 28 Nov 2012 19:40:03 +0000 (11:40 -0800)
So it can be used as a type in struct global_data and remove an ugly typecast

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
arch/x86/cpu/cpu.c
arch/x86/include/asm/global_data.h
arch/x86/lib/init_helpers.c

index e9bb0d770a379f6c329085da7217a3ba0dccd165..67de6bcb38b47a6ae8e37ccd38e38ba6aa63bbb2 100644 (file)
@@ -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);
 }
 
index bce999f41ce3ee1f80ac1b03a36eac5f8ff64ee4..13a3ce8fbf5e24bc47aceffc89e5e73c3cfd40d3 100644 (file)
 
 #ifndef __ASSEMBLY__
 
-typedef        struct global_data {
+typedef struct global_data gd_t;
+
+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 int    baudrate;
@@ -57,7 +59,7 @@ typedef       struct global_data {
        unsigned long   reset_status;   /* reset status register at boot */
        void            **jt;           /* jump table */
        char            env_buf[32];    /* buffer for getenv() before reloc. */
-} gd_t;
+};
 
 static inline gd_t *get_fs_gd_ptr(void)
 {
index 9ec34ff992baec321687243d25b9b11da4ee51c6..2f718d7c4ac1a7efafe822962493c885896fd973 100644 (file)
@@ -126,7 +126,7 @@ int copy_gd_to_ram_f_r(void)
         * in-RAM copy of Global Data (calculate_relocation_address()
         * has already calculated the in-RAM location of the GDT)
         */
-       ram_gd->gd_addr = (ulong)ram_gd;
+       ram_gd->gd_addr = ram_gd;
        init_gd(ram_gd, (u64 *)gd->gdt_addr);
 
        return 0;