[PATCH v2 07/34] ARM: define stack base consistently
Ahmad Fatoum
a.fatoum at pengutronix.de
Wed May 17 05:55:58 PDT 2023
On 17.05.23 11:03, Sascha Hauer wrote:
> The different arm_mem_* functions have the pattern that they take
> the region above it and substract the size of the current region. follow
> the pattern for getting the stack base as well. While at it move
> arm_mem_stack_top() lower in the file so that we have all functions
> following said pattern below each other.
>
> Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
Reviewed-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
> ---
> arch/arm/include/asm/barebox-arm.h | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
> index 139ecce06d..8d8c102081 100644
> --- a/arch/arm/include/asm/barebox-arm.h
> +++ b/arch/arm/include/asm/barebox-arm.h
> @@ -86,11 +86,9 @@ static inline const void *arm_mem_scratch_get(void)
> return (const void *)arm_mem_scratch(arm_mem_endmem_get());
> }
>
> -#define arm_mem_stack_top(endmem) ((endmem) - SZ_64K)
> -
> static inline unsigned long arm_mem_stack(unsigned long endmem)
> {
> - return arm_mem_stack_top(endmem) - STACK_SIZE;
> + return arm_mem_scratch(endmem) - STACK_SIZE;
> }
>
> static inline unsigned long arm_mem_ttb(unsigned long endmem)
> @@ -122,6 +120,11 @@ static inline unsigned long arm_mem_ramoops(unsigned long endmem)
> return endmem;
> }
>
> +static inline unsigned long arm_mem_stack_top(unsigned long endmem)
> +{
> + return arm_mem_stack(endmem) + STACK_SIZE;
> +}
> +
> static inline unsigned long arm_mem_barebox_image(unsigned long membase,
> unsigned long endmem,
> unsigned long size)
--
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