blob: 8447bd47250ab179027fed0504ce8ca9f7b5a2c0 [file] [log] [blame]
Ashutosh Singhf4d88672017-11-29 13:35:43 +00001/*
Marc Moreno Berengue675b6e92018-06-14 17:31:01 +01002 * Copyright (c) 2017-2018, Arm Limited. All rights reserved.
Ashutosh Singhf4d88672017-11-29 13:35:43 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef __TFM_SST_API__
9#define __TFM_SST_API__
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
Antonio de Angeliseba14e12018-03-27 11:03:20 +010015#include "tfm_sst_defs.h"
16
Ashutosh Singhf4d88672017-11-29 13:35:43 +000017/**
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010018 * \brief Allocates space for the asset, referenced by asset UUID,
Ashutosh Singhf4d88672017-11-29 13:35:43 +000019 * without setting any data in the asset.
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 Berengue4258e542018-06-18 13:55:59 +010026enum tfm_sst_err_t tfm_sst_create(uint32_t asset_uuid);
Ashutosh Singhf4d88672017-11-29 13:35:43 +000027
28/**
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010029 * \brief Gets asset's information referenced by asset UUID.
Ashutosh Singhf4d88672017-11-29 13:35:43 +000030 *
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010031 * \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 Singhf4d88672017-11-29 13:35:43 +000034 *
35 * \return Returns error code as specified in \ref tfm_sst_err_t
36 */
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010037enum tfm_sst_err_t tfm_sst_get_info(uint32_t asset_uuid,
Marc Moreno Berengue675b6e92018-06-14 17:31:01 +010038 struct tfm_sst_asset_info_t *info);
Ashutosh Singhf4d88672017-11-29 13:35:43 +000039
40/**
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010041 * \brief Gets asset's attributes referenced by asset UUID.
Marc Moreno Berengue51af9512018-06-14 18:28:14 +010042 *
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010043 * \param[in] asset_uuid Asset UUID
44 * \param[out] attrs Pointer to store the asset's attributes
45 * \ref tfm_sst_asset_attrs_t
Marc Moreno Berengue51af9512018-06-14 18:28:14 +010046 *
47 * \return Returns error code as specified in \ref tfm_sst_err_t
48 */
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010049enum tfm_sst_err_t tfm_sst_get_attributes(uint32_t asset_uuid,
Marc Moreno Berengue51af9512018-06-14 18:28:14 +010050 struct tfm_sst_asset_attrs_t *attrs);
51
52/**
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010053 * \brief Sets asset's attributes referenced by asset UUID.
Marc Moreno Berengue51af9512018-06-14 18:28:14 +010054 *
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010055 * \param[in] asset_uuid Asset UUID
56 * \param[in] attrs Pointer to new the asset's attributes
57 * \ref tfm_sst_asset_attrs_t
Marc Moreno Berengue51af9512018-06-14 18:28:14 +010058 *
59 * \return Returns error code as specified in \ref tfm_sst_err_t
60 */
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010061enum tfm_sst_err_t tfm_sst_set_attributes(
62 uint32_t asset_uuid,
Marc Moreno Berengue51af9512018-06-14 18:28:14 +010063 const struct tfm_sst_asset_attrs_t *attrs);
64
65/**
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010066 * \brief Reads asset's data from asset referenced by asset UUID.
Ashutosh Singhf4d88672017-11-29 13:35:43 +000067 *
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010068 * \param[in] asset_uuid Asset UUID
69 * \param[out] data Pointer to data vector \ref tfm_sst_buf_t to store
70 * data, size and offset
Ashutosh Singhf4d88672017-11-29 13:35:43 +000071 *
72 * \return Returns error code as specified in \ref tfm_sst_err_t
73 */
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010074enum tfm_sst_err_t tfm_sst_read(uint32_t asset_uuid,
Ashutosh Singhf4d88672017-11-29 13:35:43 +000075 struct tfm_sst_buf_t* data);
76
77/**
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010078 * \brief Writes data into an asset referenced by asset UUID.
Ashutosh Singhf4d88672017-11-29 13:35:43 +000079 *
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010080 * \param[in] asset_uuid Asset UUID
81 * \param[in] data Pointer to data vector \ref tfm_sst_buf_t which
82 * contains the data to write
Ashutosh Singhf4d88672017-11-29 13:35:43 +000083 *
84 * \return Returns error code as specified in \ref tfm_sst_err_t
85 */
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010086enum tfm_sst_err_t tfm_sst_write(uint32_t asset_uuid,
Ashutosh Singhf4d88672017-11-29 13:35:43 +000087 struct tfm_sst_buf_t* data);
88
89/**
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010090 * \brief Deletes the asset referenced by the asset UUID.
Ashutosh Singhf4d88672017-11-29 13:35:43 +000091 *
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010092 * \param[in] asset_uuid Asset UUID
Ashutosh Singhf4d88672017-11-29 13:35:43 +000093 *
94 * \return Returns error code as specified in \ref tfm_sst_err_t
95 */
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010096enum tfm_sst_err_t tfm_sst_delete(uint32_t asset_uuid);
Ashutosh Singhf4d88672017-11-29 13:35:43 +000097
98#ifdef __cplusplus
99}
100#endif
101
102#endif /* __TFM_SST_API__ */