App, Test: Updates for thread mode NS-S transition
- Remove the SVC call framework from the non-secure
- Update the S and NS tests to work with the new concept
- Update documentation to reflect changes
Change-Id: Iac4e1b7d11f264f1905e71a81a1d622421ea5d6d
Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
diff --git a/interface/src/tfm_sst_api.c b/interface/src/tfm_sst_api.c
index d9947b4..8a3fec8 100644
--- a/interface/src/tfm_sst_api.c
+++ b/interface/src/tfm_sst_api.c
@@ -5,23 +5,28 @@
*
*/
+#include "tfm_sst_veneers.h"
#include "tfm_sst_defs.h"
#include "tfm_ns_lock.h"
+#include "tfm_id_mngr.h"
enum psa_sst_err_t psa_sst_create(uint32_t asset_uuid, const uint8_t *token,
uint32_t token_size)
{
struct tfm_sst_token_t s_token;
+ int32_t client_id;
/* Pack the token information in the token structure */
s_token.token = token;
s_token.token_size = token_size;
- return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_CREATE,
- asset_uuid,
- (uint32_t)&s_token,
- 0,
- 0);
+ client_id = tfm_sst_get_cur_id();
+
+ return tfm_ns_lock_dispatch((veneer_fn)tfm_sst_veneer_create,
+ client_id,
+ asset_uuid,
+ (uint32_t)&s_token,
+ 0);
}
enum psa_sst_err_t psa_sst_get_info(uint32_t asset_uuid,
@@ -30,16 +35,19 @@
struct psa_sst_asset_info_t *info)
{
struct tfm_sst_token_t s_token;
+ int32_t client_id;
/* Pack the token information in the token structure */
s_token.token = token;
s_token.token_size = token_size;
- return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_GET_INFO,
- asset_uuid,
- (uint32_t)&s_token,
- (uint32_t)info,
- 0);
+ client_id = tfm_sst_get_cur_id();
+
+ return tfm_ns_lock_dispatch((veneer_fn)tfm_sst_veneer_get_info,
+ client_id,
+ asset_uuid,
+ (uint32_t)&s_token,
+ (uint32_t)info);
}
enum psa_sst_err_t psa_sst_get_attributes(uint32_t asset_uuid,
@@ -48,16 +56,19 @@
struct psa_sst_asset_attrs_t *attrs)
{
struct tfm_sst_token_t s_token;
+ int32_t client_id;
/* Pack the token information in the token structure */
s_token.token = token;
s_token.token_size = token_size;
- return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_GET_ATTRIBUTES,
- asset_uuid,
- (uint32_t)&s_token,
- (uint32_t)attrs,
- 0);
+ client_id = tfm_sst_get_cur_id();
+
+ return tfm_ns_lock_dispatch((veneer_fn)tfm_sst_veneer_get_attributes,
+ client_id,
+ asset_uuid,
+ (uint32_t)&s_token,
+ (uint32_t)attrs);
}
enum psa_sst_err_t psa_sst_set_attributes(uint32_t asset_uuid,
@@ -66,16 +77,19 @@
const struct psa_sst_asset_attrs_t *attrs)
{
struct tfm_sst_token_t s_token;
+ int32_t client_id;
/* Pack the token information in the token structure */
s_token.token = token;
s_token.token_size = token_size;
- return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_SET_ATTRIBUTES,
- asset_uuid,
- (uint32_t)&s_token,
- (uint32_t)attrs,
- 0);
+ client_id = tfm_sst_get_cur_id();
+
+ return tfm_ns_lock_dispatch((veneer_fn)tfm_sst_veneer_set_attributes,
+ client_id,
+ asset_uuid,
+ (uint32_t)&s_token,
+ (uint32_t)attrs);
}
enum psa_sst_err_t psa_sst_read(uint32_t asset_uuid,
@@ -87,6 +101,7 @@
{
struct tfm_sst_token_t s_token;
struct tfm_sst_buf_t s_data;
+ int32_t client_id;
/* Pack the token information in the token structure */
s_token.token = token;
@@ -97,11 +112,13 @@
s_data.offset = offset;
s_data.data = data;
- return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_READ,
- asset_uuid,
- (uint32_t)&s_token,
- (uint32_t)&s_data,
- 0);
+ client_id = tfm_sst_get_cur_id();
+
+ return tfm_ns_lock_dispatch((veneer_fn)tfm_sst_veneer_read,
+ client_id,
+ asset_uuid,
+ (uint32_t)&s_token,
+ (uint32_t)&s_data);
}
enum psa_sst_err_t psa_sst_write(uint32_t asset_uuid,
@@ -113,6 +130,7 @@
{
struct tfm_sst_token_t s_token;
struct tfm_sst_buf_t s_data;
+ int32_t client_id;
/* Pack the token information in the token structure */
s_token.token = token;
@@ -123,11 +141,13 @@
s_data.offset = offset;
s_data.data = (uint8_t *)data;
- return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_WRITE,
- asset_uuid,
- (uint32_t)&s_token,
- (uint32_t)&s_data,
- 0);
+ client_id = tfm_sst_get_cur_id();
+
+ return tfm_ns_lock_dispatch((veneer_fn)tfm_sst_veneer_write,
+ client_id,
+ asset_uuid,
+ (uint32_t)&s_token,
+ (uint32_t)&s_data);
}
enum psa_sst_err_t psa_sst_delete(uint32_t asset_uuid,
@@ -135,14 +155,17 @@
uint32_t token_size)
{
struct tfm_sst_token_t s_token;
+ int32_t client_id;
/* Pack the token information in the token structure */
s_token.token = token;
s_token.token_size = token_size;
- return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_DELETE,
- asset_uuid,
- (uint32_t)&s_token,
- 0,
- 0);
+ client_id = tfm_sst_get_cur_id();
+
+ return tfm_ns_lock_dispatch((veneer_fn)tfm_sst_veneer_delete,
+ client_id,
+ asset_uuid,
+ (uint32_t)&s_token,
+ 0);
}