[U-Boot] [PATCH] armv7: Fix to mistake clean the memory space

Albert ARIBAUD albert.u.boot at aribaud.net
Fri Jul 6 07:44:32 CEST 2012


Hi Zhong,

On Thu,  5 Jul 2012 22:35:15 +0800, Zhong Hongbo <bocui107 at gmail.com> wrote:
> From: Zhong Hongbo <bocui107 at gmail.com>
> 
> 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: Hongbo Zhong <bocui107 at gmail.com>
> ---
>  arch/arm/cpu/armv7/start.S |    9 ++++++---
>  1 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
> index 22a3ced..2e583ee 100644
> --- a/arch/arm/cpu/armv7/start.S
> +++ b/arch/arm/cpu/armv7/start.S
> @@ -259,10 +259,13 @@ clear_bss:
>  #endif
>  	mov	r2, #0x00000000		/* clear			    */
>  
> -clbss_l:str	r2, [r0]		/* clear loop...		    */
> +clbss_l:
> +	cmp	r1, r0
> +	bls	clbss_end
> +	str	r2, [r0]		/* clear loop...		    */
>  	add	r0, r0, #4
> -	cmp	r0, r1
> -	bne	clbss_l
> +	b	clbss_l
> +clbss_end:
>  
>  /*
>   * We are done. Do not return, instead branch to second part of board

Just checking: that's the same as your 'infinite' patch, right?

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list