Cactus: add handler from managed exit FIQ interrupt

Change-Id: I6d4a8c39287dc5102e5fca7af1a4c92bb2d8fbc7
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/spm/cactus/cactus_interrupt.c b/spm/cactus/cactus_interrupt.c
index 7926a08..7de36cf 100644
--- a/spm/cactus/cactus_interrupt.c
+++ b/spm/cactus/cactus_interrupt.c
@@ -10,6 +10,20 @@
 #include <sp_helpers.h>
 #include <spm_helpers.h>
 
+#include "cactus_test_cmds.h"
+#include "spm_common.h"
+
+extern ffa_vm_id_t g_ffa_id;
+
+static void managed_exit_handler(void)
+{
+	/*
+	 * Real SP will save its context here.
+	 * Send interrupt ID for acknowledgement
+	 */
+	cactus_response(g_ffa_id, HYP_ID, MANAGED_EXIT_INTERRUPT_ID);
+}
+
 int cactus_irq_handler(void)
 {
 	uint32_t irq_num;
@@ -27,7 +41,11 @@
 
 	fiq_num = spm_interrupt_get();
 
-	ERROR("%s: Interrupt ID %u not handled!\n", __func__, fiq_num);
+	if (fiq_num == MANAGED_EXIT_INTERRUPT_ID) {
+		managed_exit_handler();
+	} else {
+		ERROR("%s: Interrupt ID %u not handled!\n", __func__, fiq_num);
+	}
 
 	return 0;
 }