blob: a43e54512739cff27ca866f4f81f74d7e6082a68 [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_SVC_HANDLER_H__
9#define __TFM_SST_SVC_HANDLER_H__
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#include "tfm_sst_defs.h"
16
17/**
Ashutosh Singhf4d88672017-11-29 13:35:43 +000018 * \brief SVC funtion to allocate space for the asset, referenced by asset
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010019 * UUID, without setting any data in the asset.
Ashutosh Singhf4d88672017-11-29 13:35:43 +000020 *
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_svc_create(uint32_t asset_uuid);
Ashutosh Singhf4d88672017-11-29 13:35:43 +000027
28/**
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010029 * \brief SVC funtion to get 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_svc_get_info(uint32_t asset_uuid,
38 struct tfm_sst_asset_info_t *info);
Ashutosh Singhf4d88672017-11-29 13:35:43 +000039/**
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010040 * \brief SVC funtion to get asset's attributes referenced by asset UUID.
Marc Moreno Berengue51af9512018-06-14 18:28:14 +010041 *
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010042 * \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 Berengue51af9512018-06-14 18:28:14 +010045 *
46 * \return Returns error code as specified in \ref tfm_sst_err_t
47 */
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010048enum tfm_sst_err_t tfm_sst_svc_get_attributes(uint32_t asset_uuid,
Marc Moreno Berengue51af9512018-06-14 18:28:14 +010049 struct tfm_sst_asset_attrs_t *attrs);
50
51/**
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010052 * \brief SVC funtion to set asset's attributes referenced by asset UUID.
Marc Moreno Berengue51af9512018-06-14 18:28:14 +010053 *
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010054 * \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 Berengue51af9512018-06-14 18:28:14 +010057 *
58 * \return Returns error code as specified in \ref tfm_sst_err_t
59 */
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010060enum tfm_sst_err_t tfm_sst_svc_set_attributes(uint32_t asset_uuid,
Marc Moreno Berengue51af9512018-06-14 18:28:14 +010061 const struct tfm_sst_asset_attrs_t *attrs);
62
63/**
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010064 * \brief SVC funtion to read asset's data from asset referenced by asset UUID.
Ashutosh Singhf4d88672017-11-29 13:35:43 +000065 *
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010066 * \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 Singhf4d88672017-11-29 13:35:43 +000069 *
70 * \return Returns error code as specified in \ref tfm_sst_err_t
71 */
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010072enum tfm_sst_err_t tfm_sst_svc_read(uint32_t asset_uuid,
Ashutosh Singhf4d88672017-11-29 13:35:43 +000073 struct tfm_sst_buf_t* data);
74
75/**
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010076 * \brief SVC funtion to write data into an asset referenced by asset UUID.
Ashutosh Singhf4d88672017-11-29 13:35:43 +000077 *
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010078 * \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 Singhf4d88672017-11-29 13:35:43 +000081 *
82 * \return Returns error code as specified in \ref tfm_sst_err_t
83 */
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010084enum tfm_sst_err_t tfm_sst_svc_write(uint32_t asset_uuid,
Ashutosh Singhf4d88672017-11-29 13:35:43 +000085 struct tfm_sst_buf_t* data);
86
87/**
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010088 * \brief SVC funtion to delete the asset referenced by the asset UUID.
Ashutosh Singhf4d88672017-11-29 13:35:43 +000089 *
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010090 * \param[in] asset_uuid Asset UUID
Ashutosh Singhf4d88672017-11-29 13:35:43 +000091 *
92 * \return Returns error code as specified in \ref tfm_sst_err_t
93 */
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010094enum tfm_sst_err_t tfm_sst_svc_delete(uint32_t asset_uuid);
Ashutosh Singhf4d88672017-11-29 13:35:43 +000095
96#ifdef __cplusplus
97}
98#endif
99
100#endif /* __TFM_SST_SVC_HANDLER_H__ */