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

login
register
mail settings
Submitter Ender Dai
Date May 10, 2010, 6:26 a.m.
Message ID <1273472771-15859-1-git-send-email-ender.dai@gmail.com>
Download mbox | patch
Permalink /patch/71783/
State Not Applicable
Delegated to: Minkyu Kang
Headers show

Comments

Ender Dai - May 10, 2010, 6:26 a.m.
.bss section should be zeroed out after relocat to ram.

Signed-off-by: Ender Dai <ender.dai@gmail.com>
---
 arch/arm/cpu/s3c44b0/start.S |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
Minkyu Kang - Dec. 22, 2010, 5:51 a.m.
Dear Ender Dai,

On 10 May 2010 15:26, Ender Dai <ender.dai@gmail.com> wrote:
> .bss section should be zeroed out after relocat to ram.
>
> Signed-off-by: Ender Dai <ender.dai@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

Now, clear_bss function is applied by other patch.
Sorry to late review.
Thanks.

Minkyu Kang

Patch

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