feat(interrupts): query last serviced interrupt
This patch introduces a helper API to request Cactus SP to return the
ID of the last serviced secure virtual interrupt. It is built on cactus
command framework by leveraging direct message request and response
pair.
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: I316268f4d9b80f29c308d1a1488945a272ffbc93
diff --git a/spm/cactus/cactus_interrupt.c b/spm/cactus/cactus_interrupt.c
index f0d916f..2305b01 100644
--- a/spm/cactus/cactus_interrupt.c
+++ b/spm/cactus/cactus_interrupt.c
@@ -22,11 +22,15 @@
extern ffa_id_t g_ffa_id;
+/* Secure virtual interrupt that was last handled by Cactus SP. */
+uint32_t last_serviced_interrupt[PLATFORM_CORE_COUNT];
+
extern spinlock_t sp_handler_lock[NUM_VINT_ID];
void cactus_interrupt_handler(void)
{
uint32_t intid = spm_interrupt_get();
+ unsigned int core_pos = get_current_core_id();
switch (intid) {
case MANAGED_EXIT_INTERRUPT_ID:
@@ -62,6 +66,8 @@
panic();
}
+ last_serviced_interrupt[core_pos] = intid;
+
/* Invoke the tail end handler registered by the SP. */
spin_lock(&sp_handler_lock[intid]);
if (sp_interrupt_tail_end_handler[intid]) {