diff options
author | Jens Wiklander <jens.wiklander@linaro.org> | 2014-12-17 17:06:38 +0100 |
---|---|---|
committer | Jens Wiklander <jens.wiklander@linaro.org> | 2014-12-18 10:05:46 +0100 |
commit | 6f5b4652a19bbf28092896f190bb6b1c7659c1c5 (patch) | |
tree | fda87b2e147b1d6c22711313acc9fae7a98fa0cd /core/arch/arm32 | |
parent | 6f9449b89e55a4772f400ef4dad2e0220d6a7940 (diff) |
plat-stm: make stacks cache line aligned
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (STM platform)
Diffstat (limited to 'core/arch/arm32')
-rw-r--r-- | core/arch/arm32/plat-stm/main.c | 8 | ||||
-rw-r--r-- | core/arch/arm32/plat-stm/platform_config.h | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/core/arch/arm32/plat-stm/main.c b/core/arch/arm32/plat-stm/main.c index f01bc27..e2d1bca 100644 --- a/core/arch/arm32/plat-stm/main.c +++ b/core/arch/arm32/plat-stm/main.c @@ -49,6 +49,7 @@ #include <kernel/asc.h> #include <kernel/tee_l2cc_mutex.h> #include <assert.h> +#include <platform_config.h> #ifdef WITH_STACK_CANARIES #define STACK_CANARY_SIZE (4 * sizeof(uint32_t)) @@ -61,11 +62,10 @@ #define STACK_CANARY_SIZE 0 #endif -#define STACK_ALIGNMENT 8 - #define DECLARE_STACK(name, num_stacks, stack_size) \ - static uint32_t name[num_stacks][(stack_size + STACK_CANARY_SIZE) / \ - sizeof(uint32_t)] \ + static uint32_t name[num_stacks][ \ + ROUNDUP(stack_size + STACK_CANARY_SIZE, STACK_ALIGNMENT) / \ + sizeof(uint32_t)] \ __attribute__((section(".nozi.stack"), \ aligned(STACK_ALIGNMENT))) diff --git a/core/arch/arm32/plat-stm/platform_config.h b/core/arch/arm32/plat-stm/platform_config.h index f4fc935..6241c39 100644 --- a/core/arch/arm32/plat-stm/platform_config.h +++ b/core/arch/arm32/plat-stm/platform_config.h @@ -35,6 +35,9 @@ #define PLATFORM_FLAVOR_IS(flav) \ (PLATFORM_FLAVOR == PLATFORM_FLAVOR_ID_ ## flav) +/* Make stacks aligned to data cache line length */ +#define STACK_ALIGNMENT 32 + #ifdef CFG_WITH_PAGER #error "Pager not supported for platform STM" #endif |