diff --git a/include/spinlock.h b/include/spinlock.h index 5161443eca3..15ff47677b5 100644 --- a/include/spinlock.h +++ b/include/spinlock.h @@ -35,9 +35,10 @@ static inline void z_arch_irq_unlock(int key) #if (CONFIG_FLASH_SIZE == 0) || (CONFIG_FLASH_SIZE > 32) #if defined(CONFIG_ASSERT) && (CONFIG_MP_NUM_CPUS < 4) #include +#include struct k_spinlock; -int z_spin_lock_valid(struct k_spinlock *l); -int z_spin_unlock_valid(struct k_spinlock *l); +bool z_spin_lock_valid(struct k_spinlock *l); +bool z_spin_unlock_valid(struct k_spinlock *l); void z_spin_lock_set_owner(struct k_spinlock *l); #define SPIN_VALIDATE #endif diff --git a/kernel/thread.c b/kernel/thread.c index 9cf7beddeb8..f96dbdc2f19 100644 --- a/kernel/thread.c +++ b/kernel/thread.c @@ -708,23 +708,23 @@ FUNC_NORETURN void k_thread_user_mode_enter(k_thread_entry_t entry, * them in spinlock.h is a giant header ordering headache. */ #ifdef SPIN_VALIDATE -int z_spin_lock_valid(struct k_spinlock *l) +bool z_spin_lock_valid(struct k_spinlock *l) { if (l->thread_cpu) { if ((l->thread_cpu & 3) == _current_cpu->id) { - return 0; + return false; } } - return 1; + return true; } -int z_spin_unlock_valid(struct k_spinlock *l) +bool z_spin_unlock_valid(struct k_spinlock *l) { if (l->thread_cpu != (_current_cpu->id | (u32_t)_current)) { - return 0; + return false; } l->thread_cpu = 0; - return 1; + return true; } void z_spin_lock_set_owner(struct k_spinlock *l)