Cactus: implement hvc call to enable an interrupt
INTERRUPT_ENABLE hvc call can be used by SP to let SPMC(S-EL2) know
about its capability to handle a particular interrupt.
All interrupt specific hvc calls have "interrupt_type" as an argument
to distinguish between IRQ/FIQ. This patch also introduces enum for
interrupt types and modifies spm_interrupt_get() accordingly.
Change-Id: I65e42645330be0787449be850579e1a9fa35127b
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/spm/common/spm_helpers.c b/spm/common/spm_helpers.c
index 823f9f6..2ccf3f7 100644
--- a/spm/common/spm_helpers.c
+++ b/spm/common/spm_helpers.c
@@ -30,3 +30,22 @@
(void)tftf_hvc(&args);
}
+
+/**
+ * Hypervisor call to enable/disable SP delivery of a virtual interrupt of
+ * int_id value through the IRQ or FIQ vector (pin).
+ * Returns 0 on success, or -1 if passing an invalid interrupt id.
+ */
+int64_t spm_interrupt_enable(uint32_t int_id, bool enable, enum interrupt_pin pin)
+{
+ hvc_args args = {
+ .fid = SPM_INTERRUPT_ENABLE,
+ .arg1 = int_id,
+ .arg2 = enable,
+ .arg3 = pin
+ };
+
+ hvc_ret_values ret = tftf_hvc(&args);
+
+ return (int64_t)ret.ret0;
+}