aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Peng <kevin.peng@arm.com>2019-08-01 16:04:42 +0800
committerKen Liu <ken.liu@arm.com>2019-08-16 02:20:12 +0000
commit85fef5de8bb96877043acde7a215788b1d1013db (patch)
treebbd0da53c11624ccf669a61bc24b3ddf04840ef5
parent9449a361776b2c08834c05e8f276ffa87301d18b (diff)
downloadtrusted-firmware-m-85fef5de8bb96877043acde7a215788b1d1013db.tar.gz
Build: Export NS interfaces on necessity
This patch makes exporting of NS interfaces on necessity. For example, interfaces for library model are not copied to install/export when building IPC model configurations. Change-Id: Ia8d26d87783646146fa855d2264aad2e3a1dee5d Signed-off-by: Kevin Peng <kevin.peng@arm.com>
-rw-r--r--secure_fw/CMakeLists.txt61
-rw-r--r--test/CMakeLists.txt7
2 files changed, 64 insertions, 4 deletions
diff --git a/secure_fw/CMakeLists.txt b/secure_fw/CMakeLists.txt
index d605b065..cad51b6e 100644
--- a/secure_fw/CMakeLists.txt
+++ b/secure_fw/CMakeLists.txt
@@ -281,11 +281,64 @@ function(set_up_secure_fw_build)
endif()
#Export files needed to interface external applications at: <build_dir>/install/export/tfm/
- install(DIRECTORY ${TFM_ROOT_DIR}/interface/include/
- DESTINATION export/tfm/inc)
+ set(INTERFACE_INC_DIR "${INTERFACE_DIR}/include")
+ set(INTERFACE_SRC_DIR "${INTERFACE_DIR}/src")
+ set(EXPORT_INC_DIR "export/tfm/include")
+ set(EXPORT_SRC_DIR "export/tfm/src")
+ #Headers
+ install(DIRECTORY ${INTERFACE_INC_DIR}/psa
+ DESTINATION ${EXPORT_INC_DIR})
+
+ install(FILES ${INTERFACE_INC_DIR}/os_wrapper/common.h
+ ${INTERFACE_INC_DIR}/os_wrapper/mutex.h
+ DESTINATION ${EXPORT_INC_DIR}/os_wrapper)
+
+ install(FILES ${INTERFACE_INC_DIR}/psa_manifest/sid.h
+ DESTINATION ${EXPORT_INC_DIR}/psa_manifest)
+
+ install(FILES ${INTERFACE_INC_DIR}/tfm_api.h
+ ${INTERFACE_INC_DIR}/tfm_crypto_defs.h
+ ${INTERFACE_INC_DIR}/tfm_ns_interface.h
+ ${INTERFACE_INC_DIR}/tfm_nspm_api.h
+ ${INTERFACE_INC_DIR}/tfm_nspm_svc_handler.h
+ ${INTERFACE_INC_DIR}/tfm_ns_svc.h
+ ${INTERFACE_INC_DIR}/tfm_sst_defs.h
+ ${INTERFACE_INC_DIR}/tfm_veneers.h
+ DESTINATION ${EXPORT_INC_DIR})
+
+ #Sources
+ install(FILES ${INTERFACE_SRC_DIR}/tfm_ns_interface.c
+ ${INTERFACE_SRC_DIR}/tfm_nspm_api.c
+ ${INTERFACE_SRC_DIR}/tfm_nspm_svc_handler.c
+ DESTINATION ${EXPORT_SRC_DIR})
+
+ if(TFM_PSA_API)
+ install(FILES ${INTERFACE_SRC_DIR}/tfm_psa_ns_api.c
+ ${INTERFACE_SRC_DIR}/tfm_crypto_ipc_api.c
+ ${INTERFACE_SRC_DIR}/tfm_initial_attestation_ipc_api.c
+ ${INTERFACE_SRC_DIR}/tfm_sst_ipc_api.c
+ DESTINATION ${EXPORT_SRC_DIR})
+ else()
+ install(FILES ${INTERFACE_SRC_DIR}/tfm_crypto_func_api.c
+ ${INTERFACE_SRC_DIR}/tfm_initial_attestation_func_api.c
+ ${INTERFACE_SRC_DIR}/tfm_sst_func_api.c
+ DESTINATION ${EXPORT_SRC_DIR})
+ endif()
- install(DIRECTORY ${TFM_ROOT_DIR}/interface/src/
- DESTINATION export/tfm/src)
+ if(TFM_PARTITION_AUDIT_LOG)
+ install(FILES ${INTERFACE_INC_DIR}/psa_audit_api.h
+ ${INTERFACE_INC_DIR}/psa_audit_defs.h
+ DESTINATION ${EXPORT_INC_DIR})
+ install(FILES ${INTERFACE_SRC_DIR}/tfm_audit_func_api.c
+ DESTINATION ${EXPORT_SRC_DIR})
+ endif()
+
+ if(TFM_PARTITION_PLATFORM)
+ install(FILES ${INTERFACE_INC_DIR}/tfm_platform_api.h
+ DESTINATION ${EXPORT_INC_DIR})
+ install(FILES ${INTERFACE_SRC_DIR}/tfm_platform_func_api.c
+ DESTINATION ${EXPORT_SRC_DIR})
+ endif()
install(FILES ${S_VENEER_FILE} DESTINATION export/tfm/veneers)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 4b94233f..494003a3 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -114,5 +114,12 @@ install(TARGETS tfm_non_secure_tests
DESTINATION export/tfm/test/lib
PUBLIC_HEADER DESTINATION export/tfm/test/inc)
+if(ENABLE_SECURE_STORAGE_SERVICE_TESTS)
+ #only SST tests are using semaphore and thread APIs
+ install(FILES ${TFM_ROOT_DIR}/interface/include/os_wrapper/semaphore.h
+ ${TFM_ROOT_DIR}/interface/include/os_wrapper/thread.h
+ DESTINATION export/tfm/include/os_wrapper)
+endif()
+
embedded_project_end(tfm_non_secure_tests)
embedded_project_end(tfm_secure_tests)