]> git.sur5r.net Git - u-boot/blobdiff - examples/stubs.c
Add startup code to clear the BSS of standalone applications
[u-boot] / examples / stubs.c
index a26337a926b169ff3780772ec69b8a9d11fe993a..a897d0d213d95d5d2692ce8e26805d704ef3e65a 100644 (file)
@@ -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];