diff --git a/include/spinlock.h b/include/spinlock.h index 6c79d356fc0..4f20f744b12 100644 --- a/include/spinlock.h +++ b/include/spinlock.h @@ -8,6 +8,22 @@ #include +/* These stubs aren't provided by the mocking framework, and I can't + * find a proper place to put them as mocking seems not to have a + * proper "arch" layer. + */ +#ifdef ZTEST_UNITTEST +static inline int _arch_irq_lock(void) +{ + return 0; +} + +static inline void _arch_irq_unlock(int key) +{ + ARG_UNUSED(key); +} +#endif + #if defined(CONFIG_ASSERT) && (CONFIG_MP_NUM_CPUS < 4) #include struct k_spinlock; @@ -37,6 +53,7 @@ struct k_spinlock { static ALWAYS_INLINE k_spinlock_key_t k_spin_lock(struct k_spinlock *l) { + ARG_UNUSED(l); k_spinlock_key_t k; /* Note that we need to use the underlying arch-specific lock