[PATCH v2 2/3] ARM: turn arm_mem_stack_top into a macro
Ahmad Fatoum
a.fatoum at pengutronix.de
Fri Jan 14 00:42:26 PST 2022
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>
---
v1 -> v2:
- drop OPTEE_SIZE on non OPTEE builds
---
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 5018b3e2f57a..1c8cdfd16e62 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)
+#endif
static inline unsigned long arm_mem_stack(unsigned long membase,
unsigned long endmem)
--
2.30.2
More information about the barebox
mailing list