diff --git a/include/spinlock.h b/include/spinlock.h index 15ff47677b5..33875d1f378 100644 --- a/include/spinlock.h +++ b/include/spinlock.h @@ -59,7 +59,7 @@ struct k_spinlock { /* Stores the thread that holds the lock with the locking CPU * ID in the bottom two bits. */ - size_t thread_cpu; + uintptr_t thread_cpu; #endif }; diff --git a/kernel/thread.c b/kernel/thread.c index 51bb663879d..9a0ac2e60d6 100644 --- a/kernel/thread.c +++ b/kernel/thread.c @@ -727,7 +727,7 @@ bool z_spin_lock_valid(struct k_spinlock *l) bool z_spin_unlock_valid(struct k_spinlock *l) { - if (l->thread_cpu != (_current_cpu->id | (u32_t)_current)) { + if (l->thread_cpu != (_current_cpu->id | (uintptr_t)_current)) { return false; } l->thread_cpu = 0; @@ -736,7 +736,7 @@ bool z_spin_unlock_valid(struct k_spinlock *l) void z_spin_lock_set_owner(struct k_spinlock *l) { - l->thread_cpu = _current_cpu->id | (u32_t)_current; + l->thread_cpu = _current_cpu->id | (uintptr_t)_current; } #endif