blob: b51816466eca297eeea01d983c19a3ec668aca88 [file] [log] [blame]
Miklos Balintbf25a402018-06-14 17:43:54 +02001/*
Antonio de Angelis04debbd2019-10-14 12:12:52 +01002 * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
Miklos Balintbf25a402018-06-14 17:43:54 +02003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
Mate Toth-Pal36f21842018-11-08 16:12:51 +01008{{utilities.donotedit_warning}}
Miklos Balintbf25a402018-06-14 17:43:54 +02009
10#include "tfm_secure_api.h"
Mingyang Sunc3123ec2020-06-11 17:43:58 +080011#include "spm_partition_defs.h"
Miklos Balintbf25a402018-06-14 17:43:54 +020012
Mate Toth-Pal36f21842018-11-08 16:12:51 +010013{% for manifest in manifests %}
14 {% if manifest.attr.conditional %}
15#ifdef {{manifest.attr.conditional}}
16 {% endif %}
17/******** {{manifest.manifest.name}} ********/
18 {% for sec_func in manifest.manifest.secure_functions %}
Edison Aifeb0f0c2019-04-16 14:49:05 +080019psa_status_t {{sec_func.signal.lower()}}(psa_invec *, size_t, psa_outvec *, size_t);
Mate Toth-Pal36f21842018-11-08 16:12:51 +010020 {% endfor %}
21 {% if manifest.attr.conditional %}
22#endif /* {{manifest.attr.conditional}} */
23 {% endif %}
Miklos Balintbf25a402018-06-14 17:43:54 +020024
Mate Toth-Pal36f21842018-11-08 16:12:51 +010025{% endfor %}
Miklos Balintbf25a402018-06-14 17:43:54 +020026
27#define TFM_VENEER_FUNCTION(partition_name, sfn_name) \
28 __tfm_secure_gateway_attributes__ \
Antonio de Angelis09586c52019-03-27 16:35:31 +000029 psa_status_t tfm_##sfn_name##_veneer(psa_invec *in_vec, \
Mate Toth-Pal2a6f8c22018-12-13 16:37:17 +010030 size_t in_len, \
Antonio de Angelis09586c52019-03-27 16:35:31 +000031 psa_outvec *out_vec, \
Mate Toth-Pal2a6f8c22018-12-13 16:37:17 +010032 size_t out_len) \
Miklos Balintbf25a402018-06-14 17:43:54 +020033 { \
David Hu8d1f1072020-04-30 12:52:14 +080034 bool is_ns = tfm_core_is_ns_client(); \
35 \
Edison Aib2134e62019-10-11 18:24:47 +080036 TFM_CORE_IOVEC_SFN_REQUEST(partition_name, \
David Hu8d1f1072020-04-30 12:52:14 +080037 is_ns, \
TTornblomc640e072019-06-14 14:33:51 +020038 (void *) sfn_name, \
Mate Toth-Palb8ce0dd2018-07-25 10:18:34 +020039 in_vec, in_len, out_vec, out_len); \
Miklos Balintbf25a402018-06-14 17:43:54 +020040 }
41
Mate Toth-Pal36f21842018-11-08 16:12:51 +010042{% for manifest in manifests %}
43 {% if manifest.attr.conditional %}
44#ifdef {{manifest.attr.conditional}}
45 {% endif %}
46/******** {{manifest.manifest.name}} ********/
47 {% for sec_func in manifest.manifest.secure_functions %}
Edison Aifeb0f0c2019-04-16 14:49:05 +080048TFM_VENEER_FUNCTION({{manifest.manifest.name}}, {{sec_func.signal.lower()}})
Mate Toth-Pal36f21842018-11-08 16:12:51 +010049 {% endfor %}
50 {% if manifest.attr.conditional %}
51#endif /* {{manifest.attr.conditional}} */
52 {% endif %}
Miklos Balintbf25a402018-06-14 17:43:54 +020053
Mate Toth-Pal36f21842018-11-08 16:12:51 +010054{% endfor %}