diff options
author | Ken Liu <ken.liu@arm.com> | 2018-07-18 16:36:02 +0800 |
---|---|---|
committer | Edison Ai <edison.ai@arm.com> | 2018-12-17 19:54:48 +0800 |
commit | b79a6f539673d743399361b6ccd796f8154fb93d (patch) | |
tree | be3b69ad30db4601386e22b2db4a0b48d7ad265c | |
parent | 03365b592576e16e8b2ddc8b94c33307691a5bb9 (diff) | |
download | trusted-firmware-m-b79a6f539673d743399361b6ccd796f8154fb93d.tar.gz |
Core: move PSA API sources into `ipc` directory
Move ipc related source code to 'ipc' folder for easier code
browsing. This also readies codebase for future additions.
Change-Id: Icc78338a3832b73e9a71bf33577829bf310da890
Signed-off-by: Ken Liu <ken.liu@arm.com>
-rw-r--r-- | secure_fw/CMakeLists.txt | 4 | ||||
-rw-r--r-- | secure_fw/core/CMakeLists.inc | 6 | ||||
-rw-r--r-- | secure_fw/core/ipc/CMakeLists.inc | 59 | ||||
-rw-r--r-- | secure_fw/core/ipc/psa_api.c (renamed from secure_fw/core/psa_api.c) | 0 | ||||
-rw-r--r-- | secure_fw/core/ipc/tfm_queue.c (renamed from secure_fw/core/tfm_queue.c) | 0 | ||||
-rw-r--r-- | secure_fw/core/ipc/tfm_queue.h (renamed from secure_fw/core/tfm_queue.h) | 0 | ||||
-rw-r--r-- | secure_fw/core/ipc/tfm_thread.c (renamed from secure_fw/core/tfm_thread.c) | 0 | ||||
-rw-r--r-- | secure_fw/core/ipc/tfm_thread.h (renamed from secure_fw/core/tfm_thread.h) | 0 | ||||
-rw-r--r-- | test/test_services/tfm_ipc_test/ipc_test_service.c | 2 |
9 files changed, 65 insertions, 6 deletions
diff --git a/secure_fw/CMakeLists.txt b/secure_fw/CMakeLists.txt index 7bd047e63f..11e96901aa 100644 --- a/secure_fw/CMakeLists.txt +++ b/secure_fw/CMakeLists.txt @@ -30,6 +30,10 @@ endif() include(${SECURE_FW_DIR}/spm/CMakeLists.inc) include(${SECURE_FW_DIR}/core/CMakeLists.inc) include(${SECURE_FW_DIR}/ns_callable/CMakeLists.inc) +# Involve IPC sources only PSA APIs are there +if(TFM_PSA_API) + include(${SECURE_FW_DIR}/core/ipc/CMakeLists.inc) +endif() set(BUILD_CMSIS_CORE On) set(BUILD_RETARGET On) diff --git a/secure_fw/core/CMakeLists.inc b/secure_fw/core/CMakeLists.inc index 00ee316752..31216d1420 100644 --- a/secure_fw/core/CMakeLists.inc +++ b/secure_fw/core/CMakeLists.inc @@ -42,11 +42,7 @@ set (SS_CORE_C_SRC if (NOT DEFINED TFM_PSA_API) message(FATAL_ERROR "Incomplete build configuration: TFM_PSA_API is undefined. ") elseif (TFM_PSA_API) - list(APPEND SS_CORE_C_SRC "${SS_CORE_DIR}/tfm_psa_api_client.c" - "${SS_CORE_DIR}/tfm_thread.c" - "${SS_CORE_DIR}/tfm_queue.c" - "${SS_CORE_DIR}/psa_api.c" - ) + list(APPEND SS_CORE_C_SRC "${SS_CORE_DIR}/tfm_psa_api_client.c") endif() #Append all our source files to global lists. diff --git a/secure_fw/core/ipc/CMakeLists.inc b/secure_fw/core/ipc/CMakeLists.inc new file mode 100644 index 0000000000..4753fdb638 --- /dev/null +++ b/secure_fw/core/ipc/CMakeLists.inc @@ -0,0 +1,59 @@ +#------------------------------------------------------------------------------- +# Copyright (c) 2018, Arm Limited. All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# +#------------------------------------------------------------------------------- + +#Definitions to compile the "ipc" module. +#This file assumes it will be included from a project specific cmakefile, and +#will not create a library or executable. +#Inputs: +# TFM_ROOT_DIR - directory where secure FW sourec is located. +# +#Outputs: +# Will modify include directories to make the source compile. +# ALL_SRC_C: C source files to be compiled will be added to this list. +# This shall be added to your add_executable or add_library command. +# ALL_SRC_CXX: C++ source files to be compiled will be added to this list. +# This shall be added to your add_executable or add_library command. +# ALL_SRC_ASM: assembly source files to be compiled will be added to this +# list. This shall be added to your add_executable or add_library +# command. +# Include directories will be modified by using the include_directories() +# commands as needed. + +#Get the current directory where this file is located. +set(SS_IPC_DIR ${CMAKE_CURRENT_LIST_DIR}) +if(NOT DEFINED TFM_ROOT_DIR) + message(FATAL_ERROR + "Please set TFM_ROOT_DIR before including this file.") +endif() + +if (NOT DEFINED TFM_PSA_API) + message(FATAL_ERROR "Incomplete build configuration: TFM_PSA_API is undefined. ") +elseif (TFM_PSA_API) + set (SS_IPC_C_SRC "${SS_IPC_DIR}/tfm_thread.c" + "${SS_IPC_DIR}/tfm_queue.c" + "${SS_IPC_DIR}/psa_api.c" + ) +endif() + +#Append all our source files to global lists. +list(APPEND ALL_SRC_C ${SS_IPC_C_SRC}) +unset(SS_IPC_C_SRC) + +#Setting include directories +embedded_include_directories(PATH ${TFM_ROOT_DIR} ABSOLUTE) +embedded_include_directories(PATH ${TFM_ROOT_DIR}/interface/include ABSOLUTE) +embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/spm ABSOLUTE) +embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/core ABSOLUTE) +embedded_include_directories(PATH ${TFM_ROOT_DIR}/secure_fw/core/ipc ABSOLUTE) + +if(NOT DEFINED PLATFORM_CMAKE_FILE) + message (FATAL_ERROR "Platform specific CMake is not defined. Please set PLATFORM_CMAKE_FILE.") +elseif(NOT EXISTS ${PLATFORM_CMAKE_FILE}) + message (FATAL_ERROR "Platform specific CMake \"${PLATFORM_CMAKE_FILE}\" file does not exist. Please fix value of PLATFORM_CMAKE_FILE.") +else() + include(${PLATFORM_CMAKE_FILE}) +endif() diff --git a/secure_fw/core/psa_api.c b/secure_fw/core/ipc/psa_api.c index d0a19840d3..d0a19840d3 100644 --- a/secure_fw/core/psa_api.c +++ b/secure_fw/core/ipc/psa_api.c diff --git a/secure_fw/core/tfm_queue.c b/secure_fw/core/ipc/tfm_queue.c index 4a07aed117..4a07aed117 100644 --- a/secure_fw/core/tfm_queue.c +++ b/secure_fw/core/ipc/tfm_queue.c diff --git a/secure_fw/core/tfm_queue.h b/secure_fw/core/ipc/tfm_queue.h index 9711addaff..9711addaff 100644 --- a/secure_fw/core/tfm_queue.h +++ b/secure_fw/core/ipc/tfm_queue.h diff --git a/secure_fw/core/tfm_thread.c b/secure_fw/core/ipc/tfm_thread.c index 58bca8edcb..58bca8edcb 100644 --- a/secure_fw/core/tfm_thread.c +++ b/secure_fw/core/ipc/tfm_thread.c diff --git a/secure_fw/core/tfm_thread.h b/secure_fw/core/ipc/tfm_thread.h index ac93e69d8d..ac93e69d8d 100644 --- a/secure_fw/core/tfm_thread.h +++ b/secure_fw/core/ipc/tfm_thread.h diff --git a/test/test_services/tfm_ipc_test/ipc_test_service.c b/test/test_services/tfm_ipc_test/ipc_test_service.c index ab1a1f1d5c..404493f703 100644 --- a/test/test_services/tfm_ipc_test/ipc_test_service.c +++ b/test/test_services/tfm_ipc_test/ipc_test_service.c @@ -9,7 +9,7 @@ #include <stdio.h> #include "psa_client.h" #include "psa_service.h" -#include "secure_fw/core/tfm_thread.h" +#include "secure_fw/core/ipc/tfm_thread.h" #include "secure_fw/core/secure_utilities.h" #include "secure_fw/core/tfm_secure_api.h" #include "tfm_api.h" |