[PATCH 5/9] ARM64: <asm/barebox-arm-head.h>: mark prologue location

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Nov 8 00:14:29 PST 2021


Hello Sascha,

On 08.11.21 08:52, Ahmad Fatoum wrote:
> Unlike with ARM32, barebox prologue on ARM64 starts with the function
> prologue, because of the absence of the naked attribute. The code is
> written with that in mind (6 branches instead of 8 to account for the
> two instructions inserted by the compiler), but it's still suprising.
> 
> Add a hint about that in the code.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
> ---
>  arch/arm/include/asm/barebox-arm-head.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/include/asm/barebox-arm-head.h b/arch/arm/include/asm/barebox-arm-head.h
> index 8409a77d2e7c..187d12c9fc8d 100644
> --- a/arch/arm/include/asm/barebox-arm-head.h
> +++ b/arch/arm/include/asm/barebox-arm-head.h
> @@ -44,6 +44,8 @@ static inline void __barebox_arm_head(void)
>  		"1: b 1b\n"
>  #endif
>  #else
> +		/* two instruction long function prologue */
> +		/* only use if stack is initialized! */

On the rk3399, the sp points into INTMEM0. When I added a new user to
load_elf64_image_phdr, the function become out-of-line and thus return
from that function broke. Does the rk3568 MaskROM initialize the stack
pointer differently? I want to avoid breaking it when I send out the
remaining rk3399 patches.

>  		"b 2f\n"
>  		"nop\n"
>  		"nop\n"
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list