This is an automated email from the ASF dual-hosted git repository. ligd pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 555c4fede3c19b862eb9466761c4f9a4f79c8f86 Author: anjiahao <[email protected]> AuthorDate: Mon Nov 28 16:59:25 2022 +0800 spinlock: Move spinlock_init to public macros Signed-off-by: anjiahao <[email protected]> --- include/nuttx/spinlock.h | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/include/nuttx/spinlock.h b/include/nuttx/spinlock.h index 4d77b8611f..d3b858e9f0 100644 --- a/include/nuttx/spinlock.h +++ b/include/nuttx/spinlock.h @@ -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 *
