SPM: Make PSA interface redirect-able
The existing PSA interface is based on Supervisor call, it is
feasible to make it based on other ABI type such as direct
function call. Create an ABI type indicator for the existing
PSA Interfaces, redirect the prototypes in PSA headers to a
final definition with the '_svc' suffix.
- Involve 'psa_config.h' and make secure PSA interface redirect-able.
- Define a flag 'CONFIG_TFM_BUILDING_SPE' to indicate which PE build
is ongoing.
- Define 'CONFIG_TFM_PSA_API_SUPERVISOR_CALL' to indicate the current
redirecting ABI for PSA interface.
- Other adjustments to support the changes.
Change-Id: Id58b12df84c0e8fd1d029e8e72c2eb8340a89a52
Signed-off-by: Ken Liu <Ken.Liu@arm.com>
diff --git a/cmake/install.cmake b/cmake/install.cmake
index fb92991..8ddc181 100644
--- a/cmake/install.cmake
+++ b/cmake/install.cmake
@@ -45,7 +45,7 @@
DESTINATION ${INSTALL_INTERFACE_INC_DIR}/ext)
if (TFM_PSA_API)
- install(FILES ${INTERFACE_INC_DIR}/tfm_psa_call_param.h
+ install(FILES ${INTERFACE_INC_DIR}/tfm_psa_call_pack.h
DESTINATION ${INSTALL_INTERFACE_INC_DIR})
endif()
diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt
index 43f8317..82148d3 100644
--- a/interface/CMakeLists.txt
+++ b/interface/CMakeLists.txt
@@ -54,10 +54,8 @@
target_sources(tfm_secure_api
INTERFACE
- $<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/src/psa/psa_client.c>
- $<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/src/psa/psa_service.c>
- $<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/src/psa/psa_lifecycle.c>
- ${CMAKE_CURRENT_SOURCE_DIR}/src/log/tfm_log_raw.c
+ $<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/src/tfm_psa_call_pack.c>
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/log/tfm_log_raw.c
)
###################### Export configurations to NS #############################
diff --git a/interface/include/config_impl.h.template b/interface/include/config_impl.h.template
index e021242..4210055 100644
--- a/interface/include/config_impl.h.template
+++ b/interface/include/config_impl.h.template
@@ -11,9 +11,11 @@
#define __CONFIG_IMPL_H__
{% if ipc_partition_num > 0 and sfn_partition_num == 0 %}
-#define BACKEND_IPC 1
+#define {{"%-56s"|format("CONFIG_TFM_SPM_BACKEND_IPC")}} 1
+#define {{"%-56s"|format("CONFIG_TFM_PSA_API_SUPERVISOR_CALL")}} 1
+
{% elif sfn_partition_num > 0 and ipc_partition_num == 0 %}
-#define BACKEND_SFN 1
+#define CONFIG_TFM_SPM_BACKEND_SFN 1
#if TFM_LVL > 1
#error "High isolation level SFN model is not supported."
@@ -22,7 +24,8 @@
{% elif sfn_partition_num > 0 and ipc_partition_num > 0 %}
#error "IPC and SFN co-work not supported yet."
{% else %}
-#error "Invalid partition number inputted, check configurations."
+#error "Invalid partition number input, check configurations."
{% endif %}
+#include "psa_interface_redirect.h"
#endif /* __CONFIG_IMPL_H__ */
diff --git a/interface/include/psa/client.h b/interface/include/psa/client.h
index 7aee1e5..1d79e49 100644
--- a/interface/include/psa/client.h
+++ b/interface/include/psa/client.h
@@ -11,6 +11,7 @@
#include <stddef.h>
#include <stdint.h>
+#include "psa_config.h"
#include "psa/error.h"
#ifdef __cplusplus
diff --git a/interface/include/psa/lifecycle.h b/interface/include/psa/lifecycle.h
index a892c49..64f22d1 100644
--- a/interface/include/psa/lifecycle.h
+++ b/interface/include/psa/lifecycle.h
@@ -8,6 +8,8 @@
#ifndef __PSA_LIFECYCLE_H__
#define __PSA_LIFECYCLE_H__
+#include "psa_config.h"
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/interface/include/psa/service.h b/interface/include/psa/service.h
index 12efd2e..2c94f4c 100644
--- a/interface/include/psa/service.h
+++ b/interface/include/psa/service.h
@@ -11,8 +11,9 @@
#include <stddef.h>
#include <stdint.h>
-#include "psa/error.h"
#include "psa/client.h"
+#include "psa_config.h"
+#include "psa/error.h"
#ifdef __cplusplus
extern "C" {
diff --git a/interface/include/psa_config.h b/interface/include/psa_config.h
new file mode 100644
index 0000000..d215fba
--- /dev/null
+++ b/interface/include/psa_config.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2021, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#ifndef __PSA_CONFIG_H__
+#define __PSA_CONFIG_H__
+
+/*
+ * This is an implementation-specific file that supporting PSA standard
+ * files. The reason to name with prefix 'psa' is to showcase a straight
+ * reference configuration. Because both NSPE and SPE clients are using
+ * the same API but link with the different declarations, this file can
+ * help to indicate the current building to apply PE-specific or
+ * configuration-specific settings.
+ */
+
+/*
+ * A customized flag indicating SPE build. Systems like CMSIS may use
+ * 'DOMAIN_NS' as the indicator. As NSPE is not guaranteed to be
+ * CMSIS compatible, a customized flag provides availability.
+ */
+#if defined(CONFIG_TFM_BUILDING_SPE)
+
+/* SPE has specific configurations. */
+#include "config_impl.h"
+
+#endif
+
+#endif /* __PSA_CONFIG_H__ */
diff --git a/interface/include/tfm_psa_call_param.h b/interface/include/tfm_psa_call_pack.h
similarity index 65%
rename from interface/include/tfm_psa_call_param.h
rename to interface/include/tfm_psa_call_pack.h
index ed51da7..3b14fbc 100644
--- a/interface/include/tfm_psa_call_param.h
+++ b/interface/include/tfm_psa_call_pack.h
@@ -5,8 +5,11 @@
*
*/
-#ifndef __TFM_PSA_CALL_PARAM_H__
-#define __TFM_PSA_CALL_PARAM_H__
+#ifndef __TFM_PSA_CALL_PACK_H__
+#define __TFM_PSA_CALL_PACK_H__
+
+#include "psa_config.h"
+#include "psa/client.h"
#ifdef __cplusplus
extern "C" {
@@ -24,8 +27,13 @@
((((uint32_t)in_len) << IN_LEN_OFFSET) & IN_LEN_MASK) | \
((((uint32_t)out_len) << OUT_LEN_OFFSET) & OUT_LEN_MASK))
+psa_status_t tfm_psa_call_pack(psa_handle_t handle,
+ uint32_t ctrl_param,
+ const psa_invec *in_vec,
+ psa_outvec *out_vec);
+
#ifdef __cplusplus
}
#endif
-#endif /* __TFM_PSA_CALL_PARAM_H__ */
+#endif /* __TFM_PSA_CALL_PACK_H__ */
diff --git a/interface/src/psa/psa_client.c b/interface/src/psa/psa_client.c
deleted file mode 100644
index 6960ac6..0000000
--- a/interface/src/psa/psa_client.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#include <inttypes.h>
-#include "psa/client.h"
-#include "svc_num.h"
-#include "tfm_api.h"
-#include "tfm_hal_device_header.h"
-#include "tfm_psa_call_param.h"
-
-__attribute__((naked))
-uint32_t psa_framework_version(void)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_FRAMEWORK_VERSION));
-}
-
-__attribute__((naked))
-uint32_t psa_version(uint32_t sid)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_VERSION));
-}
-
-__attribute__((naked))
-psa_handle_t psa_connect(uint32_t sid, uint32_t version)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_CONNECT));
-}
-
-__attribute__((naked))
-static psa_status_t psa_call_param_pack(psa_handle_t handle,
- uint32_t ctrl_param,
- const psa_invec *in_vec,
- psa_outvec *out_vec)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_CALL));
-}
-
-psa_status_t psa_call(psa_handle_t handle,
- int32_t type,
- const psa_invec *in_vec,
- size_t in_len,
- psa_outvec *out_vec,
- size_t out_len)
-{
- if ((type > INT16_MAX) ||
- (type < INT16_MIN) ||
- (in_len > UINT8_MAX) ||
- (out_len > UINT8_MAX)) {
- return PSA_ERROR_PROGRAMMER_ERROR;
- }
-
- return psa_call_param_pack(handle,
- PARAM_PACK(type, in_len, out_len),
- in_vec,
- out_vec);
-}
-
-__attribute__((naked))
-void psa_close(psa_handle_t handle)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_CLOSE));
-}
diff --git a/interface/src/psa/psa_lifecycle.c b/interface/src/psa/psa_lifecycle.c
deleted file mode 100644
index cee7dfd..0000000
--- a/interface/src/psa/psa_lifecycle.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright (c) 2020-2021, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-#include <inttypes.h>
-#include "psa/lifecycle.h"
-#include "svc_num.h"
-#include "tfm_hal_device_header.h"
-
-__attribute__((naked))
-uint32_t psa_rot_lifecycle_state(void)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_LIFECYCLE));
-}
diff --git a/interface/src/psa/psa_service.c b/interface/src/psa/psa_service.c
deleted file mode 100644
index 211c36f..0000000
--- a/interface/src/psa/psa_service.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#include <inttypes.h>
-#include <stdio.h>
-#include "psa/client.h"
-#include "psa/service.h"
-#include "svc_num.h"
-#include "tfm_hal_device_header.h"
-
-__attribute__((naked))
-psa_signal_t psa_wait(psa_signal_t signal_mask, uint32_t timeout)
-
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_WAIT));
-}
-
-__attribute__((naked))
-psa_status_t psa_get(psa_signal_t signal, psa_msg_t *msg)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_GET));
-}
-
-__attribute__((naked))
-void psa_set_rhandle(psa_handle_t msg_handle, void *rhandle)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_SET_RHANDLE));
-}
-
-__attribute__((naked))
-size_t psa_read(psa_handle_t msg_handle, uint32_t invec_idx,
- void *buffer, size_t num_bytes)
-
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_READ));
-}
-
-__attribute__((naked))
-size_t psa_skip(psa_handle_t msg_handle, uint32_t invec_idx, size_t num_bytes)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_SKIP));
-}
-
-__attribute__((naked))
-void psa_write(psa_handle_t msg_handle, uint32_t outvec_idx,
- const void *buffer, size_t num_bytes)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_WRITE));
-}
-
-__attribute__((naked))
-void psa_reply(psa_handle_t msg_handle, psa_status_t retval)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_REPLY));
-}
-
-__attribute__((naked))
-void psa_notify(int32_t partition_id)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_NOTIFY));
-}
-
-__attribute__((naked))
-void psa_clear(void)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_CLEAR));
-}
-
-__attribute__((naked))
-void psa_eoi(psa_signal_t irq_signal)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_EOI));
-}
-
-__attribute__((naked))
-void psa_panic(void)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_PANIC));
-}
-
-__attribute__((naked))
-void psa_irq_enable(psa_signal_t irq_signal)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_IRQ_ENABLE));
-}
-
-__attribute__((naked))
-psa_irq_status_t psa_irq_disable(psa_signal_t irq_signal)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_IRQ_DISABLE));
-}
-
-__attribute__((naked))
-void psa_reset_signal(psa_signal_t irq_signal)
-{
- __ASM volatile("SVC %0 \n"
- "BX LR \n"
- : : "I" (TFM_SVC_PSA_RESET_SIGNAL));
-}
diff --git a/interface/src/tfm_psa_call_pack.c b/interface/src/tfm_psa_call_pack.c
new file mode 100644
index 0000000..289784e
--- /dev/null
+++ b/interface/src/tfm_psa_call_pack.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2021, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#include <stdint.h>
+#include "psa/client.h"
+#include "tfm_psa_call_pack.h"
+
+psa_status_t psa_call(psa_handle_t handle,
+ int32_t type,
+ const psa_invec *in_vec,
+ size_t in_len,
+ psa_outvec *out_vec,
+ size_t out_len)
+{
+ if ((type > INT16_MAX) ||
+ (type < INT16_MIN) ||
+ (in_len > UINT8_MAX) ||
+ (out_len > UINT8_MAX)) {
+ return PSA_ERROR_PROGRAMMER_ERROR;
+ }
+
+ return tfm_psa_call_pack(handle, PARAM_PACK(type, in_len, out_len),
+ in_vec, out_vec);
+}
diff --git a/interface/src/tfm_psa_ns_api.c b/interface/src/tfm_psa_ns_api.c
index 751216d..4d29f1b 100644
--- a/interface/src/tfm_psa_ns_api.c
+++ b/interface/src/tfm_psa_ns_api.c
@@ -8,7 +8,7 @@
#include "psa/client.h"
#include "tfm_ns_interface.h"
#include "tfm_api.h"
-#include "tfm_psa_call_param.h"
+#include "tfm_psa_call_pack.h"
/**** API functions ****/
diff --git a/secure_fw/CMakeLists.txt b/secure_fw/CMakeLists.txt
index c13d406..e43e31f 100644
--- a/secure_fw/CMakeLists.txt
+++ b/secure_fw/CMakeLists.txt
@@ -92,13 +92,24 @@
)
set_source_files_properties(
- ${CMAKE_SOURCE_DIR}/interface/src/psa/psa_client.c
- ${CMAKE_SOURCE_DIR}/interface/src/psa/psa_service.c
+ ${CMAKE_SOURCE_DIR}/secure_fw/spm/cmsis_psa/psa_interface_svc.c
PROPERTIES
COMPILE_FLAGS $<$<C_COMPILER_ID:GNU>:-Wno-unused-parameter>
COMPILE_FLAGS $<$<C_COMPILER_ID:ARMClang>:-Wno-unused-parameter>
)
+# Secure component relies on 'tfm_secure_api', append headers/sources
+# into this target, also the SPE build indicator.
+target_sources(tfm_secure_api
+ INTERFACE
+ $<$<BOOL:${TFM_PSA_API}>:${CMAKE_SOURCE_DIR}/secure_fw/spm/cmsis_psa/psa_interface_svc.c>
+)
+
+target_compile_definitions(tfm_secure_api
+ INTERFACE
+ CONFIG_TFM_BUILDING_SPE=1
+)
+
############################# Secure veneers ###################################
if(NOT (TFM_PSA_API AND TFM_MULTI_CORE_TOPOLOGY))
diff --git a/secure_fw/spm/include/compiler_ext_defs.h b/secure_fw/include/compiler_ext_defs.h
similarity index 100%
rename from secure_fw/spm/include/compiler_ext_defs.h
rename to secure_fw/include/compiler_ext_defs.h
diff --git a/secure_fw/include/psa_interface_redirect.h b/secure_fw/include/psa_interface_redirect.h
new file mode 100644
index 0000000..2f2bc8c
--- /dev/null
+++ b/secure_fw/include/psa_interface_redirect.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2021, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+#ifndef __PSA_INTERFACE_REDIRECT_H__
+#define __PSA_INTERFACE_REDIRECT_H__
+
+#ifdef CONFIG_TFM_PSA_API_SUPERVISOR_CALL
+
+#define psa_framework_version psa_framework_version_svc
+#define psa_version psa_version_svc
+#define psa_connect psa_connect_svc
+#define tfm_psa_call_pack tfm_psa_call_pack_svc
+#define psa_close psa_close_svc
+#define psa_wait psa_wait_svc
+#define psa_get psa_get_svc
+#define psa_set_rhandle psa_set_rhandle_svc
+#define psa_read psa_read_svc
+#define psa_skip psa_skip_svc
+#define psa_write psa_write_svc
+#define psa_reply psa_reply_svc
+#define psa_notify psa_notify_svc
+#define psa_clear psa_clear_svc
+#define psa_eoi psa_eoi_svc
+#define psa_panic psa_panic_svc
+#define psa_irq_enable psa_irq_enable_svc
+#define psa_irq_disable psa_irq_disable_svc
+#define psa_reset_signal psa_reset_signal_svc
+#define psa_rot_lifecycle_state psa_rot_lifecycle_state_svc
+
+#endif
+
+#endif /* __PSA_INTERFACE_REDIRECT_H__ */
diff --git a/secure_fw/spm/cmsis_psa/psa_interface_svc.c b/secure_fw/spm/cmsis_psa/psa_interface_svc.c
new file mode 100644
index 0000000..db6d45f
--- /dev/null
+++ b/secure_fw/spm/cmsis_psa/psa_interface_svc.c
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#include <stdint.h>
+#include "compiler_ext_defs.h"
+#include "svc_num.h"
+#include "psa/client.h"
+#include "psa/lifecycle.h"
+#include "psa/service.h"
+
+#ifdef CONFIG_TFM_PSA_API_SUPERVISOR_CALL
+
+__naked uint32_t psa_framework_version_svc(void)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_FRAMEWORK_VERSION));
+}
+
+__naked uint32_t psa_version_svc(uint32_t sid)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_VERSION));
+}
+
+__naked psa_handle_t psa_connect_svc(uint32_t sid, uint32_t version)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_CONNECT));
+}
+
+__naked psa_status_t tfm_psa_call_pack_svc(psa_handle_t handle,
+ uint32_t ctrl_param,
+ const psa_invec *in_vec,
+ psa_outvec *out_vec)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_CALL));
+}
+
+__naked void psa_close_svc(psa_handle_t handle)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_CLOSE));
+}
+
+__naked psa_signal_t psa_wait_svc(psa_signal_t signal_mask, uint32_t timeout)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_WAIT));
+}
+
+__naked psa_status_t psa_get_svc(psa_signal_t signal, psa_msg_t *msg)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_GET));
+}
+
+__naked void psa_set_rhandle_svc(psa_handle_t msg_handle, void *rhandle)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_SET_RHANDLE));
+}
+
+__naked size_t psa_read_svc(psa_handle_t msg_handle, uint32_t invec_idx,
+ void *buffer, size_t num_bytes)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_READ));
+}
+
+__naked size_t psa_skip_svc(psa_handle_t msg_handle,
+ uint32_t invec_idx, size_t num_bytes)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_SKIP));
+}
+
+__naked void psa_write_svc(psa_handle_t msg_handle, uint32_t outvec_idx,
+ const void *buffer, size_t num_bytes)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_WRITE));
+}
+
+__naked void psa_reply_svc(psa_handle_t msg_handle, psa_status_t retval)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_REPLY));
+}
+
+__naked void psa_notify_svc(int32_t partition_id)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_NOTIFY));
+}
+
+__naked void psa_clear_svc(void)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_CLEAR));
+}
+
+__naked void psa_eoi_svc(psa_signal_t irq_signal)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_EOI));
+}
+
+__naked void psa_panic_svc(void)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_PANIC));
+}
+
+__naked void psa_irq_enable_svc(psa_signal_t irq_signal)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_IRQ_ENABLE));
+}
+
+__naked psa_irq_status_t psa_irq_disable_svc(psa_signal_t irq_signal)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_IRQ_DISABLE));
+}
+
+__naked void psa_reset_signal_svc(psa_signal_t irq_signal)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_RESET_SIGNAL));
+}
+
+__naked uint32_t psa_rot_lifecycle_state_svc(void)
+{
+ __asm volatile("svc %0 \n"
+ "bx lr \n"
+ : : "I" (TFM_SVC_PSA_LIFECYCLE));
+}
+
+#endif /* CONFIG_TFM_PSA_API_SUPERVISOR_CALL */
diff --git a/secure_fw/spm/cmsis_psa/tfm_rpc.c b/secure_fw/spm/cmsis_psa/tfm_rpc.c
index 9fc1ced..5fcd85f 100644
--- a/secure_fw/spm/cmsis_psa/tfm_rpc.c
+++ b/secure_fw/spm/cmsis_psa/tfm_rpc.c
@@ -10,7 +10,7 @@
#include "tfm_rpc.h"
#include "utilities.h"
#include "load/partition_defs.h"
-#include "tfm_psa_call_param.h"
+#include "tfm_psa_call_pack.h"
static void default_handle_req(void)
{
diff --git a/secure_fw/spm/ffm/psa_api.c b/secure_fw/spm/ffm/psa_api.c
index 52f15e6..c11fce5 100644
--- a/secure_fw/spm/ffm/psa_api.c
+++ b/secure_fw/spm/ffm/psa_api.c
@@ -23,7 +23,7 @@
#include "tfm_spm_hal.h"
#include "tfm_hal_interrupt.h"
#include "tfm_hal_platform.h"
-#include "tfm_psa_call_param.h"
+#include "tfm_psa_call_pack.h"
#define GET_STATELESS_SERVICE(index) (stateless_services_ref_tbl[index])
extern struct service_t *stateless_services_ref_tbl[];