[U-Boot] [PATCH v5 06/23] x86: nds32: Change stub example to use asm-generic/sections.h

Simon Glass sjg at chromium.org
Fri Feb 8 16:12:02 CET 2013


We can use the declarations of __bss_start and _end from this header
instead of declaring them locally.

Signed-off-by: Simon Glass <sjg at chromium.org>
---
Changes in v5:
- Adjust u-boot-nds32.h link symbols to keep U-Boot building

Changes in v4:
- Use asm/sections.h instead of asm-generic/sections.h
- Adjust u-boot-x86.h link symbols to keep U-Boot building

Changes in v3: None
Changes in v2: None

 arch/nds32/include/asm/u-boot-nds32.h | 8 ++++----
 arch/x86/include/asm/u-boot-x86.h     | 6 +++---
 examples/standalone/stubs.c           | 7 +++----
 3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/arch/nds32/include/asm/u-boot-nds32.h b/arch/nds32/include/asm/u-boot-nds32.h
index a6d7beb..f3c7b27 100644
--- a/arch/nds32/include/asm/u-boot-nds32.h
+++ b/arch/nds32/include/asm/u-boot-nds32.h
@@ -30,10 +30,10 @@
 #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 */
diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h
index 948615d..3e380fe 100644
--- a/arch/x86/include/asm/u-boot-x86.h
+++ b/arch/x86/include/asm/u-boot-x86.h
@@ -25,13 +25,13 @@
 #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);
diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c
index 15e9afc..8fb1765 100644
--- a/examples/standalone/stubs.c
+++ b/examples/standalone/stubs.c
@@ -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 */
-- 
1.8.1



More information about the U-Boot mailing list