mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <>
Cc: Ahmad Fatoum <>
Subject: [PATCH v2 2/3] ARM: turn arm_mem_stack_top into a macro
Date: Fri, 14 Jan 2022 09:42:26 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

This makes it possible to use for static initialization, like done in a
follow-up commit.

Signed-off-by: Ahmad Fatoum <>
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)
-		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)
+#define arm_mem_stack_top(membase, endmem)  __arm_mem_stack_top(membase, endmem)
 static inline unsigned long arm_mem_stack(unsigned long membase,
 					  unsigned long endmem)

barebox mailing list

  reply	other threads:[~2022-01-14  8:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14  8:42 [PATCH v2 1/3] ARM: implement ENTRY_FUNCTION_WITHSTACK Ahmad Fatoum
2022-01-14  8:42 ` Ahmad Fatoum [this message]
2022-01-14  8:42 ` [PATCH v2 3/3] ARM: rpi: use ENTRY_FUNCTION_WITHSTACK to prepare for ARM64 support Ahmad Fatoum
2022-01-14  9:29 ` [PATCH v2 1/3] ARM: implement ENTRY_FUNCTION_WITHSTACK Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox