SST: Use asset ID instead of handle in all APIs
This patch updates the SST interfaces to:
- use asset ID instead of asset handle as the object is always
close at the end of each request
- change the asset ID type from uint16_t to uint32_t to allow
longer asset IDs which can contain vendor specific ID codes
- remove tfm_sst_get_handle API
- updates all files which depend on these APIs and
their documentation
Change-Id: I4a844e548cc7cdfe2277b007717003a0263e45d1
Signed-off-by: Marc Moreno <marc.morenoberengue@arm.com>
diff --git a/interface/src/tfm_sst_api.c b/interface/src/tfm_sst_api.c
index 1b9a8f2..d363c0a 100644
--- a/interface/src/tfm_sst_api.c
+++ b/interface/src/tfm_sst_api.c
@@ -8,77 +8,69 @@
#include "tfm_sst_defs.h"
#include "tfm_ns_lock.h"
-enum tfm_sst_err_t tfm_sst_get_handle(uint16_t asset_uuid, uint32_t* hdl)
-{
- return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_GET_HANDLE,
- (uint32_t)asset_uuid,
- (uint32_t)hdl,
- 0,
- 0);
-}
-
-enum tfm_sst_err_t tfm_sst_create(uint16_t asset_uuid)
+enum tfm_sst_err_t tfm_sst_create(uint32_t asset_uuid)
{
return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_CREATE,
- (uint32_t) asset_uuid,
+ asset_uuid,
0,
0,
0);
}
-enum tfm_sst_err_t tfm_sst_get_info(uint32_t asset_handle,
+enum tfm_sst_err_t tfm_sst_get_info(uint32_t asset_uuid,
struct tfm_sst_asset_info_t *info)
{
return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_GET_INFO,
- asset_handle,
+ asset_uuid,
(uint32_t)info,
0,
0);
}
-enum tfm_sst_err_t tfm_sst_get_attributes(uint32_t asset_handle,
+enum tfm_sst_err_t tfm_sst_get_attributes(uint32_t asset_uuid,
struct tfm_sst_asset_attrs_t *attrs)
{
return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_GET_ATTRIBUTES,
- asset_handle,
+ asset_uuid,
(uint32_t)attrs,
0,
0);
}
-enum tfm_sst_err_t tfm_sst_set_attributes(
- uint32_t asset_handle,
+enum tfm_sst_err_t tfm_sst_set_attributes(uint32_t asset_uuid,
const struct tfm_sst_asset_attrs_t *attrs)
{
return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_SET_ATTRIBUTES,
- asset_handle,
+ asset_uuid,
(uint32_t)attrs,
0,
0);
}
-enum tfm_sst_err_t tfm_sst_read(uint32_t asset_handle, struct tfm_sst_buf_t* data)
+enum tfm_sst_err_t tfm_sst_read(uint32_t asset_uuid,
+ struct tfm_sst_buf_t* data)
{
return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_READ,
- (uint32_t)asset_handle,
+ asset_uuid,
(uint32_t)data,
0,
0);
}
-enum tfm_sst_err_t tfm_sst_write(uint32_t asset_handle, struct tfm_sst_buf_t* data)
+enum tfm_sst_err_t tfm_sst_write(uint32_t asset_uuid,
+ struct tfm_sst_buf_t* data)
{
return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_WRITE,
- (uint32_t)asset_handle,
+ asset_uuid,
(uint32_t)data,
0,
0);
}
-enum tfm_sst_err_t tfm_sst_delete(uint32_t asset_handle)
+enum tfm_sst_err_t tfm_sst_delete(uint32_t asset_uuid)
{
return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_DELETE,
- (uint32_t)asset_handle,
+ asset_uuid,
0,
0,
0);
diff --git a/interface/src/tfm_sst_svc_handler.c b/interface/src/tfm_sst_svc_handler.c
index 76c5c96..beab20d 100644
--- a/interface/src/tfm_sst_svc_handler.c
+++ b/interface/src/tfm_sst_svc_handler.c
@@ -11,17 +11,7 @@
#include "tfm_id_mngr.h"
/* SVC function implementations */
-enum tfm_sst_err_t tfm_sst_svc_get_handle(uint16_t asset_uuid,
- uint32_t* hdl)
-{
- uint32_t app_id;
-
- app_id = tfm_sst_get_cur_id();
-
- return tfm_sst_veneer_get_handle(app_id, asset_uuid, hdl);
-}
-
-enum tfm_sst_err_t tfm_sst_svc_create(uint16_t asset_uuid)
+enum tfm_sst_err_t tfm_sst_svc_create(uint32_t asset_uuid)
{
uint32_t app_id;
@@ -30,63 +20,61 @@
return tfm_sst_veneer_create(app_id, asset_uuid);
}
-enum tfm_sst_err_t tfm_sst_svc_get_info(uint32_t asset_handle,
+enum tfm_sst_err_t tfm_sst_svc_get_info(uint32_t asset_uuid,
struct tfm_sst_asset_info_t *info)
{
uint32_t app_id;
app_id = tfm_sst_get_cur_id();
- return tfm_sst_veneer_get_info(app_id, asset_handle, info);
+ return tfm_sst_veneer_get_info(app_id, asset_uuid, info);
}
-enum tfm_sst_err_t tfm_sst_svc_get_attributes(
- uint32_t asset_handle,
+enum tfm_sst_err_t tfm_sst_svc_get_attributes(uint32_t asset_uuid,
struct tfm_sst_asset_attrs_t *attrs)
{
uint32_t app_id;
app_id = tfm_sst_get_cur_id();
- return tfm_sst_veneer_get_attributes(app_id, asset_handle, attrs);
+ return tfm_sst_veneer_get_attributes(app_id, asset_uuid, attrs);
}
-enum tfm_sst_err_t tfm_sst_svc_set_attributes(
- uint32_t asset_handle,
+enum tfm_sst_err_t tfm_sst_svc_set_attributes(uint32_t asset_uuid,
const struct tfm_sst_asset_attrs_t *attrs)
{
uint32_t app_id;
app_id = tfm_sst_get_cur_id();
- return tfm_sst_veneer_set_attributes(app_id, asset_handle, attrs);
+ return tfm_sst_veneer_set_attributes(app_id, asset_uuid, attrs);
}
-enum tfm_sst_err_t tfm_sst_svc_read(uint32_t asset_handle,
+enum tfm_sst_err_t tfm_sst_svc_read(uint32_t asset_uuid,
struct tfm_sst_buf_t* data)
{
uint32_t app_id;
app_id = tfm_sst_get_cur_id();
- return tfm_sst_veneer_read(app_id, asset_handle, data);
+ return tfm_sst_veneer_read(app_id, asset_uuid, data);
}
-enum tfm_sst_err_t tfm_sst_svc_write(uint32_t asset_handle,
+enum tfm_sst_err_t tfm_sst_svc_write(uint32_t asset_uuid,
struct tfm_sst_buf_t* data)
{
uint32_t app_id;
app_id = tfm_sst_get_cur_id();
- return tfm_sst_veneer_write(app_id, asset_handle, data);
+ return tfm_sst_veneer_write(app_id, asset_uuid, data);
}
-enum tfm_sst_err_t tfm_sst_svc_delete(uint32_t asset_handle)
+enum tfm_sst_err_t tfm_sst_svc_delete(uint32_t asset_uuid)
{
uint32_t app_id;
app_id = tfm_sst_get_cur_id();
- return tfm_sst_veneer_delete(app_id, asset_handle);
+ return tfm_sst_veneer_delete(app_id, asset_uuid);
}