Re: [PATCH v2 07/34] ARM: define stack base consistently

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Reviewed-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>

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





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux