blob: 31ca9bdb682ef7d1fb7f64df3dee6a365dc75c61 [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
43enum tfm_sst_err_t tfm_sst_svc_read(uint32_t asset_handle,
44 struct tfm_sst_buf_t* data)
45{
46 uint32_t app_id;
47
48 app_id = tfm_sst_get_cur_id();
49
50 return tfm_sst_veneer_read(app_id, asset_handle, data);
51}
52
53enum tfm_sst_err_t tfm_sst_svc_write(uint32_t asset_handle,
54 struct tfm_sst_buf_t* data)
55{
56 uint32_t app_id;
57
58 app_id = tfm_sst_get_cur_id();
59
60 return tfm_sst_veneer_write(app_id, asset_handle, data);
61}
62
63enum tfm_sst_err_t tfm_sst_svc_delete(uint32_t asset_handle)
64{
65 uint32_t app_id;
66
67 app_id = tfm_sst_get_cur_id();
68
69 return tfm_sst_veneer_delete(app_id, asset_handle);
70}