Core: Move spm header files to 'spm' folder
- Move 'spm_xxx.h' to 'spm' folder, they should belong to 'spm'.
- Fix and simplify inclusion of header file.
- Fix format and typo error.
Change-Id: I129c6626ddffbbdba0e7edc27e9307f0d6ea9b79
Signed-off-by: Mingyang Sun <mingyang.sun@arm.com>
diff --git a/secure_fw/spm/arch/tfm_arch_v8m_base.c b/secure_fw/spm/arch/tfm_arch_v8m_base.c
index 00c4fca..0c5d834 100644
--- a/secure_fw/spm/arch/tfm_arch_v8m_base.c
+++ b/secure_fw/spm/arch/tfm_arch_v8m_base.c
@@ -10,7 +10,7 @@
#include "secure_utilities.h"
#include "tfm_arch.h"
#include "tfm_secure_api.h"
-#include "tfm/spm_api.h"
+#include "spm_api.h"
#include "tfm/tfm_core_svc.h"
#if !defined(__ARM_ARCH_8M_BASE__)
diff --git a/secure_fw/spm/arch/tfm_arch_v8m_main.c b/secure_fw/spm/arch/tfm_arch_v8m_main.c
index f975a66..be268ec 100644
--- a/secure_fw/spm/arch/tfm_arch_v8m_main.c
+++ b/secure_fw/spm/arch/tfm_arch_v8m_main.c
@@ -13,7 +13,7 @@
#include "tfm_memory_utils.h"
#include "tfm_core_utils.h"
#include "tfm_secure_api.h"
-#include "tfm/spm_api.h"
+#include "spm_api.h"
#include "tfm/tfm_core_svc.h"
#if !defined(__ARM_ARCH_8M_MAIN__) && !defined(__ARM_ARCH_8_1M_MAIN__)
diff --git a/secure_fw/include/tfm/spm_api.h b/secure_fw/spm/include/spm_api.h
similarity index 98%
rename from secure_fw/include/tfm/spm_api.h
rename to secure_fw/spm/include/spm_api.h
index 83b3801..92e1409 100644
--- a/secure_fw/include/tfm/spm_api.h
+++ b/secure_fw/spm/include/spm_api.h
@@ -10,7 +10,7 @@
/* This file contains the apis exported by the SPM to tfm core */
#include "tfm_api.h"
-#include "tfm/spm_partition_defs.h"
+#include "spm_partition_defs.h"
#include "tfm_secure_api.h"
#include <stdbool.h>
#ifdef TFM_PSA_API
@@ -329,13 +329,13 @@
uint32_t caller_partition_idx);
/**
-* \brief Set the caller client ID for a given partition
-*
-* \param[in] partition_idx Partition index
-* \param[in] caller_client_id The ID of the calling client
-*
-* \note This function doesn't check if any of the partition_idxs are valid.
-*/
+ * \brief Set the caller client ID for a given partition
+ *
+ * \param[in] partition_idx Partition index
+ * \param[in] caller_client_id The ID of the calling client
+ *
+ * \note This function doesn't check if any of the partition_idxs are valid.
+ */
void tfm_spm_partition_set_caller_client_id(uint32_t partition_idx,
int32_t caller_client_id);
@@ -908,7 +908,7 @@
void tfm_spm_psa_eoi(uint32_t *args);
/**
- * \brief SVC hander of enabling irq_line of the specified irq_signal.
+ * \brief SVC handler of enabling irq_line of the specified irq_signal.
*
* \param[in] args Include all input arguments: irq_signal.
*
@@ -921,7 +921,7 @@
void tfm_spm_enable_irq(uint32_t *args);
/**
- * \brief SVC hander of disabling irq_line of the specified irq_signal.
+ * \brief SVC handler of disabling irq_line of the specified irq_signal.
*
* \param[in] args Include all input arguments: irq_signal.
*
diff --git a/secure_fw/include/tfm/spm_db.h b/secure_fw/spm/include/spm_db.h
similarity index 100%
rename from secure_fw/include/tfm/spm_db.h
rename to secure_fw/spm/include/spm_db.h
diff --git a/secure_fw/include/tfm/spm_partition_defs.h b/secure_fw/spm/include/spm_partition_defs.h
similarity index 100%
rename from secure_fw/include/tfm/spm_partition_defs.h
rename to secure_fw/spm/include/spm_partition_defs.h
diff --git a/secure_fw/spm/init/tfm_boot_data.c b/secure_fw/spm/init/tfm_boot_data.c
index d8e021c..ee4466e 100644
--- a/secure_fw/spm/init/tfm_boot_data.c
+++ b/secure_fw/spm/init/tfm_boot_data.c
@@ -12,8 +12,8 @@
#include "tfm_internal.h"
#include "tfm_api.h"
#include "tfm_core_utils.h"
-#include "tfm/spm_api.h"
-#include "tfm/spm_partition_defs.h"
+#include "spm_api.h"
+#include "spm_partition_defs.h"
#ifdef TFM_PSA_API
#include "tfm_internal_defines.h"
#include "tfm_utils.h"
@@ -22,7 +22,7 @@
#include "tfm_wait.h"
#include "tfm_message_queue.h"
#include "tfm_spm_hal.h"
-#include "tfm/spm_db.h"
+#include "spm_db.h"
#endif
/*!
diff --git a/secure_fw/spm/init/tfm_core.c b/secure_fw/spm/init/tfm_core.c
index d4df240..729f183 100644
--- a/secure_fw/spm/init/tfm_core.c
+++ b/secure_fw/spm/init/tfm_core.c
@@ -13,7 +13,7 @@
#include "tfm_spm_hal.h"
#include "tfm_version.h"
#include "log/tfm_log.h"
-#include "tfm/spm_api.h"
+#include "spm_api.h"
/*
* Avoids the semihosting issue
diff --git a/secure_fw/spm/model_func/spm_func.c b/secure_fw/spm/model_func/spm_func.c
index 9f040b8..65c63b5 100644
--- a/secure_fw/spm/model_func/spm_func.c
+++ b/secure_fw/spm/model_func/spm_func.c
@@ -18,8 +18,8 @@
#include "tfm_peripherals_def.h"
#include "tfm_secure_api.h"
#include "tfm_spm_hal.h"
-#include "tfm/spm_api.h"
-#include "tfm/spm_db.h"
+#include "spm_api.h"
+#include "spm_db.h"
#include "region_defs.h"
#include "region.h"
#include "tfm/tfm_spm_services_api.h"
diff --git a/secure_fw/spm/model_func/tfm_core_svcalls_func.c b/secure_fw/spm/model_func/tfm_core_svcalls_func.c
index 9af7104..afa5c57 100644
--- a/secure_fw/spm/model_func/tfm_core_svcalls_func.c
+++ b/secure_fw/spm/model_func/tfm_core_svcalls_func.c
@@ -11,8 +11,8 @@
#include "tfm/tfm_core_svc.h"
#include "tfm_secure_api.h"
#include "region_defs.h"
-#include "tfm/spm_api.h"
-#include "tfm/spm_partition_defs.h"
+#include "spm_api.h"
+#include "spm_partition_defs.h"
#include "tfm_api.h"
#include "tfm_internal.h"
#include "tfm_memory_utils.h"
diff --git a/secure_fw/spm/model_func/tfm_spm_db_func.inc b/secure_fw/spm/model_func/tfm_spm_db_func.inc
index 6b5c42e..54f2ddb 100644
--- a/secure_fw/spm/model_func/tfm_spm_db_func.inc
+++ b/secure_fw/spm/model_func/tfm_spm_db_func.inc
@@ -10,7 +10,7 @@
#ifndef __TFM_SPM_DB_FUNC_INC__
#define __TFM_SPM_DB_FUNC_INC__
-#include "tfm/spm_api.h"
+#include "spm_api.h"
#include "psa_manifest/sid.h"
/**************************************************************************/
diff --git a/secure_fw/spm/model_func/tfm_spm_db_func.inc.template b/secure_fw/spm/model_func/tfm_spm_db_func.inc.template
index 55bcce5..8f424b8 100644
--- a/secure_fw/spm/model_func/tfm_spm_db_func.inc.template
+++ b/secure_fw/spm/model_func/tfm_spm_db_func.inc.template
@@ -10,7 +10,7 @@
#ifndef __TFM_SPM_DB_FUNC_INC__
#define __TFM_SPM_DB_FUNC_INC__
-#include "tfm/spm_api.h"
+#include "spm_api.h"
#include "psa_manifest/sid.h"
{# Produce a build error if heap_size is presented in the manifest, because of the dynamic memory allocation is not supported now. #}
diff --git a/secure_fw/spm/model_func/tfm_veneers.c b/secure_fw/spm/model_func/tfm_veneers.c
index a7a11c5..b58fca5 100644
--- a/secure_fw/spm/model_func/tfm_veneers.c
+++ b/secure_fw/spm/model_func/tfm_veneers.c
@@ -8,7 +8,7 @@
/*********** WARNING: This is an auto-generated file. Do not edit! ***********/
#include "tfm_secure_api.h"
-#include "tfm/spm_partition_defs.h"
+#include "spm_partition_defs.h"
#ifdef TFM_PARTITION_PROTECTED_STORAGE
/******** TFM_SP_PS ********/
diff --git a/secure_fw/spm/model_func/tfm_veneers.c.template b/secure_fw/spm/model_func/tfm_veneers.c.template
index f6b482e..b518164 100644
--- a/secure_fw/spm/model_func/tfm_veneers.c.template
+++ b/secure_fw/spm/model_func/tfm_veneers.c.template
@@ -8,7 +8,7 @@
{{utilities.donotedit_warning}}
#include "tfm_secure_api.h"
-#include "tfm/spm_partition_defs.h"
+#include "spm_partition_defs.h"
{% for manifest in manifests %}
{% if manifest.attr.conditional %}
diff --git a/secure_fw/spm/model_ipc/spm_ipc.c b/secure_fw/spm/model_ipc/spm_ipc.c
index ea1a368..21f1bc6 100644
--- a/secure_fw/spm/model_ipc/spm_ipc.c
+++ b/secure_fw/spm/model_ipc/spm_ipc.c
@@ -20,9 +20,9 @@
#include "tfm_api.h"
#include "tfm_secure_api.h"
#include "tfm_memory_utils.h"
-#include "tfm/spm_api.h"
+#include "spm_api.h"
#include "tfm_peripherals_def.h"
-#include "tfm/spm_db.h"
+#include "spm_db.h"
#include "tfm_core_utils.h"
#include "spm_psa_client_call.h"
#include "tfm_rpc.h"
diff --git a/secure_fw/spm/model_ipc/spm_psa_client_call.c b/secure_fw/spm/model_ipc/spm_psa_client_call.c
index 58aae56..bf5171e 100644
--- a/secure_fw/spm/model_ipc/spm_psa_client_call.c
+++ b/secure_fw/spm/model_ipc/spm_psa_client_call.c
@@ -6,7 +6,7 @@
*/
#include "psa/service.h"
-#include "tfm/spm_api.h"
+#include "spm_api.h"
#include "tfm_core_utils.h"
#include "tfm_internal_defines.h"
#include "tfm_memory_utils.h"
diff --git a/secure_fw/spm/model_ipc/tfm_core_svcalls_ipc.c b/secure_fw/spm/model_ipc/tfm_core_svcalls_ipc.c
index 2c07bf4..2db4233 100644
--- a/secure_fw/spm/model_ipc/tfm_core_svcalls_ipc.c
+++ b/secure_fw/spm/model_ipc/tfm_core_svcalls_ipc.c
@@ -7,8 +7,8 @@
#include <string.h>
#include "region.h"
-#include "tfm/spm_api.h"
-#include "tfm/spm_db.h"
+#include "spm_api.h"
+#include "spm_db.h"
#include "tfm_api.h"
#include "tfm_arch.h"
#include "tfm_core_trustzone.h"
diff --git a/secure_fw/spm/model_ipc/tfm_multi_core_mem_check.c b/secure_fw/spm/model_ipc/tfm_multi_core_mem_check.c
index ff97cf5..55e8e57 100644
--- a/secure_fw/spm/model_ipc/tfm_multi_core_mem_check.c
+++ b/secure_fw/spm/model_ipc/tfm_multi_core_mem_check.c
@@ -9,7 +9,7 @@
#include "tfm_spm_hal.h"
#include "region_defs.h"
#include "secure_utilities.h"
-#include "tfm/spm_api.h"
+#include "spm_api.h"
#include "tfm_internal.h"
#include "tfm_multi_core.h"
#include "tfm_secure_api.h"
diff --git a/secure_fw/spm/model_ipc/tfm_rpc.c b/secure_fw/spm/model_ipc/tfm_rpc.c
index 073e4f4..f2778aa 100644
--- a/secure_fw/spm/model_ipc/tfm_rpc.c
+++ b/secure_fw/spm/model_ipc/tfm_rpc.c
@@ -5,7 +5,7 @@
*
*/
-#include "tfm/spm_api.h"
+#include "spm_api.h"
#include "spm_psa_client_call.h"
#include "tfm_rpc.h"
#include "tfm_utils.h"
diff --git a/secure_fw/spm/model_ipc/tfm_spm_db_ipc.inc b/secure_fw/spm/model_ipc/tfm_spm_db_ipc.inc
index 8618458..0102970 100644
--- a/secure_fw/spm/model_ipc/tfm_spm_db_ipc.inc
+++ b/secure_fw/spm/model_ipc/tfm_spm_db_ipc.inc
@@ -10,7 +10,7 @@
#ifndef __TFM_SPM_DB_IPC_INC__
#define __TFM_SPM_DB_IPC_INC__
-#include "tfm/spm_api.h"
+#include "spm_api.h"
#include "psa_manifest/sid.h"
/**************************************************************************/
diff --git a/secure_fw/spm/model_ipc/tfm_spm_db_ipc.inc.template b/secure_fw/spm/model_ipc/tfm_spm_db_ipc.inc.template
index 4fcd0fb..86390df 100644
--- a/secure_fw/spm/model_ipc/tfm_spm_db_ipc.inc.template
+++ b/secure_fw/spm/model_ipc/tfm_spm_db_ipc.inc.template
@@ -10,7 +10,7 @@
#ifndef __TFM_SPM_DB_IPC_INC__
#define __TFM_SPM_DB_IPC_INC__
-#include "tfm/spm_api.h"
+#include "spm_api.h"
#include "psa_manifest/sid.h"
{# Produce a build error if heap_size is presented in the manifest, because of the dynamic memory allocation is not supported now. #}
diff --git a/secure_fw/spm/model_ipc/tfm_thread.c b/secure_fw/spm/model_ipc/tfm_thread.c
index 1d66e25..74af5a9 100644
--- a/secure_fw/spm/model_ipc/tfm_thread.c
+++ b/secure_fw/spm/model_ipc/tfm_thread.c
@@ -10,7 +10,7 @@
#include "tfm_utils.h"
#include "tfm_memory_utils.h"
#include "tfm/tfm_core_svc.h"
-#include "tfm/spm_api.h"
+#include "spm_api.h"
#include "tfm_core_utils.h"
/* Force ZERO in case ZI(bss) clear is missing */
diff --git a/secure_fw/spm/runtime/spm_api.c b/secure_fw/spm/runtime/spm_api.c
index 5ff1dc3..22db2ec 100644
--- a/secure_fw/spm/runtime/spm_api.c
+++ b/secure_fw/spm/runtime/spm_api.c
@@ -7,8 +7,8 @@
/* All the APIs defined in this file are common for library and IPC model. */
-#include "tfm/spm_api.h"
-#include "tfm/spm_db.h"
+#include "spm_api.h"
+#include "spm_db.h"
/* Extern SPM variable */
extern struct spm_partition_db_t g_spm_partition_db;
diff --git a/secure_fw/spm/runtime/tfm_core_mem_check.c b/secure_fw/spm/runtime/tfm_core_mem_check.c
index 17ab074..d0983cb 100644
--- a/secure_fw/spm/runtime/tfm_core_mem_check.c
+++ b/secure_fw/spm/runtime/tfm_core_mem_check.c
@@ -7,7 +7,7 @@
#include <arm_cmse.h>
#include "region_defs.h"
-#include "tfm/spm_api.h"
+#include "spm_api.h"
#include "tfm_api.h"
/**
diff --git a/secure_fw/spm/runtime/tfm_spm_services.c b/secure_fw/spm/runtime/tfm_spm_services.c
index fc3f038..25c6514 100644
--- a/secure_fw/spm/runtime/tfm_spm_services.c
+++ b/secure_fw/spm/runtime/tfm_spm_services.c
@@ -11,7 +11,7 @@
#include "tfm_secure_api.h"
#include "tfm_internal.h"
#include "tfm/tfm_spm_services_api.h"
-#include "tfm/spm_api.h"
+#include "spm_api.h"
#include "psa/service.h"
#ifndef TFM_PSA_API