refactor(rme): add helper macro for RME tests
This change adds SKIP_TEST_IF_RME_NOT_SUPPORTED_OR_RMM_IS_TRP macro that
checks if FEAT_RME is present and RMM is not TRP.
Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I100e713d8f4fce2826e60909580079834585fddb
diff --git a/tftf/tests/misc_tests/test_invalid_access.c b/tftf/tests/misc_tests/test_invalid_access.c
index 9cbd8f2..7325ace 100644
--- a/tftf/tests/misc_tests/test_invalid_access.c
+++ b/tftf/tests/misc_tests/test_invalid_access.c
@@ -230,25 +230,7 @@
test_result_t result = TEST_RESULT_FAIL;
static char rd[GRANULE_SIZE] __aligned(GRANULE_SIZE);
- if (get_armv9_2_feat_rme_support() == 0U) {
- return TEST_RESULT_SKIPPED;
- }
-
- host_rmi_init_cmp_result();
-
- retrmm = host_rmi_version();
-
- VERBOSE("RMM version is: %lu.%lu\n",
- RMI_ABI_VERSION_GET_MAJOR(retrmm),
- RMI_ABI_VERSION_GET_MINOR(retrmm));
-
- /*
- * TODO: Remove this once SMC_RMM_REALM_CREATE is implemented in TRP
- * For the moment skip the test if RMM is TRP, TRP version is always null.
- */
- if (retrmm == 0U) {
- return TEST_RESULT_SKIPPED;
- }
+ SKIP_TEST_IF_RME_NOT_SUPPORTED_OR_RMM_IS_TRP();
retrmm = host_rmi_granule_delegate((u_register_t)&rd[0]);
if (retrmm != 0UL) {