feat(WFxT): add a test for WFxT instructions
This patch adds the test to verify the WFET and WFIT instructions
introduced by FEAT_WFxT.
WFET and WFIT instructions assist in generating local-timeout event
and thereby act as wakeup event for the PE, when the virtual count
in CNTVCT_EL0 (counter-timer virtual count) register equals or exceed
the timeout value passed with these instructions.
Accordingly, this testcase verifies whether the time lapsed matches the
value supplied with WFET and WFIT instructions.
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: I9aea5da869db8520e305e49989cb71f166a582eb
diff --git a/include/lib/aarch64/arch_helpers.h b/include/lib/aarch64/arch_helpers.h
index b6d924b..b366cdd 100644
--- a/include/lib/aarch64/arch_helpers.h
+++ b/include/lib/aarch64/arch_helpers.h
@@ -75,6 +75,13 @@
__asm__ (#_op " " #_type); \
}
+/* Define function for system instruction with register with variable parameter */
+#define DEFINE_SYSOP_PARAM_FUNC(_op) \
+static inline void _op(uint64_t v) \
+{ \
+ __asm__ (#_op " " "%0" : : "r" (v)); \
+}
+
/* Define function for system instruction with register parameter */
#define DEFINE_SYSOP_TYPE_PARAM_FUNC(_op, _type) \
static inline void _op ## _type(uint64_t v) \
@@ -199,6 +206,7 @@
DEFINE_SYSOP_FUNC(wfi)
DEFINE_SYSOP_FUNC(wfe)
DEFINE_SYSOP_FUNC(sev)
+DEFINE_SYSOP_FUNC(sevl)
DEFINE_SYSOP_TYPE_FUNC(dsb, sy)
DEFINE_SYSOP_TYPE_FUNC(dmb, sy)
DEFINE_SYSOP_TYPE_FUNC(dmb, st)
@@ -217,6 +225,9 @@
DEFINE_SYSOP_TYPE_FUNC(dmb, ish)
DEFINE_SYSOP_FUNC(isb)
+DEFINE_SYSOP_PARAM_FUNC(wfit)
+DEFINE_SYSOP_PARAM_FUNC(wfet)
+
static inline void enable_irq(void)
{
/*
@@ -557,6 +568,9 @@
/* Control floating point behaviour */
DEFINE_RENAME_SYSREG_RW_FUNCS(fpcr, FPCR)
+/* ID_AA64ISAR2_EL1 */
+DEFINE_RENAME_SYSREG_READ_FUNC(id_aa64isar2_el1, ID_AA64ISAR2_EL1)
+
#define IS_IN_EL(x) \
(GET_EL(read_CurrentEl()) == MODE_EL##x)