refactor(spm): managed exit tests
Factored out code to enable managed exit interrupt for a given SP, to
reuse it in the context of testing the Schedule Receiver Interrupt
SWd behavior, in the context of notifications feature work.
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: Idcecd486c7a952f0842ebf90c274adcea9e30152
diff --git a/tftf/tests/common/test_helpers.c b/tftf/tests/common/test_helpers.c
index 80497bd..73d59bd 100644
--- a/tftf/tests/common/test_helpers.c
+++ b/tftf/tests/common/test_helpers.c
@@ -5,6 +5,7 @@
*/
#include <arch_helpers.h>
+#include <cactus_test_cmds.h>
#include <plat_topology.h>
#include <platform.h>
#include <power_management.h>
@@ -219,3 +220,19 @@
return TEST_RESULT_SUCCESS;
}
+
+bool spm_set_managed_exit_int(ffa_id_t sp_id, bool enable)
+{
+ smc_ret_values ret;
+
+ ret = cactus_interrupt_cmd(HYP_ID, sp_id, MANAGED_EXIT_INTERRUPT_ID,
+ enable, INTERRUPT_TYPE_FIQ);
+
+ if (!is_ffa_direct_response(ret) ||
+ cactus_get_response(ret) != CACTUS_SUCCESS) {
+ ERROR("Failed to enable Managed exit interrupt\n");
+ return false;
+ }
+
+ return true;
+}