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 | #include "tfm_sst_defs.h" |
| 9 | #include "tfm_ns_lock.h" |
| 10 | |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 11 | enum tfm_sst_err_t tfm_sst_create(uint32_t asset_uuid) |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 12 | { |
| 13 | return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_CREATE, |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 14 | asset_uuid, |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 15 | 0, |
| 16 | 0, |
| 17 | 0); |
| 18 | } |
| 19 | |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 20 | enum tfm_sst_err_t tfm_sst_get_info(uint32_t asset_uuid, |
Marc Moreno Berengue | 675b6e9 | 2018-06-14 17:31:01 +0100 | [diff] [blame] | 21 | struct tfm_sst_asset_info_t *info) |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 22 | { |
Marc Moreno Berengue | 675b6e9 | 2018-06-14 17:31:01 +0100 | [diff] [blame] | 23 | return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_GET_INFO, |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 24 | asset_uuid, |
Marc Moreno Berengue | 675b6e9 | 2018-06-14 17:31:01 +0100 | [diff] [blame] | 25 | (uint32_t)info, |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 26 | 0, |
| 27 | 0); |
| 28 | } |
| 29 | |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 30 | enum tfm_sst_err_t tfm_sst_get_attributes(uint32_t asset_uuid, |
Marc Moreno Berengue | 51af951 | 2018-06-14 18:28:14 +0100 | [diff] [blame] | 31 | struct tfm_sst_asset_attrs_t *attrs) |
| 32 | { |
| 33 | return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_GET_ATTRIBUTES, |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 34 | asset_uuid, |
Marc Moreno Berengue | 51af951 | 2018-06-14 18:28:14 +0100 | [diff] [blame] | 35 | (uint32_t)attrs, |
| 36 | 0, |
| 37 | 0); |
| 38 | } |
| 39 | |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 40 | enum tfm_sst_err_t tfm_sst_set_attributes(uint32_t asset_uuid, |
Marc Moreno Berengue | 51af951 | 2018-06-14 18:28:14 +0100 | [diff] [blame] | 41 | const struct tfm_sst_asset_attrs_t *attrs) |
| 42 | { |
| 43 | return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_SET_ATTRIBUTES, |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 44 | asset_uuid, |
Marc Moreno Berengue | 51af951 | 2018-06-14 18:28:14 +0100 | [diff] [blame] | 45 | (uint32_t)attrs, |
| 46 | 0, |
| 47 | 0); |
| 48 | } |
| 49 | |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 50 | enum tfm_sst_err_t tfm_sst_read(uint32_t asset_uuid, |
| 51 | struct tfm_sst_buf_t* data) |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 52 | { |
| 53 | return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_READ, |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 54 | asset_uuid, |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 55 | (uint32_t)data, |
| 56 | 0, |
| 57 | 0); |
| 58 | } |
| 59 | |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 60 | enum tfm_sst_err_t tfm_sst_write(uint32_t asset_uuid, |
| 61 | struct tfm_sst_buf_t* data) |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 62 | { |
| 63 | return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_WRITE, |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 64 | asset_uuid, |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 65 | (uint32_t)data, |
| 66 | 0, |
| 67 | 0); |
| 68 | } |
| 69 | |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 70 | enum tfm_sst_err_t tfm_sst_delete(uint32_t asset_uuid) |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 71 | { |
| 72 | return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_DELETE, |
Marc Moreno Berengue | 4258e54 | 2018-06-18 13:55:59 +0100 | [diff] [blame^] | 73 | asset_uuid, |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 74 | 0, |
| 75 | 0, |
| 76 | 0); |
| 77 | } |