diff --git a/kernel/thread.c b/kernel/thread.c index b692d6c76d9..5236c0ca5c2 100644 --- a/kernel/thread.c +++ b/kernel/thread.c @@ -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); diff --git a/subsys/debug/Kconfig b/subsys/debug/Kconfig index cf3431586b2..420a304903a 100644 --- a/subsys/debug/Kconfig +++ b/subsys/debug/Kconfig @@ -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.