[U-Boot] [RFC PATCH 16/19] x86: Change stub example to use asm-generic/sections.h

Simon Glass sjg at chromium.org
Wed Dec 28 07:35:57 CET 2011


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>
---
 examples/standalone/stubs.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c
index a6add6a..83454e3 100644
--- a/examples/standalone/stubs.c
+++ b/examples/standalone/stubs.c
@@ -203,16 +203,15 @@ void __attribute__((unused)) dummy(void)
 #include <_exports.h>
 }
 
-extern unsigned long __bss_start, _end;
+#include <asm-generic/sections.h>
 
 void app_startup(char * const *argv)
 {
-	unsigned char * cp = (unsigned char *) &__bss_start;
+	unsigned 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.7.3.1



More information about the U-Boot mailing list