Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 1 | /* |
Marc Moreno Berengue | 675b6e9 | 2018-06-14 17:31:01 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2018, Arm Limited. All rights reserved. |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef __TFM_SST_SVC_HANDLER_H__ |
| 9 | #define __TFM_SST_SVC_HANDLER_H__ |
| 10 | |
| 11 | #ifdef __cplusplus |
| 12 | extern "C" { |
| 13 | #endif |
| 14 | |
| 15 | #include "tfm_sst_defs.h" |
| 16 | |
| 17 | /** |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 18 | * \brief SVC funtion to allocate space for the asset, referenced by asset |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 19 | * UUID, without setting any data in the asset. |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 20 | * |
| 21 | * \param[in] asset_uuid Asset UUID |
| 22 | * |
| 23 | * \return Returns an TFM_SST_ERR_SUCCESS if asset is created correctly. |
| 24 | * Otherwise, error code as specified in \ref tfm_sst_err_t |
| 25 | */ |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 26 | enum tfm_sst_err_t tfm_sst_svc_create(uint32_t asset_uuid); |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 27 | |
| 28 | /** |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 29 | * \brief SVC funtion to get asset's information referenced by asset UUID. |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 30 | * |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 31 | * \param[in] asset_uuid Asset UUID |
| 32 | * \param[out] info Pointer to store the asset's information |
| 33 | * \ref tfm_sst_asset_info_t |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 34 | * |
| 35 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 36 | */ |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 37 | enum tfm_sst_err_t tfm_sst_svc_get_info(uint32_t asset_uuid, |
| 38 | struct tfm_sst_asset_info_t *info); |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 39 | /** |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 40 | * \brief SVC funtion to get asset's attributes referenced by asset UUID. |
Marc Moreno Berengue | 51af951 | 2018-06-14 18:28:14 +0100 | [diff] [blame] | 41 | * |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 42 | * \param[in] asset_uuid Asset UUID |
| 43 | * \param[out] attrs Pointer to store the asset's attributes |
| 44 | * \ref tfm_sst_asset_attrs_t |
Marc Moreno Berengue | 51af951 | 2018-06-14 18:28:14 +0100 | [diff] [blame] | 45 | * |
| 46 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 47 | */ |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 48 | enum tfm_sst_err_t tfm_sst_svc_get_attributes(uint32_t asset_uuid, |
Marc Moreno Berengue | 51af951 | 2018-06-14 18:28:14 +0100 | [diff] [blame] | 49 | struct tfm_sst_asset_attrs_t *attrs); |
| 50 | |
| 51 | /** |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 52 | * \brief SVC funtion to set asset's attributes referenced by asset UUID. |
Marc Moreno Berengue | 51af951 | 2018-06-14 18:28:14 +0100 | [diff] [blame] | 53 | * |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 54 | * \param[in] asset_uuid Asset UUID |
| 55 | * \param[in] attrs Pointer to new the asset's attributes |
| 56 | * \ref tfm_sst_asset_attrs_t |
Marc Moreno Berengue | 51af951 | 2018-06-14 18:28:14 +0100 | [diff] [blame] | 57 | * |
| 58 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 59 | */ |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 60 | enum tfm_sst_err_t tfm_sst_svc_set_attributes(uint32_t asset_uuid, |
Marc Moreno Berengue | 51af951 | 2018-06-14 18:28:14 +0100 | [diff] [blame] | 61 | const struct tfm_sst_asset_attrs_t *attrs); |
| 62 | |
| 63 | /** |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 64 | * \brief SVC funtion to read asset's data from asset referenced by asset UUID. |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 65 | * |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 66 | * \param[in] asset_uuid Asset UUID |
| 67 | * \param[out] data Pointer to data vector \ref tfm_sst_buf_t to store |
| 68 | * data, size and offset |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 69 | * |
| 70 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 71 | */ |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 72 | enum tfm_sst_err_t tfm_sst_svc_read(uint32_t asset_uuid, |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 73 | struct tfm_sst_buf_t* data); |
| 74 | |
| 75 | /** |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 76 | * \brief SVC funtion to write data into an asset referenced by asset UUID. |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 77 | * |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 78 | * \param[in] asset_uuid Asset UUID |
| 79 | * \param[in] data Pointer to data vector \ref tfm_sst_buf_t which |
| 80 | * contains the data to write |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 81 | * |
| 82 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 83 | */ |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 84 | enum tfm_sst_err_t tfm_sst_svc_write(uint32_t asset_uuid, |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 85 | struct tfm_sst_buf_t* data); |
| 86 | |
| 87 | /** |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 88 | * \brief SVC funtion to delete the asset referenced by the asset UUID. |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 89 | * |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 90 | * \param[in] asset_uuid Asset UUID |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 91 | * |
| 92 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 93 | */ |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 94 | enum tfm_sst_err_t tfm_sst_svc_delete(uint32_t asset_uuid); |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 95 | |
| 96 | #ifdef __cplusplus |
| 97 | } |
| 98 | #endif |
| 99 | |
| 100 | #endif /* __TFM_SST_SVC_HANDLER_H__ */ |