diff options
-rw-r--r-- | include/runtime_services/spm_common.h | 3 | ||||
-rw-r--r-- | spm/cactus/cactus_interrupt.c | 20 |
2 files changed, 22 insertions, 1 deletions
diff --git a/include/runtime_services/spm_common.h b/include/runtime_services/spm_common.h index a32e8fb2c..50159ecb8 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 7926a081a..7de36cf0c 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; } |