aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManish Pandey <manish.pandey2@arm.com>2021-03-03 11:31:47 +0000
committerOlivier Deprez <olivier.deprez@arm.com>2021-04-13 18:23:31 +0200
commitf7aafefca84b45a4ad607e069fea95fabbdbd3ff (patch)
tree42ae454785211e19b307a8b8df2d214004422f48
parent87d4c70dbf3bed20da5618d78c3a2fef2c28bfcd (diff)
downloadtf-a-tests-f7aafefca84b45a4ad607e069fea95fabbdbd3ff.tar.gz
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>
-rw-r--r--include/runtime_services/spm_common.h3
-rw-r--r--spm/cactus/cactus_interrupt.c20
2 files changed, 22 insertions, 1 deletions
diff --git a/include/runtime_services/spm_common.h b/include/runtime_services/spm_common.h
index a32e8fb2..50159ecb 100644
--- a/include/runtime_services/spm_common.h
+++ b/include/runtime_services/spm_common.h
@@ -17,6 +17,9 @@
/* ID for the first Secure Partition. */
#define SPM_VM_ID_FIRST SP_ID(1)
+/* INTID for the managed exit virtual interrupt. */
+#define MANAGED_EXIT_INTERRUPT_ID U(4)
+
/** IRQ/FIQ pin used for signaling a virtual interrupt. */
enum interrupt_pin {
INTERRUPT_TYPE_IRQ,
diff --git a/spm/cactus/cactus_interrupt.c b/spm/cactus/cactus_interrupt.c
index 7926a081..7de36cf0 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 @@ int cactus_fiq_handler(void)
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;
}