SPM: Treat more irq load info as const

Signed-off-by: Chris Brand <chris.brand@cypress.com>
Change-Id: I948030ff0b349e27ca5d61401b66c805fe2f4d9f
diff --git a/docs/integration_guide/tfm_secure_irq_integration_guide.rst b/docs/integration_guide/tfm_secure_irq_integration_guide.rst
index dd84a98..8dbf530 100644
--- a/docs/integration_guide/tfm_secure_irq_integration_guide.rst
+++ b/docs/integration_guide/tfm_secure_irq_integration_guide.rst
@@ -288,7 +288,7 @@
 But if you use the ``NVIC_SetPriority`` function provided by CMSIS to set
 priorities, you can pass the values directly.
 
-Platforms have the fexibilities on the assignment of priorities.
+Platforms have the flexibilities on the assignment of priorities.
 
 Targeting Interrupts to Secure
 ------------------------------
@@ -316,8 +316,8 @@
 .. code-block:: c
 
   struct irq_t {
-      void                   *p_pt;
-      struct irq_load_info_t *p_ildi;
+      void                         *p_pt;
+      const struct irq_load_info_t *p_ildi;
   };
 
 Integrating the Interrupt Handling Function
@@ -327,7 +327,7 @@
 
 .. code-block:: c
 
-  void spm_handle_interrupt(void *p_pt, struct irq_load_info_t *p_ildi)
+  void spm_handle_interrupt(void *p_pt, const struct irq_load_info_t *p_ildi)
 
 The ``p_pt`` and ``p_ildi`` are the information passed to interrupt
 initialization functions and saved by platforms.
@@ -403,3 +403,5 @@
 --------------
 
 *Copyright (c) 2021-2022, Arm Limited. All rights reserved.*
+*Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon company)
+or an affiliate of Cypress Semiconductor Corporation. All rights reserved.*
diff --git a/secure_fw/spm/ffm/interrupt.c b/secure_fw/spm/ffm/interrupt.c
index 463676a..b52add8 100644
--- a/secure_fw/spm/ffm/interrupt.c
+++ b/secure_fw/spm/ffm/interrupt.c
@@ -112,12 +112,12 @@
 }
 #endif
 
-struct irq_load_info_t *get_irq_info_for_signal(
+const struct irq_load_info_t *get_irq_info_for_signal(
                                     const struct partition_load_info_t *p_ldinf,
                                     psa_signal_t signal)
 {
     size_t i;
-    struct irq_load_info_t *irq_info;
+    const struct irq_load_info_t *irq_info;
 
     if (!IS_ONLY_ONE_BIT_IN_UINT32(signal)) {
         return NULL;
@@ -133,7 +133,7 @@
     return NULL;
 }
 
-void spm_handle_interrupt(void *p_pt, struct irq_load_info_t *p_ildi)
+void spm_handle_interrupt(void *p_pt, const struct irq_load_info_t *p_ildi)
 {
     psa_flih_result_t flih_result;
     struct partition_t *p_part;
diff --git a/secure_fw/spm/ffm/interrupt.h b/secure_fw/spm/ffm/interrupt.h
index ae90acf..ef3b434 100644
--- a/secure_fw/spm/ffm/interrupt.h
+++ b/secure_fw/spm/ffm/interrupt.h
@@ -1,5 +1,8 @@
 /*
  * Copyright (c) 2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon
+ * company) or an affiliate of Cypress Semiconductor Corporation. All rights
+ * reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -24,7 +27,7 @@
  *                                partition.
  * \retval Any other value      The load info pointer associated with the signal
  */
-struct irq_load_info_t *get_irq_info_for_signal(
+const struct irq_load_info_t *get_irq_info_for_signal(
                                     const struct partition_load_info_t *p_ldinf,
                                     psa_signal_t signal);
 
@@ -39,7 +42,7 @@
  *  The input parameters are maintained by platforms and they must be init-ed
  *  in the interrupt init functions.
  */
-void spm_handle_interrupt(void *p_pt, struct irq_load_info_t *p_ildi);
+void spm_handle_interrupt(void *p_pt, const struct irq_load_info_t *p_ildi);
 
 /*
  * Prepare execution context for deprivileged FLIH functions
diff --git a/secure_fw/spm/ffm/psa_api.c b/secure_fw/spm/ffm/psa_api.c
index c0c4aac..6b60e53 100644
--- a/secure_fw/spm/ffm/psa_api.c
+++ b/secure_fw/spm/ffm/psa_api.c
@@ -1,5 +1,8 @@
 /*
  * Copyright (c) 2019-2022, Arm Limited. All rights reserved.
+ * Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon
+ * company) or an affiliate of Cypress Semiconductor Corporation. All rights
+ * reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -932,7 +935,7 @@
 void tfm_spm_partition_psa_irq_enable(psa_signal_t irq_signal)
 {
     struct partition_t *partition;
-    struct irq_load_info_t *irq_info;
+    const struct irq_load_info_t *irq_info;
 
     partition = GET_CURRENT_COMPONENT();
 
@@ -947,7 +950,7 @@
 psa_irq_status_t tfm_spm_partition_psa_irq_disable(psa_signal_t irq_signal)
 {
     struct partition_t *partition;
-    struct irq_load_info_t *irq_info;
+    const struct irq_load_info_t *irq_info;
 
     partition = GET_CURRENT_COMPONENT();
 
@@ -966,7 +969,7 @@
 void tfm_spm_partition_psa_reset_signal(psa_signal_t irq_signal)
 {
     struct critical_section_t cs_assert = CRITICAL_SECTION_STATIC_INIT;
-    struct irq_load_info_t *irq_info;
+    const struct irq_load_info_t *irq_info;
     struct partition_t *partition;
 
     partition = GET_CURRENT_COMPONENT();
@@ -997,7 +1000,7 @@
 void tfm_spm_partition_psa_eoi(psa_signal_t irq_signal)
 {
     struct critical_section_t cs_assert = CRITICAL_SECTION_STATIC_INIT;
-    struct irq_load_info_t *irq_info = NULL;
+    const struct irq_load_info_t *irq_info = NULL;
     struct partition_t *partition = NULL;
 
     partition = GET_CURRENT_COMPONENT();
diff --git a/secure_fw/spm/include/load/interrupt_defs.h b/secure_fw/spm/include/load/interrupt_defs.h
index 0c7d24c..31500e4 100644
--- a/secure_fw/spm/include/load/interrupt_defs.h
+++ b/secure_fw/spm/include/load/interrupt_defs.h
@@ -1,5 +1,8 @@
 /*
  * Copyright (c) 2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon
+ * company) or an affiliate of Cypress Semiconductor Corporation. All rights
+ * reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -27,8 +30,8 @@
 
 /* IRQ runtime data */
 struct irq_t {
-    void                   *p_pt;   /* The owner Partition struct partition_t */
-    struct irq_load_info_t *p_ildi; /* The interrupt load info                */
+    void                         *p_pt;       /* The owner Partition     */
+    const struct irq_load_info_t *p_ildi;     /* The interrupt load info */
 };
 
 #endif /* __INTERRUPT_DEFS_H__ */