From: Simon Glass Date: Wed, 14 Mar 2012 19:16:08 -0700 Subject: [U-Boot] [PATCH v4 11/27] x86: Change stub example to use asm-generic/sections.h In-Reply-To: <1331777784-8528-1-git-send-email-sjg@chromium.org> References: <1331777784-8528-1-git-send-email-sjg@chromium.org> Message-ID: <1331777784-8528-12-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de We can use the declarations of __bss_start and _end from this header instead of declaring them locally. Signed-off-by: Simon Glass --- Changes in v4: - Use asm/sections.h instead of asm-generic/sections.h 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 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 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.7.7.3