]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm, arm926ejs: Fix clear bss loop for zero length bss
authorChristian Riesch <christian.riesch@omicron.at>
Wed, 30 Nov 2011 22:27:37 +0000 (22:27 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Tue, 6 Dec 2011 22:59:33 +0000 (23:59 +0100)
This patch fixes the clear bss loop for bss sections that have
zero length, i.e., where __bss_start == __bss_end__.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
arch/arm/cpu/arm926ejs/start.S

index 339c5ed6bdcac328acaffb4c56301ea3c962104f..bb4d00bf3fd5b67d803ea89f150fdeb8213485a5 100644 (file)
@@ -301,10 +301,12 @@ clear_bss:
 #endif
        mov     r2, #0x00000000         /* clear                            */
 
-clbss_l:str    r2, [r0]                /* clear loop...                    */
+clbss_l:cmp    r0, r1                  /* clear loop... */
+       bhs     clbss_e                 /* if reached end of bss, exit */
+       str     r2, [r0]
        add     r0, r0, #4
-       cmp     r0, r1
-       bne     clbss_l
+       b       clbss_l
+clbss_e:
 
 #ifndef CONFIG_SPL_BUILD
        bl coloured_LED_init