blob: d363c0a54ac1881e3d6d5e79376377d957b64e13 [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#include "tfm_sst_defs.h"
9#include "tfm_ns_lock.h"
10
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010011enum tfm_sst_err_t tfm_sst_create(uint32_t asset_uuid)
Ashutosh Singhf4d88672017-11-29 13:35:43 +000012{
13 return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_CREATE,
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010014 asset_uuid,
Ashutosh Singhf4d88672017-11-29 13:35:43 +000015 0,
16 0,
17 0);
18}
19
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010020enum tfm_sst_err_t tfm_sst_get_info(uint32_t asset_uuid,
Marc Moreno Berengue675b6e92018-06-14 17:31:01 +010021 struct tfm_sst_asset_info_t *info)
Ashutosh Singhf4d88672017-11-29 13:35:43 +000022{
Marc Moreno Berengue675b6e92018-06-14 17:31:01 +010023 return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_GET_INFO,
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010024 asset_uuid,
Marc Moreno Berengue675b6e92018-06-14 17:31:01 +010025 (uint32_t)info,
Ashutosh Singhf4d88672017-11-29 13:35:43 +000026 0,
27 0);
28}
29
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010030enum tfm_sst_err_t tfm_sst_get_attributes(uint32_t asset_uuid,
Marc Moreno Berengue51af9512018-06-14 18:28:14 +010031 struct tfm_sst_asset_attrs_t *attrs)
32{
33 return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_GET_ATTRIBUTES,
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010034 asset_uuid,
Marc Moreno Berengue51af9512018-06-14 18:28:14 +010035 (uint32_t)attrs,
36 0,
37 0);
38}
39
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010040enum tfm_sst_err_t tfm_sst_set_attributes(uint32_t asset_uuid,
Marc Moreno Berengue51af9512018-06-14 18:28:14 +010041 const struct tfm_sst_asset_attrs_t *attrs)
42{
43 return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_SET_ATTRIBUTES,
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010044 asset_uuid,
Marc Moreno Berengue51af9512018-06-14 18:28:14 +010045 (uint32_t)attrs,
46 0,
47 0);
48}
49
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010050enum tfm_sst_err_t tfm_sst_read(uint32_t asset_uuid,
51 struct tfm_sst_buf_t* data)
Ashutosh Singhf4d88672017-11-29 13:35:43 +000052{
53 return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_READ,
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010054 asset_uuid,
Ashutosh Singhf4d88672017-11-29 13:35:43 +000055 (uint32_t)data,
56 0,
57 0);
58}
59
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010060enum tfm_sst_err_t tfm_sst_write(uint32_t asset_uuid,
61 struct tfm_sst_buf_t* data)
Ashutosh Singhf4d88672017-11-29 13:35:43 +000062{
63 return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_WRITE,
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010064 asset_uuid,
Ashutosh Singhf4d88672017-11-29 13:35:43 +000065 (uint32_t)data,
66 0,
67 0);
68}
69
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010070enum tfm_sst_err_t tfm_sst_delete(uint32_t asset_uuid)
Ashutosh Singhf4d88672017-11-29 13:35:43 +000071{
72 return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_DELETE,
Marc Moreno Berengue4258e542018-06-18 13:55:59 +010073 asset_uuid,
Ashutosh Singhf4d88672017-11-29 13:35:43 +000074 0,
75 0,
76 0);
77}