SMP: Introduce spin_lock_wo_note() and spin_unlock_wo_note()

These APIs are used in sched_note.c to protect instumentation data.
The deffrence between these APIs to exsiting spin_lock() and spin_unlock()
is that they do not perform insturumentation to avoid recursive call
when SCHED_INSTRUMENTATION_SPINLOCKS=y.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Masayuki Ishikawa
2018-01-17 13:08:03 +09:00
parent e276d4d16d
commit ab3fa89023
3 changed files with 118 additions and 15 deletions
+46
View File
@@ -197,6 +197,30 @@ void spin_initializer(FAR struct spinlock_s *lock);
void spin_lock(FAR volatile spinlock_t *lock);
/****************************************************************************
* Name: spin_lock_wo_note
*
* Description:
* If this CPU does not already hold the spinlock, then loop until the
* spinlock is successfully locked.
*
* This implementation is the same as the above spin_lock() except that
* it does not perform instrumentation logic.
*
* Input Parameters:
* lock - A reference to the spinlock object to lock.
*
* Returned Value:
* None. When the function returns, the spinlock was successfully locked
* by this CPU.
*
* Assumptions:
* Not running at the interrupt level.
*
****************************************************************************/
void spin_lock_wo_note(FAR volatile spinlock_t *lock);
/****************************************************************************
* Name: spin_trylock
*
@@ -268,6 +292,28 @@ void spin_unlock(FAR volatile spinlock_t *lock);
# define spin_unlock(l) do { *(l) = SP_UNLOCKED; } while (0)
#endif
/****************************************************************************
* Name: spin_unlock_wo_note
*
* Description:
* Release one count on a non-reentrant spinlock.
*
* This implementation is the same as the above spin_unlock() except that
* it does not perform instrumentation logic.
*
* Input Parameters:
* lock - A reference to the spinlock object to unlock.
*
* Returned Value:
* None.
*
* Assumptions:
* Not running at the interrupt level.
*
****************************************************************************/
void spin_unlock_wo_note(FAR volatile spinlock_t *lock);
/****************************************************************************
* Name: spin_unlockr
*