diff --git a/include/zephyr/arch/x86/thread_stack.h b/include/zephyr/arch/x86/thread_stack.h index f22bf4d6853..fb5572055da 100644 --- a/include/zephyr/arch/x86/thread_stack.h +++ b/include/zephyr/arch/x86/thread_stack.h @@ -107,7 +107,6 @@ struct z_x86_thread_stack_header { #define ARCH_KERNEL_STACK_RESERVED CONFIG_MMU_PAGE_SIZE #define ARCH_KERNEL_STACK_OBJ_ALIGN CONFIG_MMU_PAGE_SIZE #else -#define ARCH_KERNEL_STACK_RESERVED 0 #define ARCH_KERNEL_STACK_OBJ_ALIGN ARCH_STACK_PTR_ALIGN #endif diff --git a/include/zephyr/arch/xtensa/thread_stack.h b/include/zephyr/arch/xtensa/thread_stack.h index 816eaf3b97c..6155f0dfe0e 100644 --- a/include/zephyr/arch/xtensa/thread_stack.h +++ b/include/zephyr/arch/xtensa/thread_stack.h @@ -68,7 +68,6 @@ struct xtensa_thread_stack_header { ROUND_UP((size), XTENSA_STACK_SIZE_ALIGN) /* kernel stack */ -#define ARCH_KERNEL_STACK_RESERVED 0 #define ARCH_KERNEL_STACK_OBJ_ALIGN ARCH_STACK_PTR_ALIGN #endif /* _ASMLANGUAGE */ diff --git a/kernel/thread.c b/kernel/thread.c index 184343a70de..f77d70ce494 100644 --- a/kernel/thread.c +++ b/kernel/thread.c @@ -400,6 +400,7 @@ static char *setup_thread_stack(struct k_thread *new_thread, stack_buf_start = K_KERNEL_STACK_BUFFER(stack); stack_buf_size = stack_obj_size - K_KERNEL_STACK_RESERVED; +#if defined(ARCH_KERNEL_STACK_RESERVED) /* Zephyr treats stack overflow as an app bug. But * this particular overflow can be seen by static * analysis so needs to be handled somehow. @@ -407,7 +408,7 @@ static char *setup_thread_stack(struct k_thread *new_thread, if (K_KERNEL_STACK_RESERVED > stack_obj_size) { k_panic(); } - +#endif } #ifdef CONFIG_THREAD_STACK_MEM_MAPPED