mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
spinlock: Introduce SP_WFE() and SP_SEV()
Summary: - This commit introduces SP_WFE() and SP_SEV() to be used for spinlock - Also, use wfe/sev instructions for ARMV7-A to reduce power consumption Impact: - ARMV7-a SMP only Testing: - sabre-6quad:smp (QEMU, dev board) - maix-bit:smp, esp32-devkitc:smp, spresense:smp sim:smp (compile only) Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
committed by
Xiang Xiao
parent
21cb7935c5
commit
6158b6b77b
@@ -89,6 +89,7 @@ void spin_lock(FAR volatile spinlock_t *lock)
|
||||
while (up_testset(lock) == SP_LOCKED)
|
||||
{
|
||||
SP_DSB();
|
||||
SP_WFE();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS
|
||||
@@ -126,6 +127,7 @@ void spin_lock_wo_note(FAR volatile spinlock_t *lock)
|
||||
while (up_testset(lock) == SP_LOCKED)
|
||||
{
|
||||
SP_DSB();
|
||||
SP_WFE();
|
||||
}
|
||||
|
||||
SP_DMB();
|
||||
@@ -241,6 +243,7 @@ void spin_unlock(FAR volatile spinlock_t *lock)
|
||||
SP_DMB();
|
||||
*lock = SP_UNLOCKED;
|
||||
SP_DSB();
|
||||
SP_SEV();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -269,6 +272,7 @@ void spin_unlock_wo_note(FAR volatile spinlock_t *lock)
|
||||
SP_DMB();
|
||||
*lock = SP_UNLOCKED;
|
||||
SP_DSB();
|
||||
SP_SEV();
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user