feat(interrupts): add support for handling managed exit through vIRQ

An SP could specify, through its partition manifest, that the
preferred signaling mechanism for it to handle managed exit is
vIRQ instead of the default choice (vFIQ).

Hence, separate the vIRQ and vFIQ handlers and add support for
identifying the source of the direct message request for the current
endpoint to send the managed exit response.

Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: I06d6d81232de58779f81f40d4c6d2a96df0da27a
diff --git a/spm/cactus/cactus_tests/cactus_message_loop.c b/spm/cactus/cactus_tests/cactus_message_loop.c
index 01ea32f..e56e51e 100644
--- a/spm/cactus/cactus_tests/cactus_message_loop.c
+++ b/spm/cactus/cactus_tests/cactus_message_loop.c
@@ -31,6 +31,9 @@
 		smc_ret.arg3, smc_ret.arg4, smc_ret.arg5, 		\
 		smc_ret.arg6, smc_ret.arg7)
 
+/* Global FFA_MSG_DIRECT_REQ source ID */
+ffa_id_t g_dir_req_source_id;
+
 /**
  * Traverses command table from section ".cactus_handler", searches for a
  * registered command and invokes the respective handler.
@@ -49,6 +52,12 @@
 		return false;
 	}
 
+	/* Get the source of the Direct Request message. */
+	if (ffa_func_id(*cmd_args) == FFA_MSG_SEND_DIRECT_REQ_SMC32 ||
+	    ffa_func_id(*cmd_args) == FFA_MSG_SEND_DIRECT_REQ_SMC64) {
+		g_dir_req_source_id = ffa_dir_msg_source(*cmd_args);
+	}
+
 	PRINT_CMD((*cmd_args));
 
 	in_cmd = cactus_get_cmd(*cmd_args);