From 00a8818da25985d487c5ba04269ee42e0bbdfde4 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Tue, 2 Apr 2019 18:05:55 -0700 Subject: [PATCH] arc: fix Z_ARCH_THREAD_STACK_MEMBER() Unlike the others, this macro was not taking into account minimum MPU region sizes by filtering through STACK_SIZE_ALIGN(). Fixes: #15130 Signed-off-by: Andrew Boie --- include/arch/arc/arch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arch/arc/arch.h b/include/arch/arc/arch.h index 2e2166f514e..654dfdec817 100644 --- a/include/arch/arc/arch.h +++ b/include/arch/arc/arch.h @@ -105,7 +105,7 @@ extern "C" { #define Z_ARCH_THREAD_STACK_MEMBER(sym, size) \ struct _k_thread_stack_element \ __aligned(POW2_CEIL(STACK_SIZE_ALIGN(size))) \ - sym[POW2_CEIL(size) + \ + sym[POW2_CEIL(STACK_SIZE_ALIGN(size)) + \ + STACK_GUARD_SIZE + CONFIG_PRIVILEGED_STACK_SIZE] #elif CONFIG_ARC_MPU_VER == 3