summaryrefslogtreecommitdiffstats
path: root/include/plat/arm/common/arm_reclaim_init.ld.S
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:13:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:13:47 +0000
commit102b0d2daa97dae68d3eed54d8fe37a9cc38a892 (patch)
treebcf648efac40ca6139842707f0eba5a4496a6dd2 /include/plat/arm/common/arm_reclaim_init.ld.S
parentInitial commit. (diff)
downloadarm-trusted-firmware-102b0d2daa97dae68d3eed54d8fe37a9cc38a892.tar.xz
arm-trusted-firmware-102b0d2daa97dae68d3eed54d8fe37a9cc38a892.zip
Adding upstream version 2.8.0+dfsg.upstream/2.8.0+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/plat/arm/common/arm_reclaim_init.ld.S')
-rw-r--r--include/plat/arm/common/arm_reclaim_init.ld.S43
1 files changed, 43 insertions, 0 deletions
diff --git a/include/plat/arm/common/arm_reclaim_init.ld.S b/include/plat/arm/common/arm_reclaim_init.ld.S
new file mode 100644
index 0000000..788e9ff
--- /dev/null
+++ b/include/plat/arm/common/arm_reclaim_init.ld.S
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2017-2022, ARM Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+#ifndef ARM_RECLAIM_INIT_LD_S
+#define ARM_RECLAIM_INIT_LD_S
+
+SECTIONS
+{
+ .init __STACKS_START__ : {
+ . = . + PLATFORM_STACK_SIZE;
+ . = ALIGN(PAGE_SIZE);
+ __INIT_CODE_START__ = .;
+ *(*text.init.*);
+ __INIT_CODE_END__ = .;
+ INIT_CODE_END_ALIGNED = ALIGN(PAGE_SIZE);
+ } >RAM
+
+#ifdef BL31_PROGBITS_LIMIT
+ ASSERT(__INIT_CODE_END__ <= BL31_PROGBITS_LIMIT,
+ "BL31 init has exceeded progbits limit.")
+#endif
+}
+
+#define ABS ABSOLUTE
+
+#define STACK_SECTION \
+ stacks (NOLOAD) : { \
+ __STACKS_START__ = .; \
+ *(tzfw_normal_stacks) \
+ __STACKS_END__ = .; \
+ /* Allow room for the init section where necessary. */ \
+ OFFSET = ABS(SIZEOF(.init) - (. - __STACKS_START__)); \
+ /* Offset sign */ \
+ SIGN = ABS(OFFSET) & (1 << 63); \
+ /* Offset mask */ \
+ MASK = ABS(SIGN >> 63) - 1; \
+ . += ABS(OFFSET) & ABS(MASK); \
+ . = ALIGN(PAGE_SIZE); \
+ }
+
+#endif /* ARM_RECLAIM_INIT_LD_S */