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);