aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Liu <ken.liu@arm.com>2018-07-18 16:36:02 +0800
committerEdison Ai <edison.ai@arm.com>2018-07-27 09:38:21 +0800
commitad3b57b0cc1e2ff0e55d615ae767c042a74ca03e (patch)
tree93c15c57306efaa85505ab93e0a33507e40f5bda
parent99b5d65c761ffba266286e9521c5ce82a33815ef (diff)
downloadtrusted-firmware-m-feature-ipc-truncated.tar.gz
Core: move PSA API sources into `ipc` directoryfeature-ipc-truncated
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.txt4
-rw-r--r--secure_fw/core/CMakeLists.inc6
-rw-r--r--secure_fw/core/ipc/CMakeLists.inc59
-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.c2
9 files changed, 65 insertions, 6 deletions
diff --git a/secure_fw/CMakeLists.txt b/secure_fw/CMakeLists.txt
index 248c8ebd..75e19d69 100644
--- a/secure_fw/CMakeLists.txt
+++ b/secure_fw/CMakeLists.txt
@@ -32,6 +32,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 c108aa8b..2c80817f 100644
--- a/secure_fw/core/CMakeLists.inc
+++ b/secure_fw/core/CMakeLists.inc
@@ -39,11 +39,7 @@ set (SS_CORE_C_SRC "${SS_CORE_DIR}/tfm_core.c"
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 00000000..4753fdb6
--- /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 d0a19840..d0a19840 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 4a07aed1..4a07aed1 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 9711adda..9711adda 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 58bca8ed..58bca8ed 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 ac93e69d..ac93e69d 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 ab1a1f1d..404493f7 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"