Core: Initial implementation of sec IRQ handling
This commit makes possible for partitions to define IRQ handlers that
are executed in case of an interrupt is triggered, with the isolation
required by TFM_LVL settings.
Detailed changes:
- Add template files to generate code for configuring IRQs, and set
up IRQ handlers based on information provided in the partition's
manifest
- Add capability to Core to isolate the IRQ handlers
- Add documentation
Change-Id: I0e46b9a41fb4e20ca4c398acf5ce1d4027e8597f
Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
diff --git a/platform/include/tfm_spm_hal.h b/platform/include/tfm_spm_hal.h
index 3458b17..cb54186 100644
--- a/platform/include/tfm_spm_hal.h
+++ b/platform/include/tfm_spm_hal.h
@@ -28,6 +28,11 @@
*/
struct tfm_spm_partition_platform_data_t;
+enum irq_target_state_t {
+ TFM_IRQ_TARGET_STATE_SECURE,
+ TFM_IRQ_TARGET_STATE_NON_SECURE,
+};
+
#if defined (TFM_PSA_API) || (TFM_LVL != 1)
/**
* \brief Holds SPM db fields that define the memory regions used by a
@@ -160,6 +165,42 @@
*/
void tfm_spm_hal_set_secure_irq_priority(int32_t irq_line, uint32_t priority);
+/**
+ * \brief Clears a pending IRQ
+ *
+ * \param[in] irq_line The IRQ to clear pending for.
+ */
+void tfm_spm_hal_clear_pending_irq(int32_t irq_line);
+
+/**
+ * \brief Enables an IRQ
+ *
+ * \param[in] irq_line The IRQ to be enabled.
+ */
+void tfm_spm_hal_enable_irq(int32_t irq_line);
+
+/**
+ * \brief Disables an IRQ
+ *
+ * \param[in] irq_line The IRQ to be disabled
+ */
+void tfm_spm_hal_disable_irq(int32_t irq_line);
+
+/**
+ * \brief Set the target state of an IRQ
+ *
+ * \param[in] irq_line The IRQ to set the priority for.
+ * \param[in] target_state Target state to ret for the IRQ.
+ *
+ * \return TFM_IRQ_TARGET_STATE_SECURE if interrupt is assigned
+ * to Secure
+ * TFM_IRQ_TARGET_STATE_NON_SECURE if interrupt is
+ * assigned to Non-Secure
+ */
+enum irq_target_state_t tfm_spm_hal_set_irq_target_state(
+ int32_t irq_line,
+ enum irq_target_state_t target_state);
+
#if (TFM_LVL != 1) && !defined(TFM_PSA_API)
/**
* \brief Configure the sandbox for a partition.