blob: 8d2f9820a3ddb5bcf3571f60dd2ca1ba75269c71 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
/*
* Copyright (c) 2019-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
{{utilities.donotedit_warning}}
#ifndef __PSA_MANIFEST_{{file_name.upper()}}_H__
#define __PSA_MANIFEST_{{file_name.upper()}}_H__
#ifdef __cplusplus
extern "C" {
#endif
{% if attr.tfm_partition_ipc %}
{% set ns = namespace(iterator_counter=0) %}
{% if manifest.services %}
{% for service in manifest.services %}
#define {{"%-55s"|format(service.name + "_SIGNAL")}} (1U << ({{"%d"|format(ns.iterator_counter)}} + 4))
{% set ns.iterator_counter = ns.iterator_counter + 1 %}
{% endfor %}
{% endif %}
{% if ns.iterator_counter > 28 %}
#error "Too many signals!"
{% endif %}
{% endif %}
{% if manifest.irqs %}
{% set irq_ns = namespace(irq_iterator_counter=27) %}
{% for irq in manifest.irqs %}
#define {{"%-55s"|format(irq.signal)}} (1U << ({{"%d"|format(irq_ns.irq_iterator_counter)}} + 4))
{% set irq_ns.irq_iterator_counter = irq_ns.irq_iterator_counter - 1 %}
{% endfor %}
{% if attr.tfm_partition_ipc %}
{% if (ns.iterator_counter - 1) >= (irq_ns.irq_iterator_counter + 1) %}
#error "Secure service and IRQ signal values overlap!"
{% endif %}
{% else %}
{% if (irq_ns.irq_iterator_counter + 1) < 0 %}
#error "Too many IRQ signals!"
{% endif %}
{% endif %}
{% else %}
{# If no RoT Service is defined in the services attribute, then at least one IRQ must be declared. #}
{% if attr.tfm_partition_ipc %}
{% if (manifest.services is not defined) or ((manifest.services | length()) == 0) %}
#error "At least one IRQ must be declared!"
{% endif %}
{% endif %}
{% endif %}
#ifdef __cplusplus
}
#endif
#endif /* __PSA_MANIFEST_{{file_name.upper()}}_H__ */
|