blob: 76c5c96b3bbe8673e9727fc0d0b2fa58fd7d5452 [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 <string.h>
9#include "tfm_ns_svc.h"
10#include "tfm_sst_veneers.h"
11#include "tfm_id_mngr.h"
12
13/* SVC function implementations */
14enum tfm_sst_err_t tfm_sst_svc_get_handle(uint16_t asset_uuid,
15 uint32_t* hdl)
16{
17 uint32_t app_id;
18
19 app_id = tfm_sst_get_cur_id();
20
21 return tfm_sst_veneer_get_handle(app_id, asset_uuid, hdl);
22}
23
24enum tfm_sst_err_t tfm_sst_svc_create(uint16_t asset_uuid)
25{
26 uint32_t app_id;
27
28 app_id = tfm_sst_get_cur_id();
29
30 return tfm_sst_veneer_create(app_id, asset_uuid);
31}
32
Marc Moreno Berengue675b6e92018-06-14 17:31:01 +010033enum tfm_sst_err_t tfm_sst_svc_get_info(uint32_t asset_handle,
34 struct tfm_sst_asset_info_t *info)
Ashutosh Singhf4d88672017-11-29 13:35:43 +000035{
36 uint32_t app_id;
37
38 app_id = tfm_sst_get_cur_id();
39
Marc Moreno Berengue675b6e92018-06-14 17:31:01 +010040 return tfm_sst_veneer_get_info(app_id, asset_handle, info);
Ashutosh Singhf4d88672017-11-29 13:35:43 +000041}
42
Marc Moreno Berengue51af9512018-06-14 18:28:14 +010043enum tfm_sst_err_t tfm_sst_svc_get_attributes(
44 uint32_t asset_handle,
45 struct tfm_sst_asset_attrs_t *attrs)
46{
47 uint32_t app_id;
48
49 app_id = tfm_sst_get_cur_id();
50
51 return tfm_sst_veneer_get_attributes(app_id, asset_handle, attrs);
52}
53
54enum tfm_sst_err_t tfm_sst_svc_set_attributes(
55 uint32_t asset_handle,
56 const struct tfm_sst_asset_attrs_t *attrs)
57{
58 uint32_t app_id;
59
60 app_id = tfm_sst_get_cur_id();
61
62 return tfm_sst_veneer_set_attributes(app_id, asset_handle, attrs);
63}
64
Ashutosh Singhf4d88672017-11-29 13:35:43 +000065enum tfm_sst_err_t tfm_sst_svc_read(uint32_t asset_handle,
66 struct tfm_sst_buf_t* data)
67{
68 uint32_t app_id;
69
70 app_id = tfm_sst_get_cur_id();
71
72 return tfm_sst_veneer_read(app_id, asset_handle, data);
73}
74
75enum tfm_sst_err_t tfm_sst_svc_write(uint32_t asset_handle,
76 struct tfm_sst_buf_t* data)
77{
78 uint32_t app_id;
79
80 app_id = tfm_sst_get_cur_id();
81
82 return tfm_sst_veneer_write(app_id, asset_handle, data);
83}
84
85enum tfm_sst_err_t tfm_sst_svc_delete(uint32_t asset_handle)
86{
87 uint32_t app_id;
88
89 app_id = tfm_sst_get_cur_id();
90
91 return tfm_sst_veneer_delete(app_id, asset_handle);
92}