summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatolij Gustschin <agustschin@t-online.de>2007-12-05 17:43:20 +0100
committerStefan Roese <sr@denx.de>2007-12-27 19:35:34 +0100
commit42ed33ffe135f618680f9d6e9712eb35a85bcb62 (patch)
tree93e037df475d586efb626cc2ac07a9131171d46b
parent85dc2a7f82d11e17f0ca2a448118aed7f7a4b85d (diff)
downloadtalos-obmc-uboot-42ed33ffe135f618680f9d6e9712eb35a85bcb62.tar.gz
talos-obmc-uboot-42ed33ffe135f618680f9d6e9712eb35a85bcb62.zip
Fix ppc4xx clear_bss() code
ppc4xx clear_bss() fails if BSS segment size is not divisible by 4 without remainder. This patch provides fix for this problem. Signed-off-by: Anatolij Gustschin <agust@denx.de>
-rw-r--r--cpu/ppc4xx/start.S17
1 files changed, 13 insertions, 4 deletions
diff --git a/cpu/ppc4xx/start.S b/cpu/ppc4xx/start.S
index 645ac0b8dd..52601ed700 100644
--- a/cpu/ppc4xx/start.S
+++ b/cpu/ppc4xx/start.S
@@ -1494,16 +1494,25 @@ clear_bss:
lwz r4,GOT(_end)
cmplw 0, r3, r4
- beq 6f
+ beq 7f
li r0, 0
-5:
+
+ andi. r5, r4, 3
+ beq 6f
+ sub r4, r4, r5
+ mtctr r5
+ mr r5, r4
+5: stb r0, 0(r5)
+ addi r5, r5, 1
+ bdnz 5b
+6:
stw r0, 0(r3)
addi r3, r3, 4
cmplw 0, r3, r4
- bne 5b
-6:
+ bne 6b
+7:
mr r3, r9 /* Init Data pointer */
mr r4, r10 /* Destination Address */
bl board_init_r
OpenPOWER on IntegriCloud