mirror of
https://github.com/apache/nuttx.git
synced 2026-08-15 09:23:20 +00:00
spinlock: Move spinlock_init to public macros
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
parent
984208f6a2
commit
555c4fede3
1 changed files with 20 additions and 19 deletions
|
|
@ -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
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue