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:
Masayuki Ishikawa
2020-12-07 21:04:16 +09:00
committed by Xiang Xiao
parent 21cb7935c5
commit 6158b6b77b
4 changed files with 24 additions and 0 deletions
+5
View File
@@ -95,6 +95,11 @@
#define SP_DSB(n) __asm__ __volatile__ ("dsb sy" : : : "memory")
#define SP_DMB(n) __asm__ __volatile__ ("dmb st" : : : "memory")
#ifdef CONFIG_ARM_HAVE_WFE_SEV
#define SP_WFE() __asm__ __volatile__ ("wfe" : : : "memory")
#define SP_SEV() __asm__ __volatile__ ("sev" : : : "memory")
#endif
/****************************************************************************
* Public Types
****************************************************************************/