[U-Boot] [PATCH] s3c44b0/start.S: should clear .bss

Ender Dai ender.dai at gmail.com
Mon May 10 08:26:11 CEST 2010


.bss section should be zeroed out after relocat to ram.

Signed-off-by: Ender Dai <ender.dai at gmail.com>
---
 arch/arm/cpu/s3c44b0/start.S |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/s3c44b0/start.S b/arch/arm/cpu/s3c44b0/start.S
index fe6b349..08722c1 100644
--- a/arch/arm/cpu/s3c44b0/start.S
+++ b/arch/arm/cpu/s3c44b0/start.S
@@ -164,6 +164,15 @@ stack_setup:
 #endif
 	sub	sp, r0, #12		/* leave 3 words for abort-stack    */
 
+clear_bss:	
+	ldr	r0, _bss_start		/* find start of bss segment        */
+	ldr	r1, _bss_end		/* stop here                        */
+	mov	r2, #0x00000000		/* clear                            */
+clbss_l:str	r2, [r0]		/* clear loop...                    */
+	add	r0, r0, #4
+	cmp	r0, r1
+	blt	clbss_l
+
 	ldr	pc, _start_armboot
 
 _start_armboot:	.word start_armboot
-- 
1.5.6



More information about the U-Boot mailing list