spinlock: Move spinlock_init to public macros

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao 2022-11-28 16:59:25 +08:00 committed by GUIDINGLI
parent 984208f6a2
commit 555c4fede3

View File

@ -128,25 +128,6 @@ static inline spinlock_t up_testset(volatile FAR spinlock_t *lock)
}
#endif
/****************************************************************************
* Name: spin_initialize
*
* Description:
* Initialize a non-reentrant spinlock object to its initial,
* unlocked state.
*
* Input Parameters:
* lock - A reference to the spinlock object to be initialized.
* state - Initial state of the spinlock {SP_LOCKED or SP_UNLOCKED)
*
* Returned Value:
* None.
*
****************************************************************************/
/* void spin_initialize(FAR spinlock_t *lock, spinlock_t state); */
#define spin_initialize(l,s) do { *(l) = (s); } while (0)
/****************************************************************************
* Name: spin_lock
*
@ -351,6 +332,26 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned int cpu,
#endif /* CONFIG_SPINLOCK */
/****************************************************************************
* Name: spin_initialize
*
* Description:
* Initialize a non-reentrant spinlock object to its initial,
* unlocked state.
*
* Input Parameters:
* lock - A reference to the spinlock object to be initialized.
* state - Initial state of the spinlock {SP_LOCKED or SP_UNLOCKED)
*
* Returned Value:
* None.
*
****************************************************************************/
/* void spin_initialize(FAR spinlock_t *lock, spinlock_t state); */
#define spin_initialize(l,s) do { *(l) = (s); } while (0)
/****************************************************************************
* Name: spin_lock_irqsave
*