]> git.sur5r.net Git - u-boot/commitdiff
arm: Fix to mistake clean the memory space
authorZhong Hongbo <bocui107@gmail.com>
Sat, 7 Jul 2012 03:24:33 +0000 (03:24 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Fri, 20 Jul 2012 12:24:08 +0000 (14:24 +0200)
In currently, when __bss_start is equal to __bss_end__,
The bss loop will clear all the things in memory space.

But just only when __bss_end__ greater than __bss_start__,
we do the clear bss section operation.

Signed-off-by: Zhong Hongbo <bocui107@gmail.com>
Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
13 files changed:
arch/arm/cpu/arm1136/start.S
arch/arm/cpu/arm1176/start.S
arch/arm/cpu/arm720t/start.S
arch/arm/cpu/arm920t/start.S
arch/arm/cpu/arm925t/start.S
arch/arm/cpu/arm946es/start.S
arch/arm/cpu/arm_intcm/start.S
arch/arm/cpu/armv7/start.S
arch/arm/cpu/ixp/start.S
arch/arm/cpu/lh7a40x/start.S
arch/arm/cpu/pxa/start.S
arch/arm/cpu/s3c44b0/start.S
arch/arm/cpu/sa1100/start.S

index c0db96cb15455e172f58821ebb7bb2ba64ebca31..2483c63efb2d7d9c1dab75b4790c00b7fdf691e2 100644 (file)
@@ -251,10 +251,12 @@ clear_bss:
        add     r1, r1, r4
        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:
 #endif /* #ifndef CONFIG_SPL_BUILD */
 
 /*
index 848144a851716073eae077cdd4818154a6f4896c..d61364109ee99d971c4e3014d7214e924ec608b8 100644 (file)
@@ -351,11 +351,12 @@ clear_bss:
        add     r1, r1, r4
        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_NAND_SPL
        bl coloured_LED_init
        bl red_led_on
index 540e3c2f722dac06f1b8f07b2ac09369c635b6cd..3b97e804a6b641275d00f62538ee3ec5aaf5d949 100644 (file)
@@ -228,10 +228,12 @@ clear_bss:
        add     r1, r1, r4
        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:
 
        bl coloured_LED_init
        bl red_led_on
index 8c5612c31e13e7e2d20ac07f7bee7bbc40a13210..9b8604e907eed5b43f5a79a4b6a833afb41bcf87 100644 (file)
@@ -271,10 +271,12 @@ clear_bss:
        add     r1, r1, r4
        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:
 
        bl coloured_LED_init
        bl red_led_on
index dbb93ef09ffd649292292b54430014847886a57b..1a544168669a2a8c1acffbcb7f8cebb42a3a55a7 100644 (file)
@@ -265,10 +265,12 @@ clear_bss:
        add     r1, r1, r4
        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:
 
        bl coloured_LED_init
        bl red_led_on
index 89ba5587e1380fa90ba94782da9ce390dd7e58da..b4d1d2dd1c6f8e701ad51e97e0310109362f8295 100644 (file)
@@ -236,10 +236,12 @@ clear_bss:
        add     r1, r1, r4
        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
-       blo     clbss_l
+       b       clbss_l
+clbss_e:
 #endif
 
 /*
index 2033b362f7b1033090361cfa56704f7936d6fb67..b85e7d442741a77eabf477ab406a0b5032ec0ffe 100644 (file)
@@ -232,10 +232,12 @@ clear_bss:
        add     r1, r1, r4
        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:
 
        bl coloured_LED_init
        bl red_led_on
index 22a3cedcb0d8cca133557e2df4b4007e6a854a91..aee27fdc4d33bac268b27961a28bd5504e1b908f 100644 (file)
@@ -259,10 +259,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:
 
 /*
  * We are done. Do not return, instead branch to second part of board
index cb32121a07120ee0ba0760e11730b25ce354550c..59c359a353fe483bcfc92fa896eca343455e7009 100644 (file)
@@ -334,10 +334,12 @@ clear_bss:
        add     r1, r1, r4
        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:
 
        bl coloured_LED_init
        bl red_led_on
index 62de8b8fc70d8354fd6c294c61545f2db7d1dcb7..bd68cd47cf0131ee1b01f94e0970b320396eef9b 100644 (file)
@@ -245,10 +245,12 @@ clear_bss:
        add     r1, r1, r4
        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:
 #endif
 
 /*
index ba0de8f1db7926fd0651d72e33cffc1503240c94..33c73f67b57fbf6b9f5683f1dafb2134fd2a244f 100644 (file)
@@ -258,10 +258,12 @@ clear_bss:
        add     r1, r1, r4
        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:
 #endif /* #ifndef CONFIG_SPL_BUILD */
 
 /*
index a29d5b49644067e64a588e3b25b912e1de8c1996..8daf26c4f033ddad242ee63876ca9f3bff7cbfb1 100644 (file)
@@ -217,10 +217,12 @@ clear_bss:
        add     r1, r1, r4
        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:
 
        bl coloured_LED_init
        bl red_led_on
index 92546d8ba751ffae79c334e862ecb3ff0b0b29f6..bcea2a8debca38a31f06baecb75c333beee14a19 100644 (file)
@@ -221,10 +221,12 @@ clear_bss:
        add     r1, r1, r4
        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:
 #endif
 
 /*