From 39f632e7f091056663c1e6bfd29a92d8bc13e50b Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Mon, 7 Dec 2020 13:15:42 -0500 Subject: [PATCH] kernel: fix usage of KERNEL_COHERENCE macro Add missing CONFIG_ to KERNEL_COHERENCE usage in code. Fixes #30380 Signed-off-by: Anas Nashif --- include/spinlock.h | 2 +- kernel/init.c | 2 +- kernel/sched.c | 4 ++-- kernel/thread.c | 2 +- kernel/timeout.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/spinlock.h b/include/spinlock.h index 8fc7ff940aa..e6568c40edf 100644 --- a/include/spinlock.h +++ b/include/spinlock.h @@ -127,7 +127,7 @@ static ALWAYS_INLINE k_spinlock_key_t k_spin_lock(struct k_spinlock *l) #ifdef CONFIG_SPIN_VALIDATE __ASSERT(z_spin_lock_valid(l), "Recursive spinlock %p", l); -# ifdef KERNEL_COHERENCE +# ifdef CONFIG_KERNEL_COHERENCE __ASSERT_NO_MSG(z_spin_lock_mem_coherent(l)); # endif #endif diff --git a/kernel/init.c b/kernel/init.c index a695273c870..5e971bcc1c3 100644 --- a/kernel/init.c +++ b/kernel/init.c @@ -165,7 +165,7 @@ static void bg_thread_main(void *unused1, void *unused2, void *unused3) z_init_static_threads(); -#ifdef KERNEL_COHERENCE +#ifdef CONFIG_KERNEL_COHERENCE __ASSERT_NO_MSG(arch_mem_coherent(&_kernel)); #endif diff --git a/kernel/sched.c b/kernel/sched.c index 769e4824ebb..10456419755 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -413,7 +413,7 @@ static void update_cache(int preempt_ok) static void ready_thread(struct k_thread *thread) { -#ifdef KERNEL_COHERENCE +#ifdef CONFIG_KERNEL_COHERENCE __ASSERT_NO_MSG(arch_mem_coherent(thread)); #endif @@ -673,7 +673,7 @@ static void add_thread_timeout(struct k_thread *thread, k_timeout_t timeout) static void pend(struct k_thread *thread, _wait_q_t *wait_q, k_timeout_t timeout) { -#ifdef KERNEL_COHERENCE +#ifdef CONFIG_KERNEL_COHERENCE __ASSERT_NO_MSG(arch_mem_coherent(wait_q)); #endif diff --git a/kernel/thread.c b/kernel/thread.c index 57000a0716d..e55523452c2 100644 --- a/kernel/thread.c +++ b/kernel/thread.c @@ -567,7 +567,7 @@ char *z_setup_new_thread(struct k_thread *new_thread, z_init_thread_base(&new_thread->base, prio, _THREAD_PRESTART, options); stack_ptr = setup_thread_stack(new_thread, stack, stack_size); -#ifdef KERNEL_COHERENCE +#ifdef CONFIG_KERNEL_COHERENCE /* Check that the thread object is safe, but that the stack is * still cached! */ diff --git a/kernel/timeout.c b/kernel/timeout.c index 6590e7c578d..48154e4aece 100644 --- a/kernel/timeout.c +++ b/kernel/timeout.c @@ -91,7 +91,7 @@ void z_add_timeout(struct _timeout *to, _timeout_func_t fn, return; } -#ifdef KERNEL_COHERENCE +#ifdef CONFIG_KERNEL_COHERENCE __ASSERT_NO_MSG(arch_mem_coherent(to)); #endif