summaryrefslogtreecommitdiff
path: root/examples/stubs.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2004-04-12 16:12:49 +0000
committerwdenk <wdenk>2004-04-12 16:12:49 +0000
commitd716b126718d874f52ffb694e6c22b7235cec483 (patch)
tree621a24955203ad5c221a3049fee60048e74b556e /examples/stubs.c
parent56b86bf0cd6ce45d337154c133ab361120ee5569 (diff)
downloadu-boot-imx-d716b126718d874f52ffb694e6c22b7235cec483.zip
u-boot-imx-d716b126718d874f52ffb694e6c22b7235cec483.tar.gz
u-boot-imx-d716b126718d874f52ffb694e6c22b7235cec483.tar.bz2
Add startup code to clear the BSS of standalone applications
Diffstat (limited to 'examples/stubs.c')
-rw-r--r--examples/stubs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/stubs.c b/examples/stubs.c
index a26337a..a897d0d 100644
--- a/examples/stubs.c
+++ b/examples/stubs.c
@@ -110,8 +110,17 @@ static void __attribute__((unused)) dummy(void)
#include <_exports.h>
}
+extern unsigned long __bss_start, _end;
+
void app_startup(char **argv)
{
+ unsigned long * cp = &__bss_start;
+
+ /* Zero out BSS */
+ while (cp < &_end) {
+ *cp++ = 0;
+ }
+
#if defined(CONFIG_I386)
/* x86 does not have a dedicated register for passing global_data */
global_data = (gd_t *)argv[-1];