[U-Boot] [PATCH 1/3] arm64: optimize __asm_{flush, invalidate}_dcache_all

York Sun york.sun at nxp.com
Tue May 17 17:32:24 CEST 2016


On 05/17/2016 12:37 AM, Masahiro Yamada wrote:
> __asm_dcache_all can directly return to the caller of
> __asm_{flush,invalidate}_dcache_all.
> 
> We do not have to waste x16 register here.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
> ---
> 
>  arch/arm/cpu/armv8/cache.S | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv8/cache.S b/arch/arm/cpu/armv8/cache.S
> index a9f4fec..1c71a2f 100644
> --- a/arch/arm/cpu/armv8/cache.S
> +++ b/arch/arm/cpu/armv8/cache.S
> @@ -104,19 +104,13 @@ finished:
>  ENDPROC(__asm_dcache_all)
>  
>  ENTRY(__asm_flush_dcache_all)
> -	mov	x16, lr
>  	mov	x0, #0
> -	bl	__asm_dcache_all
> -	mov	lr, x16
> -	ret
> +	b	__asm_dcache_all
>  ENDPROC(__asm_flush_dcache_all)
>  
>  ENTRY(__asm_invalidate_dcache_all)
> -	mov	x16, lr
>  	mov	x0, #0x1
> -	bl	__asm_dcache_all
> -	mov	lr, x16
> -	ret
> +	b	__asm_dcache_all
>  ENDPROC(__asm_invalidate_dcache_all)
>  
>  /*
> 

It is a smart solution.
Reviewed-by: York Sun <york.sun at nxp.com>



More information about the U-Boot mailing list