kernel: stack_sentinel: disable in single-threaded builds

Add a dependency on MULTITHREADING for the
STACK_SENTINEL feature, so it may not get
enabled in single-thread Zephyr builds.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
Ioannis Glaropoulos 2021-05-28 14:17:37 +02:00 committed by Kumar Gala
commit dd574f6ec7
2 changed files with 3 additions and 2 deletions

View file

@ -328,6 +328,7 @@ static inline int z_vrfy_k_thread_name_copy(k_tid_t thread,
#endif /* CONFIG_USERSPACE */
#ifdef CONFIG_MULTITHREADING
#ifdef CONFIG_STACK_SENTINEL
/* Check that the stack sentinel is still present
*
@ -359,9 +360,8 @@ void z_check_stack_sentinel(void)
z_except_reason(K_ERR_STACK_CHK_FAIL);
}
}
#endif
#endif /* CONFIG_STACK_SENTINEL */
#ifdef CONFIG_MULTITHREADING
void z_impl_k_thread_start(struct k_thread *thread)
{
SYS_PORT_TRACING_OBJ_FUNC(k_thread, start, thread);

View file

@ -139,6 +139,7 @@ config STACK_USAGE
config STACK_SENTINEL
bool "Enable stack sentinel"
select THREAD_STACK_INFO
depends on MULTITHREADING
depends on !USERSPACE
help
Store a magic value at the lowest addresses of a thread's stack.