Partitions: Fix minor header include issues
tfm_veneers.h is used by Library Mode only.
This patch fixes some include issue where tfm_veneer.h is included
for both Mode.
Change-Id: I87830222e7fec0098ed77f43006639dba3937a44
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/cmake/install.cmake b/cmake/install.cmake
index 653dcc4..2af1476 100644
--- a/cmake/install.cmake
+++ b/cmake/install.cmake
@@ -55,7 +55,7 @@
${INTERFACE_INC_DIR}/multi_core/tfm_mailbox.h
${INTERFACE_INC_DIR}/multi_core/tfm_mailbox_config.h
DESTINATION ${INSTALL_INTERFACE_INC_DIR})
-else()
+elseif (NOT TFM_PSA_API)
install(FILES ${CMAKE_BINARY_DIR}/generated/interface/include/tfm_veneers.h
DESTINATION ${INSTALL_INTERFACE_INC_DIR}/tfm/veneers)
endif()
diff --git a/secure_fw/partitions/crypto/tfm_crypto_secure_api.c b/secure_fw/partitions/crypto/tfm_crypto_secure_api.c
index 4de4d67..be1d0ba 100644
--- a/secure_fw/partitions/crypto/tfm_crypto_secure_api.c
+++ b/secure_fw/partitions/crypto/tfm_crypto_secure_api.c
@@ -6,15 +6,16 @@
*/
#include "array.h"
-#include "tfm_veneers.h"
#include "tfm_crypto_defs.h"
#include "psa/crypto.h"
#ifdef TFM_PSA_API
+#include "psa/client.h"
#include "psa_manifest/sid.h"
+#else
+#include "tfm_veneers.h"
#endif
#ifdef TFM_PSA_API
-#include "psa/client.h"
#define API_DISPATCH(sfn_name, sfn_id) \
psa_call(TFM_CRYPTO_HANDLE, PSA_IPC_CALL, \
diff --git a/secure_fw/partitions/initial_attestation/tfm_attest_secure_api.c b/secure_fw/partitions/initial_attestation/tfm_attest_secure_api.c
index 52744ed..ab32645 100644
--- a/secure_fw/partitions/initial_attestation/tfm_attest_secure_api.c
+++ b/secure_fw/partitions/initial_attestation/tfm_attest_secure_api.c
@@ -7,12 +7,13 @@
#include "array.h"
#include "psa/initial_attestation.h"
-#include "psa/client.h"
-#include "tfm_veneers.h"
#include "tfm_memory_utils.h"
#include "tfm_secure_api.h"
#ifdef TFM_PSA_API
+#include "psa/client.h"
#include "psa_manifest/sid.h"
+#else
+#include "tfm_veneers.h"
#endif
#include <string.h>
diff --git a/secure_fw/partitions/platform/tfm_platform_secure_api.c b/secure_fw/partitions/platform/tfm_platform_secure_api.c
index 780918e..0fe0c7f 100644
--- a/secure_fw/partitions/platform/tfm_platform_secure_api.c
+++ b/secure_fw/partitions/platform/tfm_platform_secure_api.c
@@ -1,14 +1,15 @@
/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
#include "tfm_platform_api.h"
-#include "tfm_veneers.h"
#ifdef TFM_PSA_API
#include "psa_manifest/sid.h"
+#else
+#include "tfm_veneers.h"
#endif
enum tfm_platform_err_t tfm_platform_system_reset(void)
diff --git a/secure_fw/partitions/protected_storage/tfm_ps_secure_api.c b/secure_fw/partitions/protected_storage/tfm_ps_secure_api.c
index c6b6e80..0f69022 100644
--- a/secure_fw/partitions/protected_storage/tfm_ps_secure_api.c
+++ b/secure_fw/partitions/protected_storage/tfm_ps_secure_api.c
@@ -7,9 +7,11 @@
#include "array.h"
#include "psa/protected_storage.h"
-#include "tfm_veneers.h"
#ifdef TFM_PSA_API
+#include "psa/client.h"
#include "psa_manifest/sid.h"
+#else
+#include "tfm_veneers.h"
#endif
psa_status_t psa_ps_set(psa_storage_uid_t uid,