]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Change stub example to use asm-generic/sections.h
authorSimon Glass <sjg@chromium.org>
Tue, 5 Mar 2013 14:39:39 +0000 (14:39 +0000)
committerTom Rini <trini@ti.com>
Fri, 15 Mar 2013 20:13:58 +0000 (16:13 -0400)
We can use the declarations of __bss_start and _end from this header
instead of declaring them locally.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/mips/include/asm/u-boot-mips.h
arch/nds32/include/asm/u-boot-nds32.h
arch/x86/include/asm/u-boot-x86.h
examples/standalone/stubs.c

index a483166a9c992eeca804fa03f3b31f226b2c803c..e77636eaaf67b46e20cd6b3b26f6e5716dde3a54 100644 (file)
@@ -7,7 +7,7 @@
 
 static inline unsigned long bss_start(void)
 {
-       extern ulong __bss_start;
+       extern char __bss_start[];
        return (unsigned long) &__bss_start;
 }
 
@@ -19,7 +19,7 @@ static inline unsigned long bss_end(void)
 
 static inline unsigned long image_copy_end(void)
 {
-       extern ulong __image_copy_end;
+       extern char __image_copy_end[];
        return (unsigned long) &__image_copy_end;
 }
 
index a6d7bebf6fc2c051d36eb4b2a7b50b8248a45cca..f3c7b271e97ba20c78d9107f9dde1e5d3436cfe7 100644 (file)
 #define _U_BOOT_NDS32_H_       1
 
 /* for the following variables, see start.S */
-extern ulong __bss_start;      /* BSS start relative to _start */
-extern ulong __bss_end;        /* BSS end relative to _start */
-extern ulong _end;             /* end of image relative to _start */
-extern ulong _start;           /* start of image relative to _start */
+extern char __bss_start[];     /* BSS start relative to _start */
+extern ulong __bss_end;                /* BSS end relative to _start */
+extern char _end[];            /* end of image relative to _start */
+extern void _start(void);      /* start of image relative to _start */
 extern ulong _TEXT_BASE;       /* code start */
 extern ulong IRQ_STACK_START;  /* top of IRQ stack */
 extern ulong FIQ_STACK_START;  /* top of FIQ stack */
index 948615d4385ef32bd41c95ad26ac1a1c90824ddd..3e380fe81d101a11445a2724aef607d2f984d90d 100644 (file)
 #define _U_BOOT_I386_H_        1
 
 /* Exports from the Linker Script */
-extern ulong __text_start;
+extern char __text_start[];
 extern ulong __data_end;
 extern ulong __rel_dyn_start;
 extern ulong __rel_dyn_end;
-extern ulong __bss_start;
+extern char __bss_start[];
 extern ulong __bss_end;
-extern ulong _end;
+extern char _end[];
 
 /* cpu/.../cpu.c */
 int x86_cpu_init_r(void);
index 15e9afcacd0904da1003e1aec88820f2c8281a31..8fb17653b0d22cf9023dc23cdaceeed4ee090f6e 100644 (file)
@@ -217,16 +217,15 @@ void __attribute__((unused)) dummy(void)
 #include <_exports.h>
 }
 
-extern unsigned long __bss_start, _end;
+#include <asm/sections.h>
 
 void app_startup(char * const *argv)
 {
-       unsigned char * cp = (unsigned char *) &__bss_start;
+       char *cp = __bss_start;
 
        /* Zero out BSS */
-       while (cp < (unsigned char *)&_end) {
+       while (cp < _end)
                *cp++ = 0;
-       }
 
 #if defined(CONFIG_X86)
        /* x86 does not have a dedicated register for passing global_data */