diff mbox series

[v2,09/10] arm64: Add wfet()/wfit() helpers

Message ID 20220419182755.601427-10-maz@kernel.org (mailing list archive)
State New, archived
Headers show
Series arm64: Add initial support for FEAT_WFxT | expand

Commit Message

Marc Zyngier April 19, 2022, 6:27 p.m. UTC
Just like we have helpers for WFI and WFE, add the WFxT versions.
Note that the encoding is that reported by objdump, as no currrent
toolchain knows about these instructions yet.

Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 arch/arm64/include/asm/barrier.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Catalin Marinas April 20, 2022, 5:28 p.m. UTC | #1
On Tue, Apr 19, 2022 at 07:27:54PM +0100, Marc Zyngier wrote:
> Just like we have helpers for WFI and WFE, add the WFxT versions.
> Note that the encoding is that reported by objdump, as no currrent
> toolchain knows about these instructions yet.
> 
> Signed-off-by: Marc Zyngier <maz@kernel.org>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
diff mbox series

Patch

diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barrier.h
index 62217be36217..9f3e2c3d2ca0 100644
--- a/arch/arm64/include/asm/barrier.h
+++ b/arch/arm64/include/asm/barrier.h
@@ -16,7 +16,11 @@ 
 
 #define sev()		asm volatile("sev" : : : "memory")
 #define wfe()		asm volatile("wfe" : : : "memory")
+#define wfet(val)	asm volatile("msr s0_3_c1_c0_0, %0"	\
+				     : : "r" (val) : "memory")
 #define wfi()		asm volatile("wfi" : : : "memory")
+#define wfit(val)	asm volatile("msr s0_3_c1_c0_1, %0"	\
+				     : : "r" (val) : "memory")
 
 #define isb()		asm volatile("isb" : : : "memory")
 #define dmb(opt)	asm volatile("dmb " #opt : : : "memory")