HAL: Duplicates three legacy tfm_spm_hal_* APIs for IPC Model
This patch duplicates the following APIs for IPC Model in platform HAL
and renames them:
- tfm_spm_hal_get_ns_VTOR -> tfm_hal_get_ns_VTOR
- tfm_spm_hal_get_ns_entry_point -> tfm_hal_get_ns_entry_point
- tfm_spm_hal_get_ns_MSP -> tfm_hal_get_ns_MSP
This original ones are kept for Library Model for now for easier
potential deprecation of Library Model in the future.
Change-Id: Ic8196a4335514c9fa828892b6a4c90dc6ed9fd79
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/secure_fw/spm/cmsis_psa/tfm_multi_core.c b/secure_fw/spm/cmsis_psa/tfm_multi_core.c
index f830a6f..2eba63e 100644
--- a/secure_fw/spm/cmsis_psa/tfm_multi_core.c
+++ b/secure_fw/spm/cmsis_psa/tfm_multi_core.c
@@ -7,7 +7,7 @@
#include "tfm_arch.h"
#include "tfm_assert.h"
#include "tfm_hal_multi_core.h"
-#include "tfm_spm_hal.h"
+#include "tfm_hal_platform.h"
#include "tfm_spm_log.h"
#include "tfm_multi_core.h"
@@ -25,7 +25,7 @@
SPMLOG_DBGMSG("Enabling non-secure core...");
#endif
- tfm_hal_boot_ns_cpu(tfm_spm_hal_get_ns_VTOR());
+ tfm_hal_boot_ns_cpu(tfm_hal_get_ns_VTOR());
tfm_hal_wait_for_ns_cpu_ready();
tfm_inter_core_comm_init();
diff --git a/secure_fw/spm/cmsis_psa/tfm_nspm_ipc.c b/secure_fw/spm/cmsis_psa/tfm_nspm_ipc.c
index 6d6f325..0d91a57 100755
--- a/secure_fw/spm/cmsis_psa/tfm_nspm_ipc.c
+++ b/secure_fw/spm/cmsis_psa/tfm_nspm_ipc.c
@@ -5,16 +5,17 @@
*
*/
+#include "cmsis.h"
#include "compiler_ext_defs.h"
-#include "tfm_spm_hal.h"
+#include "tfm_hal_platform.h"
void configure_ns_code(void)
{
/* SCB_NS.VTOR points to the Non-secure vector table base address */
- SCB_NS->VTOR = tfm_spm_hal_get_ns_VTOR();
+ SCB_NS->VTOR = tfm_hal_get_ns_VTOR();
/* Setups Main stack pointer of the non-secure code */
- uint32_t ns_msp = tfm_spm_hal_get_ns_MSP();
+ uint32_t ns_msp = tfm_hal_get_ns_MSP();
__TZ_set_MSP_NS(ns_msp);
}
diff --git a/secure_fw/spm/ffm/backend_ipc.c b/secure_fw/spm/ffm/backend_ipc.c
index a6c8031..4570f95 100644
--- a/secure_fw/spm/ffm/backend_ipc.c
+++ b/secure_fw/spm/ffm/backend_ipc.c
@@ -10,8 +10,8 @@
#include "compiler_ext_defs.h"
#include "spm_ipc.h"
#include "tfm_hal_isolation.h"
+#include "tfm_hal_platform.h"
#include "tfm_rpc.h"
-#include "tfm_spm_hal.h" /* To be checked */
#include "ffm/backend.h"
#include "utilities.h"
#include "load/partition_defs.h"
@@ -116,7 +116,7 @@
TO_THREAD_PRIORITY(PARTITION_PRIORITY(p_pldi->flags)));
if (p_pldi->pid == TFM_SP_NON_SECURE_ID) {
- p_param = (void *)tfm_spm_hal_get_ns_entry_point();
+ p_param = (void *)tfm_hal_get_ns_entry_point();
#ifdef CONFIG_TFM_PSA_API_THREAD_CALL
SPM_THREAD_CONTEXT = &p_pt->ctx_ctrl;
diff --git a/secure_fw/spm/ffm/backend_sfn.c b/secure_fw/spm/ffm/backend_sfn.c
index 14736e9..6cf39d5 100644
--- a/secure_fw/spm/ffm/backend_sfn.c
+++ b/secure_fw/spm/ffm/backend_sfn.c
@@ -8,7 +8,7 @@
#include <stdint.h>
#include "compiler_ext_defs.h"
#include "current.h"
-#include "tfm_spm_hal.h"
+#include "tfm_hal_platform.h"
#include "ffm/backend.h"
#include "load/partition_defs.h"
#include "load/service_defs.h"
@@ -104,7 +104,7 @@
thrd_start(&p_pt->thrd,
POSITION_TO_ENTRY(p_pldi->entry, thrd_fn_t),
- (void *)tfm_spm_hal_get_ns_entry_point(),
+ (void *)tfm_hal_get_ns_entry_point(),
LOAD_ALLOCED_STACK_ADDR(p_pldi),
LOAD_ALLOCED_STACK_ADDR(p_pldi) + p_pldi->stack_size);