refactor(SMCCC): use a macro to check for the SMCCC version
This is similar to other macros that skip the test if a condition is failed.
Change-Id: If8ff8b29473151edf1872636bce9ee0950851c42
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
diff --git a/include/common/test_helpers.h b/include/common/test_helpers.h
index 6f97bb3..fc557ae 100644
--- a/include/common/test_helpers.h
+++ b/include/common/test_helpers.h
@@ -88,6 +88,20 @@
} \
} while (0)
+#define SKIP_TEST_IF_SMCCC_VERSION_LT(major, minor) \
+ do { \
+ smc_args args = {0}; \
+ smc_ret_values ret; \
+ args.fid = SMCCC_VERSION; \
+ ret = tftf_smc(&args); \
+ if ((int32_t)ret.ret0 < MAKE_SMCCC_VERSION(major, minor)) { \
+ tftf_testcase_printf( \
+ "Unexpected SMCCC version: 0x%x\n", \
+ (int)ret.ret0); \
+ return TEST_RESULT_SKIPPED; \
+ } \
+ } while (0)
+
#define SKIP_TEST_IF_DIT_NOT_SUPPORTED() \
do { \
if (!is_armv8_4_dit_present()) { \