SST: Rename get_attributes APIs to get_info
This patch renames get_attributes functions to get_info, and updates
the SST code as follows:
- rename tfm_sst_attribs_t to tfm_sst_asset_info_t
- rename sst_asset_infoi_t to sst_asset_policy_t in
sst_asset_management
- add sst_core_obj_info_t in sst_core
- update sst service APIs and code to accomodate it to the new types
and type names
- update dependant tests to accomodate them to the new names
Change-Id: Ifa0e56c3c15c7de40d6af4aa3f96c8bd7eae85f2
Signed-off-by: Marc Moreno <marc.morenoberengue@arm.com>
diff --git a/interface/include/tfm_ns_svc.h b/interface/include/tfm_ns_svc.h
index 178e75c..28c7589 100644
--- a/interface/include/tfm_ns_svc.h
+++ b/interface/include/tfm_ns_svc.h
@@ -43,7 +43,7 @@
#define LIST_SVC_DISPATCHERS \
X(SVC_TFM_SST_GET_HANDLE, tfm_sst_svc_get_handle) \
X(SVC_TFM_SST_CREATE, tfm_sst_svc_create) \
- X(SVC_TFM_SST_GET_ATTRIBUTES, tfm_sst_svc_get_attributes) \
+ X(SVC_TFM_SST_GET_INFO, tfm_sst_svc_get_info) \
X(SVC_TFM_SST_READ, tfm_sst_svc_read) \
X(SVC_TFM_SST_WRITE, tfm_sst_svc_write) \
X(SVC_TFM_SST_DELETE, tfm_sst_svc_delete) \
diff --git a/interface/include/tfm_sst_api.h b/interface/include/tfm_sst_api.h
index 66865ac..d22653c 100644
--- a/interface/include/tfm_sst_api.h
+++ b/interface/include/tfm_sst_api.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 - 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2018, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -40,16 +40,16 @@
enum tfm_sst_err_t tfm_sst_create(uint16_t asset_uuid);
/**
- * \brief Gets asset's attributes referenced by asset handler.
- * Uses cached metadata to return the size and write offset of an asset.
+ * \brief Gets asset's information referenced by asset handler.
*
* \param[in] asset_handle Asset handler
- * \param[out] attrib_struct Pointer to store the asset's attribute
+ * \param[out] info Pointer to store the asset's information
+ * \ref tfm_sst_asset_info_t
*
* \return Returns error code as specified in \ref tfm_sst_err_t
*/
-enum tfm_sst_err_t tfm_sst_get_attributes(uint32_t asset_handle,
- struct tfm_sst_attribs_t* attrib_struct);
+enum tfm_sst_err_t tfm_sst_get_info(uint32_t asset_handle,
+ struct tfm_sst_asset_info_t *info);
/**
* \brief Reads asset's data from asset referenced by asset handler.
diff --git a/interface/include/tfm_sst_defs.h b/interface/include/tfm_sst_defs.h
index e3b3112..83ac62d 100644
--- a/interface/include/tfm_sst_defs.h
+++ b/interface/include/tfm_sst_defs.h
@@ -52,18 +52,32 @@
TFM_SST_ERR_FORCE_INT_SIZE = INT_MAX
};
-struct tfm_sst_attribs_t {
- uint32_t size_current; /*!< The current size of the asset */
- uint32_t size_max; /*!< The maximum size of the asset in bytes */
+/*!
+ * \struct tfm_sst_asset_info_t
+ *
+ * \brief Structure to store the asset information concerning the content
+ * information.
+ *
+ */
+struct tfm_sst_asset_info_t {
+ uint32_t size_current; /*!< The current size of the asset data */
+ uint32_t size_max; /*!< The maximum size of the asset data in bytes */
};
-/* Structure to store data information to read/write from/to asset */
+/*!
+ * \struct tfm_sst_buf_t
+ *
+ * \brief Structure to store data information to read/write from/to asset.
+ *
+ */
struct tfm_sst_buf_t {
- uint8_t* data; /*!< Address of input/output data */
+ uint8_t *data; /*!< Address of input/output data */
uint32_t size; /*!< Size of input/output data */
uint32_t offset; /*!< Offset within asset */
};
+#define TFM_SST_ASSET_INFO_SIZE sizeof(struct tfm_sst_asset_info_t)
+
#ifdef __cplusplus
}
#endif
diff --git a/interface/include/tfm_sst_svc_handler.h b/interface/include/tfm_sst_svc_handler.h
index 808c0ea..b983869 100644
--- a/interface/include/tfm_sst_svc_handler.h
+++ b/interface/include/tfm_sst_svc_handler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2018, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -40,16 +40,16 @@
enum tfm_sst_err_t tfm_sst_svc_create(uint16_t asset_uuid);
/**
- * \brief SVC funtion to get asset's attributes referenced by asset handler.
- * Uses cached metadata to return the size and write offset of an asset.
+ * \brief SVC funtion to get asset's information referenced by asset handler.
*
* \param[in] asset_handle Asset handler
- * \param[out] attrib_struct Pointer to store asset's attribute
+ * \param[out] info Pointer to store the asset's information
+ * \ref tfm_sst_asset_info_t
*
* \return Returns error code as specified in \ref tfm_sst_err_t
*/
-enum tfm_sst_err_t tfm_sst_svc_get_attributes(uint32_t asset_handle,
- struct tfm_sst_attribs_t* attrib_struct);
+enum tfm_sst_err_t tfm_sst_svc_get_info(uint32_t asset_handle,
+ struct tfm_sst_asset_info_t *info);
/**
* \brief SVC funtion to read asset's data from asset referenced by asset
diff --git a/interface/include/tfm_sst_veneers.h b/interface/include/tfm_sst_veneers.h
index db11d4e..b76abbf 100644
--- a/interface/include/tfm_sst_veneers.h
+++ b/interface/include/tfm_sst_veneers.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 - 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2018, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -45,19 +45,19 @@
enum tfm_sst_err_t tfm_sst_veneer_create(uint32_t app_id, uint16_t asset_uuid);
/**
- * \brief Gets asset's attributes referenced by asset handler.
- * Uses cached metadata to return the size and write offset of an asset.
+ * \brief Gets asset's information referenced by asset handler.
*
- * \param[in] app_id Application ID
- * \param[in] asset_handle Asset handler
- * \param[out] attrib_struct Pointer to asset attribute struct
+ * \param[in] app_id Application ID
+ * \param[in] asset_handle Asset handler
+ * \param[out] info Pointer to store the asset's information
+ * \ref tfm_sst_asset_info_t
*
* \return Returns error code as specified in \ref tfm_sst_err_t
*/
-enum tfm_sst_err_t tfm_sst_veneer_get_attributes(
- uint32_t app_id,
- uint32_t asset_handle,
- struct tfm_sst_attribs_t *attrib_struct);
+enum tfm_sst_err_t tfm_sst_veneer_get_info(uint32_t app_id,
+ uint32_t asset_handle,
+ struct tfm_sst_asset_info_t *info);
+
/**
* \brief Reads asset's data from asset referenced by asset handler.
*
diff --git a/interface/src/tfm_sst_api.c b/interface/src/tfm_sst_api.c
index fb13ed0..99d9d38 100644
--- a/interface/src/tfm_sst_api.c
+++ b/interface/src/tfm_sst_api.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2018, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -26,12 +26,12 @@
0);
}
-enum tfm_sst_err_t tfm_sst_get_attributes(uint32_t asset_handle,
- struct tfm_sst_attribs_t* attrib_struct)
+enum tfm_sst_err_t tfm_sst_get_info(uint32_t asset_handle,
+ struct tfm_sst_asset_info_t *info)
{
- return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_GET_ATTRIBUTES,
- (uint32_t)asset_handle,
- (uint32_t)attrib_struct,
+ return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_GET_INFO,
+ asset_handle,
+ (uint32_t)info,
0,
0);
}
diff --git a/interface/src/tfm_sst_svc_handler.c b/interface/src/tfm_sst_svc_handler.c
index c10432e..31ca9bd 100644
--- a/interface/src/tfm_sst_svc_handler.c
+++ b/interface/src/tfm_sst_svc_handler.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2018, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -30,14 +30,14 @@
return tfm_sst_veneer_create(app_id, asset_uuid);
}
-enum tfm_sst_err_t tfm_sst_svc_get_attributes(uint32_t asset_handle,
- struct tfm_sst_attribs_t* attrib_struct)
+enum tfm_sst_err_t tfm_sst_svc_get_info(uint32_t asset_handle,
+ struct tfm_sst_asset_info_t *info)
{
uint32_t app_id;
app_id = tfm_sst_get_cur_id();
- return tfm_sst_veneer_get_attributes(app_id, asset_handle, attrib_struct);
+ return tfm_sst_veneer_get_info(app_id, asset_handle, info);
}
enum tfm_sst_err_t tfm_sst_svc_read(uint32_t asset_handle,