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