Partition: Move partitions secure api into SPRTL
Original parition secure api is declared in 'SFN' section. However, if
one secure api is not used, it will still be kept in binary. This will
cost some memory. To improve it, we put these partition secure api in
SPRTL. Then, the unused functions will be discarded by toolchain.
Change the tfm_secure_api library attribute to 'INTERFACE' since the
public sources are moved into tfm_sprt library.
Change-Id: I13799bd50b2a6b700ffa6d029d0af3dbb84e584f
Signed-off-by: Summer Qin <summer.qin@arm.com>
diff --git a/secure_fw/CMakeLists.txt b/secure_fw/CMakeLists.txt
index f1a6a6b..97bc2fb 100644
--- a/secure_fw/CMakeLists.txt
+++ b/secure_fw/CMakeLists.txt
@@ -9,7 +9,7 @@
add_executable(tfm_s)
add_library(secure_fw INTERFACE)
-add_library(tfm_secure_api STATIC)
+add_library(tfm_secure_api INTERFACE)
add_library(tfm_partitions INTERFACE)
# Lots of seperate things need to know which partitions are enabled, so this
# meta-target is provided so the related compile definitions can be collected in
@@ -67,16 +67,13 @@
############################ Secure API ########################################
target_include_directories(tfm_secure_api
- PUBLIC
+ INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
target_link_libraries(tfm_secure_api
- PUBLIC
+ INTERFACE
tfm_arch
- PRIVATE
- psa_interface
- platform_s
)
set_source_files_properties(
diff --git a/secure_fw/partitions/audit_logging/CMakeLists.txt b/secure_fw/partitions/audit_logging/CMakeLists.txt
index b17ca04..14d739e 100644
--- a/secure_fw/partitions/audit_logging/CMakeLists.txt
+++ b/secure_fw/partitions/audit_logging/CMakeLists.txt
@@ -49,7 +49,7 @@
############################ Secure API ########################################
-target_sources(tfm_secure_api
+target_sources(tfm_sprt
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/tfm_audit_secure_api.c
)
diff --git a/secure_fw/partitions/audit_logging/tfm_audit_secure_api.c b/secure_fw/partitions/audit_logging/tfm_audit_secure_api.c
index 383c66c..ad54d7b 100644
--- a/secure_fw/partitions/audit_logging/tfm_audit_secure_api.c
+++ b/secure_fw/partitions/audit_logging/tfm_audit_secure_api.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -25,7 +25,6 @@
in_vec, ARRAY_SIZE(in_vec), \
NULL, 0)
-__attribute__((section("SFN")))
psa_status_t psa_audit_retrieve_record(const uint32_t record_index,
const uint32_t buffer_size,
const uint8_t *token,
@@ -49,7 +48,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_audit_get_info(uint32_t *num_records, uint32_t *size)
{
psa_status_t status;
@@ -63,7 +61,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_audit_get_record_info(const uint32_t record_index,
uint32_t *size)
{
@@ -80,7 +77,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_audit_delete_record(const uint32_t record_index,
const uint8_t *token,
const uint32_t token_size)
@@ -96,7 +92,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_audit_add_record(const struct psa_audit_record *record)
{
psa_status_t status;
diff --git a/secure_fw/partitions/crypto/CMakeLists.txt b/secure_fw/partitions/crypto/CMakeLists.txt
index 6d7df6e..6abffc2 100644
--- a/secure_fw/partitions/crypto/CMakeLists.txt
+++ b/secure_fw/partitions/crypto/CMakeLists.txt
@@ -76,7 +76,7 @@
############################ Secure API ########################################
-target_sources(tfm_secure_api
+target_sources(tfm_sprt
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/tfm_crypto_secure_api.c
)
@@ -90,7 +90,7 @@
# Pick up configuration definitions
target_link_libraries(tfm_secure_api
- PRIVATE
+ INTERFACE
tfm_partition_crypto
)
diff --git a/secure_fw/partitions/crypto/tfm_crypto_secure_api.c b/secure_fw/partitions/crypto/tfm_crypto_secure_api.c
index ab0d947..1db9be2 100644
--- a/secure_fw/partitions/crypto/tfm_crypto_secure_api.c
+++ b/secure_fw/partitions/crypto/tfm_crypto_secure_api.c
@@ -47,7 +47,6 @@
NULL, 0)
#endif /* TFM_PSA_API */
-__attribute__((section("SFN")))
psa_status_t psa_crypto_init(void)
{
/* Service init is performed during TFM boot up,
@@ -56,8 +55,6 @@
return PSA_SUCCESS;
}
-__attribute__((section("SFN")))
-
psa_status_t psa_open_key(psa_key_id_t id,
psa_key_handle_t *handle)
{
@@ -91,7 +88,6 @@
#endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_close_key(psa_key_handle_t handle)
{
#ifdef TFM_CRYPTO_KEY_MODULE_DISABLED
@@ -121,7 +117,6 @@
#endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_import_key(const psa_key_attributes_t *attributes,
const uint8_t *data,
size_t data_length,
@@ -157,7 +152,6 @@
#endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_destroy_key(psa_key_handle_t handle)
{
#ifdef TFM_CRYPTO_KEY_MODULE_DISABLED
@@ -186,7 +180,6 @@
#endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_get_key_attributes(psa_key_handle_t handle,
psa_key_attributes_t *attributes)
{
@@ -252,7 +245,6 @@
#endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_export_key(psa_key_handle_t handle,
uint8_t *data,
size_t data_size,
@@ -290,7 +282,6 @@
#endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_export_public_key(psa_key_handle_t handle,
uint8_t *data,
size_t data_size,
@@ -329,7 +320,6 @@
#endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_copy_key(psa_key_handle_t source_handle,
const psa_key_attributes_t *attributes,
psa_key_handle_t *target_handle)
@@ -366,7 +356,6 @@
#endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_cipher_generate_iv(psa_cipher_operation_t *operation,
unsigned char *iv,
size_t iv_size,
@@ -406,7 +395,6 @@
#endif /* TFM_CRYPTO_CIPHER_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_cipher_set_iv(psa_cipher_operation_t *operation,
const unsigned char *iv,
size_t iv_length)
@@ -442,7 +430,6 @@
#endif /* TFM_CRYPTO_CIPHER_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_cipher_encrypt_setup(psa_cipher_operation_t *operation,
psa_key_handle_t handle,
psa_algorithm_t alg)
@@ -479,7 +466,6 @@
#endif /* TFM_CRYPTO_CIPHER_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_cipher_decrypt_setup(psa_cipher_operation_t *operation,
psa_key_handle_t handle,
psa_algorithm_t alg)
@@ -516,7 +502,6 @@
#endif /* TFM_CRYPTO_CIPHER_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_cipher_update(psa_cipher_operation_t *operation,
const uint8_t *input,
size_t input_length,
@@ -559,7 +544,6 @@
#endif /* TFM_CRYPTO_CIPHER_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_cipher_abort(psa_cipher_operation_t *operation)
{
#ifdef TFM_CRYPTO_CIPHER_MODULE_DISABLED
@@ -592,7 +576,6 @@
#endif /* TFM_CRYPTO_CIPHER_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_cipher_finish(psa_cipher_operation_t *operation,
uint8_t *output,
size_t output_size,
@@ -632,7 +615,6 @@
#endif /* TFM_CRYPTO_CIPHER_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_hash_setup(psa_hash_operation_t *operation,
psa_algorithm_t alg)
{
@@ -668,7 +650,6 @@
#endif /* TFM_CRYPTO_HASH_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_hash_update(psa_hash_operation_t *operation,
const uint8_t *input,
size_t input_length)
@@ -705,7 +686,6 @@
#endif /* TFM_CRYPTO_HASH_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_hash_finish(psa_hash_operation_t *operation,
uint8_t *hash,
size_t hash_size,
@@ -745,7 +725,6 @@
#endif /* TFM_CRYPTO_HASH_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_hash_verify(psa_hash_operation_t *operation,
const uint8_t *hash,
size_t hash_length)
@@ -781,7 +760,6 @@
#endif /* TFM_CRYPTO_HASH_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_hash_abort(psa_hash_operation_t *operation)
{
#ifdef TFM_CRYPTO_HASH_MODULE_DISABLED
@@ -814,7 +792,6 @@
#endif /* TFM_CRYPTO_HASH_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_hash_clone(const psa_hash_operation_t *source_operation,
psa_hash_operation_t *target_operation)
{
@@ -852,7 +829,6 @@
#endif /* TFM_CRYPTO_HASH_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_hash_compute(psa_algorithm_t alg,
const uint8_t *input,
size_t input_length,
@@ -895,7 +871,6 @@
#endif /* TFM_CRYPTO_HASH_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_hash_compare(psa_algorithm_t alg,
const uint8_t *input,
size_t input_length,
@@ -932,7 +907,6 @@
#endif /* TFM_CRYPTO_HASH_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_mac_sign_setup(psa_mac_operation_t *operation,
psa_key_handle_t handle,
psa_algorithm_t alg)
@@ -969,7 +943,6 @@
#endif /* TFM_CRYPTO_MAC_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_mac_verify_setup(psa_mac_operation_t *operation,
psa_key_handle_t handle,
psa_algorithm_t alg)
@@ -1006,7 +979,6 @@
#endif /* TFM_CRYPTO_MAC_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_mac_update(psa_mac_operation_t *operation,
const uint8_t *input,
size_t input_length)
@@ -1042,7 +1014,6 @@
#endif /* TFM_CRYPTO_MAC_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_mac_sign_finish(psa_mac_operation_t *operation,
uint8_t *mac,
size_t mac_size,
@@ -1082,7 +1053,6 @@
#endif /* TFM_CRYPTO_MAC_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_mac_verify_finish(psa_mac_operation_t *operation,
const uint8_t *mac,
size_t mac_length)
@@ -1119,7 +1089,6 @@
#endif /* TFM_CRYPTO_MAC_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_mac_abort(psa_mac_operation_t *operation)
{
#ifdef TFM_CRYPTO_MAC_MODULE_DISABLED
@@ -1152,7 +1121,6 @@
#endif /* TFM_CRYPTO_MAC_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_aead_encrypt(psa_key_handle_t handle,
psa_algorithm_t alg,
const uint8_t *nonce,
@@ -1227,7 +1195,6 @@
#endif /* TFM_CRYPTO_AEAD_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_aead_decrypt(psa_key_handle_t handle,
psa_algorithm_t alg,
const uint8_t *nonce,
@@ -1302,7 +1269,6 @@
#endif /* TFM_CRYPTO_AEAD_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_asymmetric_sign(psa_key_handle_t handle,
psa_algorithm_t alg,
const uint8_t *hash,
@@ -1314,7 +1280,6 @@
return psa_sign_hash(handle, alg, hash, hash_length, signature, signature_size, signature_length);
}
-__attribute__((section("SFN")))
psa_status_t psa_sign_hash(psa_key_handle_t handle,
psa_algorithm_t alg,
const uint8_t *hash,
@@ -1357,7 +1322,6 @@
#endif /* TFM_CRYPTO_ASYMMETRIC_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_asymmetric_verify(psa_key_handle_t handle,
psa_algorithm_t alg,
const uint8_t *hash,
@@ -1368,7 +1332,6 @@
return psa_verify_hash(handle, alg, hash, hash_length, signature, signature_length);
}
-__attribute__((section("SFN")))
psa_status_t psa_verify_hash(psa_key_handle_t handle,
psa_algorithm_t alg,
const uint8_t *hash,
@@ -1406,7 +1369,6 @@
#endif /* TFM_CRYPTO_ASYMMETRIC_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_asymmetric_encrypt(psa_key_handle_t handle,
psa_algorithm_t alg,
const uint8_t *input,
@@ -1468,7 +1430,6 @@
#endif /* TFM_CRYPTO_ASYMMETRIC_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_asymmetric_decrypt(psa_key_handle_t handle,
psa_algorithm_t alg,
const uint8_t *input,
@@ -1530,7 +1491,6 @@
#endif /* TFM_CRYPTO_ASYMMETRIC_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_key_derivation_get_capacity(
const psa_key_derivation_operation_t *operation,
size_t *capacity)
@@ -1566,7 +1526,6 @@
#endif /* TFM_CRYPTO_GENERATOR_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_key_derivation_output_bytes(
psa_key_derivation_operation_t *operation,
uint8_t *output,
@@ -1603,7 +1562,6 @@
#endif /* TFM_CRYPTO_GENERATOR_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_key_derivation_input_key(
psa_key_derivation_operation_t *operation,
psa_key_derivation_step_t step,
@@ -1638,7 +1596,6 @@
#endif /* TFM_CRYPTO_GENERATOR_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_key_derivation_abort(psa_key_derivation_operation_t *operation)
{
#ifdef TFM_CRYPTO_GENERATOR_MODULE_DISABLED
@@ -1672,7 +1629,6 @@
#endif /* TFM_CRYPTO_GENERATOR_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_key_derivation_key_agreement(
psa_key_derivation_operation_t *operation,
psa_key_derivation_step_t step,
@@ -1715,7 +1671,6 @@
#endif /* TFM_CRYPTO_GENERATOR_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_generate_random(uint8_t *output,
size_t output_size)
{
@@ -1754,7 +1709,6 @@
#endif /* TFM_CRYPTO_GENERATOR_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_generate_key(const psa_key_attributes_t *attributes,
psa_key_handle_t *handle)
{
@@ -1789,7 +1743,6 @@
#endif /* TFM_CRYPTO_GENERATOR_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_set_key_domain_parameters(psa_key_attributes_t *attributes,
psa_key_type_t type,
const uint8_t *data,
@@ -1802,7 +1755,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_get_key_domain_parameters(
const psa_key_attributes_t *attributes,
uint8_t *data,
@@ -1816,7 +1768,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_aead_update_ad(psa_aead_operation_t *operation,
const uint8_t *input,
size_t input_length)
@@ -1828,7 +1779,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_aead_finish(psa_aead_operation_t *operation,
uint8_t *ciphertext,
size_t ciphertext_size,
@@ -1844,7 +1794,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_aead_verify(psa_aead_operation_t *operation,
uint8_t *plaintext,
size_t plaintext_size,
@@ -1859,7 +1808,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_aead_abort(psa_aead_operation_t *operation)
{
psa_status_t status;
@@ -1869,7 +1817,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_mac_compute(psa_key_handle_t handle,
psa_algorithm_t alg,
const uint8_t *input,
@@ -1885,7 +1832,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_mac_verify(psa_key_handle_t handle,
psa_algorithm_t alg,
const uint8_t *input,
@@ -1900,7 +1846,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_cipher_encrypt(psa_key_handle_t handle,
psa_algorithm_t alg,
const uint8_t *input,
@@ -1916,7 +1861,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_cipher_decrypt(psa_key_handle_t handle,
psa_algorithm_t alg,
const uint8_t *input,
@@ -1932,7 +1876,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_raw_key_agreement(psa_algorithm_t alg,
psa_key_handle_t private_key,
const uint8_t *peer_key,
@@ -1976,7 +1919,6 @@
#endif /* TFM_CRYPTO_GENERATOR_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_key_derivation_setup(psa_key_derivation_operation_t *operation,
psa_algorithm_t alg)
{
@@ -2011,7 +1953,6 @@
#endif /* TFM_CRYPTO_GENERATOR_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_key_derivation_set_capacity(
psa_key_derivation_operation_t *operation,
size_t capacity)
@@ -2044,7 +1985,6 @@
#endif /* TFM_CRYPTO_GENERATOR_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_key_derivation_input_bytes(
psa_key_derivation_operation_t *operation,
psa_key_derivation_step_t step,
@@ -2080,7 +2020,6 @@
#endif /* TFM_CRYPTO_GENERATOR_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_key_derivation_output_key(
const psa_key_attributes_t *attributes,
psa_key_derivation_operation_t *operation,
@@ -2118,7 +2057,6 @@
#endif /* TFM_CRYPTO_GENERATOR_MODULE_DISABLED */
}
-__attribute__((section("SFN")))
psa_status_t psa_aead_encrypt_setup(psa_aead_operation_t *operation,
psa_key_handle_t handle,
psa_algorithm_t alg)
@@ -2130,7 +2068,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_aead_decrypt_setup(psa_aead_operation_t *operation,
psa_key_handle_t handle,
psa_algorithm_t alg)
@@ -2142,7 +2079,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_aead_generate_nonce(psa_aead_operation_t *operation,
uint8_t *nonce,
size_t nonce_size,
@@ -2155,7 +2091,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_aead_set_nonce(psa_aead_operation_t *operation,
const uint8_t *nonce,
size_t nonce_length)
@@ -2167,7 +2102,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_aead_set_lengths(psa_aead_operation_t *operation,
size_t ad_length,
size_t plaintext_length)
@@ -2179,7 +2113,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_aead_update(psa_aead_operation_t *operation,
const uint8_t *input,
size_t input_length,
diff --git a/secure_fw/partitions/initial_attestation/CMakeLists.txt b/secure_fw/partitions/initial_attestation/CMakeLists.txt
index a087e93..de460c5 100644
--- a/secure_fw/partitions/initial_attestation/CMakeLists.txt
+++ b/secure_fw/partitions/initial_attestation/CMakeLists.txt
@@ -69,7 +69,7 @@
############################ Secure API ########################################
-target_sources(tfm_secure_api
+target_sources(tfm_sprt
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/tfm_attest_secure_api.c
)
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 2722d42..fbbaf98 100644
--- a/secure_fw/partitions/initial_attestation/tfm_attest_secure_api.c
+++ b/secure_fw/partitions/initial_attestation/tfm_attest_secure_api.c
@@ -17,7 +17,6 @@
#define IOVEC_LEN(x) (sizeof(x)/sizeof(x[0]))
-__attribute__((section("SFN")))
psa_status_t
psa_initial_attest_get_token(const uint8_t *auth_challenge,
size_t challenge_size,
@@ -56,7 +55,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t
psa_initial_attest_get_token_size(size_t challenge_size,
size_t *token_size)
@@ -90,7 +88,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t
tfm_initial_attest_get_public_key(uint8_t *public_key,
size_t public_key_buf_size,
diff --git a/secure_fw/partitions/internal_trusted_storage/CMakeLists.txt b/secure_fw/partitions/internal_trusted_storage/CMakeLists.txt
index 9e904c2..8573881 100644
--- a/secure_fw/partitions/internal_trusted_storage/CMakeLists.txt
+++ b/secure_fw/partitions/internal_trusted_storage/CMakeLists.txt
@@ -93,7 +93,7 @@
############################ Secure API ########################################
-target_sources(tfm_secure_api
+target_sources(tfm_sprt
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/tfm_its_secure_api.c
)
diff --git a/secure_fw/partitions/internal_trusted_storage/tfm_its_secure_api.c b/secure_fw/partitions/internal_trusted_storage/tfm_its_secure_api.c
index f06ed6b..09f1b8a 100644
--- a/secure_fw/partitions/internal_trusted_storage/tfm_its_secure_api.c
+++ b/secure_fw/partitions/internal_trusted_storage/tfm_its_secure_api.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -17,7 +17,6 @@
#define IOVEC_LEN(x) (sizeof(x)/sizeof(x[0]))
-__attribute__((section("SFN")))
psa_status_t psa_its_set(psa_storage_uid_t uid,
size_t data_length,
const void *p_data,
@@ -60,7 +59,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_its_get(psa_storage_uid_t uid,
size_t data_offset,
size_t data_size,
@@ -116,7 +114,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_its_get_info(psa_storage_uid_t uid,
struct psa_storage_info_t *p_info)
{
@@ -160,7 +157,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_its_remove(psa_storage_uid_t uid)
{
psa_status_t status;
diff --git a/secure_fw/partitions/platform/CMakeLists.txt b/secure_fw/partitions/platform/CMakeLists.txt
index ecad419..b19037e 100644
--- a/secure_fw/partitions/platform/CMakeLists.txt
+++ b/secure_fw/partitions/platform/CMakeLists.txt
@@ -33,7 +33,7 @@
############################ Secure API ########################################
-target_sources(tfm_secure_api
+target_sources(tfm_sprt
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/tfm_platform_secure_api.c
)
diff --git a/secure_fw/partitions/platform/tfm_platform_secure_api.c b/secure_fw/partitions/platform/tfm_platform_secure_api.c
index 5206c5d..780918e 100644
--- a/secure_fw/partitions/platform/tfm_platform_secure_api.c
+++ b/secure_fw/partitions/platform/tfm_platform_secure_api.c
@@ -11,7 +11,6 @@
#include "psa_manifest/sid.h"
#endif
-__attribute__((section("SFN")))
enum tfm_platform_err_t tfm_platform_system_reset(void)
{
#ifdef TFM_PSA_API
@@ -39,7 +38,6 @@
#endif /* TFM_PSA_API */
}
-__attribute__((section("SFN")))
enum tfm_platform_err_t
tfm_platform_ioctl(tfm_platform_ioctl_req_t request,
psa_invec *input, psa_outvec *output)
@@ -90,7 +88,6 @@
#endif /* TFM_PSA_API */
}
-__attribute__((section("SFN")))
enum tfm_platform_err_t
tfm_platform_nv_counter_increment(uint32_t counter_id)
{
@@ -127,7 +124,6 @@
#endif /* TFM_PSA_API */
}
-__attribute__((section("SFN")))
enum tfm_platform_err_t
tfm_platform_nv_counter_read(uint32_t counter_id,
uint32_t size, uint8_t *val)
diff --git a/secure_fw/partitions/protected_storage/CMakeLists.txt b/secure_fw/partitions/protected_storage/CMakeLists.txt
index b1cb12f..b32422c 100644
--- a/secure_fw/partitions/protected_storage/CMakeLists.txt
+++ b/secure_fw/partitions/protected_storage/CMakeLists.txt
@@ -54,7 +54,7 @@
############################ Secure API ########################################
-target_sources(tfm_secure_api
+target_sources(tfm_sprt
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/tfm_ps_secure_api.c
)
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 6a08e50..e98a2ed 100644
--- a/secure_fw/partitions/protected_storage/tfm_ps_secure_api.c
+++ b/secure_fw/partitions/protected_storage/tfm_ps_secure_api.c
@@ -13,7 +13,6 @@
#define IOVEC_LEN(x) (sizeof(x)/sizeof(x[0]))
-__attribute__((section("SFN")))
psa_status_t psa_ps_set(psa_storage_uid_t uid,
size_t data_length,
const void *p_data,
@@ -57,7 +56,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_ps_get(psa_storage_uid_t uid,
size_t data_offset,
size_t data_size,
@@ -111,7 +109,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_ps_get_info(psa_storage_uid_t uid,
struct psa_storage_info_t *p_info)
{
@@ -150,7 +147,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_ps_remove(psa_storage_uid_t uid)
{
psa_status_t status;
@@ -185,7 +181,6 @@
return status;
}
-__attribute__((section("SFN")))
psa_status_t psa_ps_create(psa_storage_uid_t uid, size_t size,
psa_storage_create_flags_t create_flags)
{
@@ -196,7 +191,6 @@
return PSA_ERROR_NOT_SUPPORTED;
}
-__attribute__((section("SFN")))
psa_status_t psa_ps_set_extended(psa_storage_uid_t uid, size_t data_offset,
size_t data_length, const void *p_data)
{
@@ -208,7 +202,6 @@
return PSA_ERROR_NOT_SUPPORTED;
}
-__attribute__((section("SFN")))
uint32_t psa_ps_get_support(void)
{
/* Initialise support_flags to a sensible default, to avoid returning an
diff --git a/secure_fw/spm/CMakeLists.txt b/secure_fw/spm/CMakeLists.txt
index 5512e57..6eba634 100755
--- a/secure_fw/spm/CMakeLists.txt
+++ b/secure_fw/spm/CMakeLists.txt
@@ -130,12 +130,12 @@
############################ Secure API ########################################
target_link_libraries(tfm_secure_api
- PRIVATE
+ INTERFACE
tfm_partitions
)
target_include_directories(tfm_secure_api
- PUBLIC
+ INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/model_ipc/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/arch/include>