SPM: Treat more irq load info as const
Signed-off-by: Chris Brand <chris.brand@cypress.com>
Change-Id: I948030ff0b349e27ca5d61401b66c805fe2f4d9f
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__ */