Build: Create pid.h file
- Create the partition ID header file by tools, which is used for macro
definitions that map from Secure Partition names to Secure Partition
IDs.
- The partition ID is added to the "tfm_manifest_list.yaml" manually so
that the values will keep the same if the build sequence of secure
partition is changed.
- The "short_name" in "tfm_manifest_list.yaml" should be the same as the
"name" in the related manifest.
Change-Id: I0955a700e2a0c195f97c38c3ceb29f3b8c237674
Signed-off-by: Edison Ai <edison.ai@arm.com>
diff --git a/interface/include/psa_manifest/pid.h.template b/interface/include/psa_manifest/pid.h.template
new file mode 100644
index 0000000..f5381f6
--- /dev/null
+++ b/interface/include/psa_manifest/pid.h.template
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2019, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+{{utilities.donotedit_warning}}
+
+#ifndef __PSA_MANIFEST_PID_H__
+#define __PSA_MANIFEST_PID_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+{% for manifest in manifests %}
+ {% if manifest.attr.pid - 256 < 0 %}
+#error "Partition ID for '{{manifest.manifest.name}}' have to be at least TFM_SP_BASE"
+ {% else %}
+#define {{"%-62s"|format(manifest.manifest.name)}} ({{manifest.attr.pid}})
+ {% endif %}
+{% endfor %}
+
+#define {{"%-62s"|format("TFM_MAX_USER_PARTITIONS")}} ({{manifests | length()}})
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __PSA_MANIFEST_PID_H__ */