Skip to contentSkip to conversation

arm, arm926ejs: Fix clear bss loop for zero length bss

PATCH New Christian Riesch 2 participants 2 messages Dec 1, 2011 – Dec 5, 2011 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 arm, arm926ejs: Fix clear bss loop for zero length bss

This patch fixes the clear bss loop for bss sections that have zero length, i.e., where __bss_start == __bss_end__.

---

Hi,
this is v6 of a patch out of my recent patchset

[PATCH v3 00/15] Add an SPL to boot the da850evm from SPI
http://lists.denx.de/pipermail/u-boot/2011-November/111182.html

Changes for v6:
- replace beq clbss_e to allow for cases where r1-r0 is not a multiple of 4, as suggested by Albert Aribaud.

Changes for v5:
- correct subject line

Changes for v4:
- split the patchset since it is getting quite big

Regards, Christian

 arch/arm/cpu/arm926ejs/start.S |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
arch/arm/cpu/arm926ejs/start.S +5 -3
index 8b5355b..6a09c02 100644
@@ -299,10 +299,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
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH v6 1/1 arm, arm926ejs: Fix clear bss loop for zero length bss

Hi Christian,

Le 01/12/2011 09:27, Christian Riesch a ?crit :

Quoted 39 lines

This patch fixes the clear bss loop for bss sections that have zero length, i.e., where __bss_start == __bss_end__.

---

Hi,
this is v6 of a patch out of my recent patchset

[PATCH v3 00/15] Add an SPL to boot the da850evm from SPI
http://lists.denx.de/pipermail/u-boot/2011-November/111182.html

Changes for v6:
- replace beq clbss_e to allow for cases where r1-r0 is not a multiple of 4, as suggested by Albert Aribaud.

Changes for v5:
- correct subject line

Changes for v4:
- split the patchset since it is getting quite big

Regards, Christian

  arch/arm/cpu/arm926ejs/start.S |    8 +++++---
  1 files changed, 5 insertions(+), 3 deletions(-)
arch/arm/cpu/arm926ejs/start.S +1 -1
index 8b5355b..6a09c02 100644
@@ -299,10 +299,12 @@ clear_bss:
  #endif
  	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop... */

arch/arm/cpu/arm926ejs/start.S clear_bss: · line 310

Quoted 10 lines
arch/arm/cpu/arm926ejs/start.S +4 -2
+	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

Applied to u-boot-arm/master, thanks!

Amicalement,

Signature · 1 line
Albert.