aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlexei Fedorov <Alexei.Fedorov@arm.com>2020-10-29 18:00:13 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2020-10-29 18:00:13 +0000
commit8109d2dd69e2e08c36a094776d37151a65bf37fb (patch)
tree8923be0e02560f252a1c98ffb5d218fe0b7767aa /include
parent271708e06462a13eb163efc61ed1fe82a002192c (diff)
parent3ed5606bd1156e61241b57cb2dcceb90f75f6332 (diff)
downloadplatform_external_arm-trusted-firmware-8109d2dd69e2e08c36a094776d37151a65bf37fb.tar.gz
platform_external_arm-trusted-firmware-8109d2dd69e2e08c36a094776d37151a65bf37fb.tar.bz2
platform_external_arm-trusted-firmware-8109d2dd69e2e08c36a094776d37151a65bf37fb.zip
Merge "Use constant stack size with RECLAIM_INIT_CODE" into integration
Diffstat (limited to 'include')
-rw-r--r--include/plat/arm/common/arm_reclaim_init.ld.S54
1 files changed, 15 insertions, 39 deletions
diff --git a/include/plat/arm/common/arm_reclaim_init.ld.S b/include/plat/arm/common/arm_reclaim_init.ld.S
index e4d4f1254..717f65e2b 100644
--- a/include/plat/arm/common/arm_reclaim_init.ld.S
+++ b/include/plat/arm/common/arm_reclaim_init.ld.S
@@ -14,54 +14,30 @@ SECTIONS
__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
-
- ASSERT(__INIT_CODE_END__ <= __STACKS_END__,
- "Init code ends past the end of the stacks")
-
}
-#undef MIN
#define ABS ABSOLUTE
-#define COUNT PLATFORM_CORE_COUNT
-#define ALIGN_MASK ~(CACHE_WRITEBACK_GRANULE - 1)
-
-#define PRIMARY_STACK \
- __STACKS_START__ = .; \
- *(tzfw_normal_stacks) \
- 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); \
- __STACKS_END__ = .; \
- /* Total stack size */ \
- SIZE = ABS(. - __STACKS_START__); \
- /* Maximum primary CPU stack */ \
- STACK = ABS(__STACKS_START__ + SIZE / COUNT) & ALIGN_MASK; \
- /* Primary CPU stack */ \
- __PRIMARY_STACK__ = MIN(STACK, ABS(__INIT_CODE_START__));
-#if (COUNT > 1)
-#define SECONDARY_STACK \
- /* Size of the secondary CPUs' stack */ \
- REST = ABS(__STACKS_END__ - __PRIMARY_STACK__); \
- /* Secondary per-CPU stack size */ \
- __STACK_SIZE__ = ABS(REST / (COUNT - 1));
-#else
-#define SECONDARY_STACK
-#endif
-
-#define STACK_SECTION \
- stacks (NOLOAD) : { \
- PRIMARY_STACK \
- SECONDARY_STACK \
+#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 */