Interface: Refactor the NS interface
This patch refactors the NS interface source code
to provide an easier paradigm for integration by
marking the NS interface function as weak in order
for integrators to provide their own implementation
to fulfill their requirements.
Change-Id: Id8231cf91773d6850149a028e1b639432540efa0
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
diff --git a/interface/src/tfm_sst_api.c b/interface/src/tfm_sst_api.c
index af06424..2722c67 100644
--- a/interface/src/tfm_sst_api.c
+++ b/interface/src/tfm_sst_api.c
@@ -7,7 +7,7 @@
#include "psa/protected_storage.h"
-#include "tfm_ns_lock.h"
+#include "tfm_ns_interface.h"
#include "tfm_veneers.h"
#ifdef TFM_PSA_API
#include "psa_manifest/sid.h"
@@ -53,7 +53,8 @@
return PSA_PS_ERROR_OPERATION_FAILED;
}
#else
- status = tfm_ns_lock_dispatch((veneer_fn)tfm_tfm_sst_set_req_veneer,
+ status = tfm_ns_interface_dispatch(
+ (veneer_fn)tfm_tfm_sst_set_req_veneer,
(uint32_t)in_vec, IOVEC_LEN(in_vec),
(uint32_t)out_vec, IOVEC_LEN(out_vec));
if (status != PSA_SUCCESS) {
@@ -100,7 +101,8 @@
return PSA_PS_ERROR_OPERATION_FAILED;
}
#else
- status = tfm_ns_lock_dispatch((veneer_fn)tfm_tfm_sst_get_req_veneer,
+ status = tfm_ns_interface_dispatch(
+ (veneer_fn)tfm_tfm_sst_get_req_veneer,
(uint32_t)in_vec, IOVEC_LEN(in_vec),
(uint32_t)out_vec, IOVEC_LEN(out_vec));
@@ -144,7 +146,8 @@
return PSA_PS_ERROR_OPERATION_FAILED;
}
#else
- status = tfm_ns_lock_dispatch((veneer_fn)tfm_tfm_sst_get_info_req_veneer,
+ status = tfm_ns_interface_dispatch(
+ (veneer_fn)tfm_tfm_sst_get_info_req_veneer,
(uint32_t)in_vec, IOVEC_LEN(in_vec),
(uint32_t)out_vec, IOVEC_LEN(out_vec));
@@ -187,7 +190,8 @@
return PSA_PS_ERROR_OPERATION_FAILED;
}
#else
- status = tfm_ns_lock_dispatch((veneer_fn)tfm_tfm_sst_remove_req_veneer,
+ status = tfm_ns_interface_dispatch(
+ (veneer_fn)tfm_tfm_sst_remove_req_veneer,
(uint32_t)in_vec, IOVEC_LEN(in_vec),
(uint32_t)out_vec, IOVEC_LEN(out_vec));
@@ -247,7 +251,8 @@
psa_close(handle);
#else
- (void)tfm_ns_lock_dispatch((veneer_fn)tfm_tfm_sst_get_support_req_veneer,
+ (void)tfm_ns_interface_dispatch(
+ (veneer_fn)tfm_tfm_sst_get_support_req_veneer,
(uint32_t)NULL, 0,
(uint32_t)out_vec, IOVEC_LEN(out_vec));
#endif