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 | /** |
| 18 | * \brief SVC funtion to get handler for the given asset UUID. If an asset is |
| 19 | * deleted, the linked asset handle reference is no longer valid and |
| 20 | * will give TFM_SST_ERR_ASSET_REF_INVALID if used. |
| 21 | * |
| 22 | * \param[in] asset_uuid Asset UUID |
| 23 | * \param[out] hdl Pointer to store the asset's handler |
| 24 | * |
| 25 | * \return Returns TFM_SST_ERR_SUCCESS if asset is found. Otherwise, error code |
| 26 | * as specified in \ref tfm_sst_err_t |
| 27 | */ |
| 28 | enum tfm_sst_err_t tfm_sst_svc_get_handle(uint16_t asset_uuid, |
| 29 | uint32_t* hdl); |
| 30 | |
| 31 | /** |
| 32 | * \brief SVC funtion to allocate space for the asset, referenced by asset |
| 33 | * handler, without setting any data in the asset. |
| 34 | * |
| 35 | * \param[in] asset_uuid Asset UUID |
| 36 | * |
| 37 | * \return Returns an TFM_SST_ERR_SUCCESS if asset is created correctly. |
| 38 | * Otherwise, error code as specified in \ref tfm_sst_err_t |
| 39 | */ |
| 40 | enum tfm_sst_err_t tfm_sst_svc_create(uint16_t asset_uuid); |
| 41 | |
| 42 | /** |
Marc Moreno Berengue | 675b6e9 | 2018-06-14 17:31:01 +0100 | [diff] [blame^] | 43 | * \brief SVC funtion to get asset's information referenced by asset handler. |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 44 | * |
| 45 | * \param[in] asset_handle Asset handler |
Marc Moreno Berengue | 675b6e9 | 2018-06-14 17:31:01 +0100 | [diff] [blame^] | 46 | * \param[out] info Pointer to store the asset's information |
| 47 | * \ref tfm_sst_asset_info_t |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 48 | * |
| 49 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 50 | */ |
Marc Moreno Berengue | 675b6e9 | 2018-06-14 17:31:01 +0100 | [diff] [blame^] | 51 | enum tfm_sst_err_t tfm_sst_svc_get_info(uint32_t asset_handle, |
| 52 | struct tfm_sst_asset_info_t *info); |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 53 | |
| 54 | /** |
| 55 | * \brief SVC funtion to read asset's data from asset referenced by asset |
| 56 | * handler. |
| 57 | * |
| 58 | * \param[in] asset_handle Asset handler |
| 59 | * \param[out] data Pointer to data vector \ref tfm_sst_buf_t to store |
| 60 | * data, size and offset |
| 61 | * |
| 62 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 63 | */ |
| 64 | enum tfm_sst_err_t tfm_sst_svc_read(uint32_t asset_handle, |
| 65 | struct tfm_sst_buf_t* data); |
| 66 | |
| 67 | /** |
| 68 | * \brief SVC funtion to write data into an asset referenced by asset handler. |
| 69 | * |
| 70 | * \param[in] asset_handle Asset handler |
| 71 | * \param[in] data Pointer to data vector \ref tfm_sst_buf_t which |
| 72 | * contains the data to write |
| 73 | * |
| 74 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 75 | */ |
| 76 | enum tfm_sst_err_t tfm_sst_svc_write(uint32_t asset_handle, |
| 77 | struct tfm_sst_buf_t* data); |
| 78 | |
| 79 | /** |
| 80 | * \brief SVC funtion to delete the asset referenced by the asset handler. |
| 81 | * |
| 82 | * \param[in] asset_handle Asset handler |
| 83 | * |
| 84 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 85 | */ |
| 86 | enum tfm_sst_err_t tfm_sst_svc_delete(uint32_t asset_handle); |
| 87 | |
| 88 | #ifdef __cplusplus |
| 89 | } |
| 90 | #endif |
| 91 | |
| 92 | #endif /* __TFM_SST_SVC_HANDLER_H__ */ |