diff --git a/arch/Kconfig b/arch/Kconfig index 6f141893dcf..ae4603412af 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -88,6 +88,13 @@ config PRIVILEGED_STACK_SIZE this region will be inaccessible from user mode. During system calls, this region will be utilized by the system call. +config STACK_GROWS_UP + bool "Stack grows towards higher memory addresses" + default n + help + Select this option if the architecture has upward growing thread + stacks. This is not common. + config MAX_THREAD_BYTES int "Bytes to use when tracking object thread permissions" default 2 diff --git a/include/misc/stack.h b/include/misc/stack.h index 6a74553567b..8b40c8ce173 100644 --- a/include/misc/stack.h +++ b/include/misc/stack.h @@ -33,7 +33,7 @@ static inline size_t stack_unused_space_get(const char *stack, size_t size) * (or configurable direction) is added this check should be confirmed * that correct Kconfig option is used. */ -#if defined(STACK_GROWS_UP) +#if defined(CONFIG_STACK_GROWS_UP) for (i = size - 1; i >= 0; i--) { if ((unsigned char)stack[i] == 0xaa) { unused++;