feat: add spm_deactivate_interrupt helper function
This ABI is needed by SP to perform End-Of-Interrupt sequence i.e.,
priority drop and de-activation on its behalf by SPM.
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: I6c5403b4591589f29da7b77f69f422b9eb386efd
diff --git a/spm/common/spm_helpers.c b/spm/common/spm_helpers.c
index 2ccf3f7..82fdae5 100644
--- a/spm/common/spm_helpers.c
+++ b/spm/common/spm_helpers.c
@@ -49,3 +49,20 @@
return (int64_t)ret.ret0;
}
+
+/**
+ * Hypervisor call to drop the priority and de-activate a secure interrupt.
+ * Returns 0 on success, or -1 if passing an invalid interrupt id.
+ */
+int64_t spm_interrupt_deactivate(uint32_t vint_id)
+{
+ hvc_args args = {
+ .fid = SPM_INTERRUPT_DEACTIVATE,
+ .arg1 = vint_id, /* pint_id */
+ .arg2 = vint_id
+ };
+
+ hvc_ret_values ret = tftf_hvc(&args);
+
+ return (int64_t)ret.ret0;
+}