Build: Generate manifest file name header file

According to PSA FF, the 'manifestfilename.h' need be created by tools:
- Add generate_manifestfilename() function to generate this header file.
- The template file is put in 'secure_fw/services'.
- The related header files of secure partition and test partition are
  created by tools.

Change-Id: Ic53ad481860fea018f29b7eca5a9548d074c19ae
Signed-off-by: Edison Ai <edison.ai@arm.com>
diff --git a/secure_fw/services/manifestfilename.template b/secure_fw/services/manifestfilename.template
new file mode 100644
index 0000000..b1ddd4c
--- /dev/null
+++ b/secure_fw/services/manifestfilename.template
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2019, 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.conditional %}
+#ifdef {{attr.conditional}}
+{% endif %}
+{% if attr.tfm_partition_ipc %}
+    {% set ns = namespace(iterator_counter=0) %}
+    {% if manifest.services %}
+        {% for service in manifest.services %}
+#define {{"%-55s"|format(service.signal)}} (1U << ({{"%2d"|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 << ({{"%2d"|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 %}
+{% endif %}
+
+{% if attr.conditional %}
+#endif /* {{attr.conditional}} */
+{% endif %}
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __PSA_MANIFEST_{{file_name.upper()}}_H__ */