[PATCH 2/3] ARM: turn arm_mem_stack_top into a macro

Ahmad Fatoum a.fatoum at pengutronix.de
Thu Dec 2 00:01:10 PST 2021


On 02.12.21 08:42, Ahmad Fatoum wrote:
> This makes it possible to use for static initialization, like done in a
> follow-up commit.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
> ---
>  arch/arm/include/asm/barebox-arm.h | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
> index d70de6d5e6e6..0481d3391c26 100644
> --- a/arch/arm/include/asm/barebox-arm.h
> +++ b/arch/arm/include/asm/barebox-arm.h
> @@ -97,14 +97,13 @@ static inline void arm_fixup_vectors(void)
>  
>  void *barebox_arm_boot_dtb(void);
>  
> -static inline unsigned long arm_mem_stack_top(unsigned long membase,
> -					      unsigned long endmem)
> -{
> -	if (IS_ENABLED(CONFIG_BOOTM_OPTEE) || IS_ENABLED(CONFIG_PBL_OPTEE))
> -		endmem -= OPTEE_SIZE;
> +#define __arm_mem_stack_top(membase, endmem) ((endmem) - SZ_64K)
>  
> -	return endmem - SZ_64K;
> -}
> +#if defined(CONFIG_BOOTM_OPTEE) || defined(CONFIG_PBL_OPTEE)
> +#define arm_mem_stack_top(membase, endmem) (__arm_mem_stack_top(membase, endmem) - OPTEE_SIZE)
> +#else
> +#define arm_mem_stack_top(membase, endmem) (__arm_mem_stack_top(membase, endmem) - OPTEE_SIZE)

Argh. Should have looked more closely before sending out. I'll respin later,
but looking forward to feedback in the mean time.

> +#endif
>  
>  static inline unsigned long arm_mem_stack(unsigned long membase,
>  					  unsigned long endmem)
> 


-- 
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