Build: Align manifest service

Align manifest service to PSA FF 1.0.0:
- Remove "signal" from service region.
- Change signal macro names postfix from "_SIG" to "_SIGNAL".

Change-Id: Ib405f5cc8ec9b4a04e294a19957c4b425f6ccb65
Signed-off-by: Edison Ai <edison.ai@arm.com>
diff --git a/secure_fw/services/crypto/crypto_init.c b/secure_fw/services/crypto/crypto_init.c
index de28a4a..bdb99e4 100644
--- a/secure_fw/services/crypto/crypto_init.c
+++ b/secure_fw/services/crypto/crypto_init.c
@@ -214,9 +214,9 @@
 
     while (1) {
         signals = psa_wait(PSA_WAIT_ANY, PSA_BLOCK);
-        if (signals & TFM_CRYPTO_SIG) {
+        if (signals & TFM_CRYPTO_SIGNAL) {
             /* Extract the message */
-            if (psa_get(TFM_CRYPTO_SIG, &msg) != PSA_SUCCESS) {
+            if (psa_get(TFM_CRYPTO_SIGNAL, &msg) != PSA_SUCCESS) {
                 /* FIXME: Should be replaced by TF-M error handling */
                 while (1) {
                     ;
diff --git a/secure_fw/services/crypto/psa_manifest/tfm_crypto.h b/secure_fw/services/crypto/psa_manifest/tfm_crypto.h
index 3047087..87b44a1 100644
--- a/secure_fw/services/crypto/psa_manifest/tfm_crypto.h
+++ b/secure_fw/services/crypto/psa_manifest/tfm_crypto.h
@@ -14,7 +14,7 @@
 extern "C" {
 #endif
 
-#define TFM_CRYPTO_SIG                                          (1U << ( 0 + 4))
+#define TFM_CRYPTO_SIGNAL                                       (1U << (0 + 4))
 
 #ifdef __cplusplus
 }
diff --git a/secure_fw/services/crypto/tfm_crypto.yaml b/secure_fw/services/crypto/tfm_crypto.yaml
index 1fa3afc..8d0a90e 100644
--- a/secure_fw/services/crypto/tfm_crypto.yaml
+++ b/secure_fw/services/crypto/tfm_crypto.yaml
@@ -334,7 +334,6 @@
     {
       "name": "TFM_CRYPTO",
       "sid": "0x00000080",
-      "signal": "TFM_CRYPTO_SIG",
       "non_secure_clients": true,
       "version": 1,
       "version_policy": "STRICT"
diff --git a/secure_fw/services/initial_attestation/psa_manifest/tfm_initial_attestation.h b/secure_fw/services/initial_attestation/psa_manifest/tfm_initial_attestation.h
index 6cf3e1e..5433654 100644
--- a/secure_fw/services/initial_attestation/psa_manifest/tfm_initial_attestation.h
+++ b/secure_fw/services/initial_attestation/psa_manifest/tfm_initial_attestation.h
@@ -14,8 +14,8 @@
 extern "C" {
 #endif
 
-#define PSA_ATTEST_GET_TOKEN_SIG                                (1U << ( 0 + 4))
-#define PSA_ATTEST_GET_TOKEN_SIZE_SIG                           (1U << ( 1 + 4))
+#define TFM_ATTEST_GET_TOKEN_SIGNAL                             (1U << (0 + 4))
+#define TFM_ATTEST_GET_TOKEN_SIZE_SIGNAL                        (1U << (1 + 4))
 
 #ifdef __cplusplus
 }
diff --git a/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c b/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c
index 8036fcf..46bafc6 100644
--- a/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c
+++ b/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c
@@ -145,11 +145,11 @@
 
     while (1) {
         signals = psa_wait(PSA_WAIT_ANY, PSA_BLOCK);
-        if (signals & PSA_ATTEST_GET_TOKEN_SIG) {
-            attest_signal_handle(PSA_ATTEST_GET_TOKEN_SIG,
+        if (signals & TFM_ATTEST_GET_TOKEN_SIGNAL) {
+            attest_signal_handle(TFM_ATTEST_GET_TOKEN_SIGNAL,
                                  psa_attest_get_token);
-        } else if (signals & PSA_ATTEST_GET_TOKEN_SIZE_SIG) {
-            attest_signal_handle(PSA_ATTEST_GET_TOKEN_SIZE_SIG,
+        } else if (signals & TFM_ATTEST_GET_TOKEN_SIZE_SIGNAL) {
+            attest_signal_handle(TFM_ATTEST_GET_TOKEN_SIZE_SIGNAL,
                                  psa_attest_get_token_size);
         } else {
             tfm_abort();
diff --git a/secure_fw/services/initial_attestation/tfm_initial_attestation.yaml b/secure_fw/services/initial_attestation/tfm_initial_attestation.yaml
index c5d0cd2..93b9d3e 100644
--- a/secure_fw/services/initial_attestation/tfm_initial_attestation.yaml
+++ b/secure_fw/services/initial_attestation/tfm_initial_attestation.yaml
@@ -40,7 +40,6 @@
     {
       "name": "TFM_ATTEST_GET_TOKEN",
       "sid": "0x00000020",
-      "signal": "PSA_ATTEST_GET_TOKEN_SIG",
       "non_secure_clients": true,
       "version": 1,
       "version_policy": "STRICT"
@@ -48,7 +47,6 @@
     {
       "name": "TFM_ATTEST_GET_TOKEN_SIZE",
       "sid": "0x00000021",
-      "signal": "PSA_ATTEST_GET_TOKEN_SIZE_SIG",
       "non_secure_clients": true,
       "version": 1,
       "version_policy": "STRICT"
diff --git a/secure_fw/services/internal_trusted_storage/psa_manifest/tfm_internal_trusted_storage.h b/secure_fw/services/internal_trusted_storage/psa_manifest/tfm_internal_trusted_storage.h
index cd798c3..fc8f5d6 100644
--- a/secure_fw/services/internal_trusted_storage/psa_manifest/tfm_internal_trusted_storage.h
+++ b/secure_fw/services/internal_trusted_storage/psa_manifest/tfm_internal_trusted_storage.h
@@ -14,10 +14,10 @@
 extern "C" {
 #endif
 
-#define TFM_ITS_SET_SIG                                         (1U << ( 0 + 4))
-#define TFM_ITS_GET_SIG                                         (1U << ( 1 + 4))
-#define TFM_ITS_GET_INFO_SIG                                    (1U << ( 2 + 4))
-#define TFM_ITS_REMOVE_SIG                                      (1U << ( 3 + 4))
+#define TFM_ITS_SET_SIGNAL                                      (1U << (0 + 4))
+#define TFM_ITS_GET_SIGNAL                                      (1U << (1 + 4))
+#define TFM_ITS_GET_INFO_SIGNAL                                 (1U << (2 + 4))
+#define TFM_ITS_REMOVE_SIGNAL                                   (1U << (3 + 4))
 
 #ifdef __cplusplus
 }
diff --git a/secure_fw/services/internal_trusted_storage/tfm_internal_trusted_storage.yaml b/secure_fw/services/internal_trusted_storage/tfm_internal_trusted_storage.yaml
index 64937f2..2ab3091 100644
--- a/secure_fw/services/internal_trusted_storage/tfm_internal_trusted_storage.yaml
+++ b/secure_fw/services/internal_trusted_storage/tfm_internal_trusted_storage.yaml
@@ -46,7 +46,6 @@
   "services" : [{
     "name": "TFM_ITS_SET",
     "sid": "0x00000070",
-    "signal": "TFM_ITS_SET_SIG",
     "non_secure_clients": true,
     "version": 1,
     "version_policy": "STRICT"
@@ -54,7 +53,6 @@
    {
     "name": "TFM_ITS_GET",
     "sid": "0x00000071",
-    "signal": "TFM_ITS_GET_SIG",
     "non_secure_clients": true,
     "version": 1,
     "version_policy": "STRICT"
@@ -62,7 +60,6 @@
    {
     "name": "TFM_ITS_GET_INFO",
     "sid": "0x00000072",
-    "signal": "TFM_ITS_GET_INFO_SIG",
     "non_secure_clients": true,
     "version": 1,
     "version_policy": "STRICT"
@@ -70,7 +67,6 @@
    {
     "name": "TFM_ITS_REMOVE",
     "sid": "0x00000073",
-    "signal": "TFM_ITS_REMOVE_SIG",
     "non_secure_clients": true,
     "version": 1,
     "version_policy": "STRICT"
diff --git a/secure_fw/services/internal_trusted_storage/tfm_its_req_mngr.c b/secure_fw/services/internal_trusted_storage/tfm_its_req_mngr.c
index bdd755c..efd12c6 100644
--- a/secure_fw/services/internal_trusted_storage/tfm_its_req_mngr.c
+++ b/secure_fw/services/internal_trusted_storage/tfm_its_req_mngr.c
@@ -362,14 +362,14 @@
 
     while (1) {
         signals = psa_wait(PSA_WAIT_ANY, PSA_BLOCK);
-        if (signals & TFM_ITS_SET_SIG) {
-            its_signal_handle(TFM_ITS_SET_SIG, tfm_its_set_ipc);
-        } else if (signals & TFM_ITS_GET_SIG) {
-            its_signal_handle(TFM_ITS_GET_SIG, tfm_its_get_ipc);
-        } else if (signals & TFM_ITS_GET_INFO_SIG) {
-            its_signal_handle(TFM_ITS_GET_INFO_SIG, tfm_its_get_info_ipc);
-        } else if (signals & TFM_ITS_REMOVE_SIG) {
-            its_signal_handle(TFM_ITS_REMOVE_SIG, tfm_its_remove_ipc);
+        if (signals & TFM_ITS_SET_SIGNAL) {
+            its_signal_handle(TFM_ITS_SET_SIGNAL, tfm_its_set_ipc);
+        } else if (signals & TFM_ITS_GET_SIGNAL) {
+            its_signal_handle(TFM_ITS_GET_SIGNAL, tfm_its_get_ipc);
+        } else if (signals & TFM_ITS_GET_INFO_SIGNAL) {
+            its_signal_handle(TFM_ITS_GET_INFO_SIGNAL, tfm_its_get_info_ipc);
+        } else if (signals & TFM_ITS_REMOVE_SIGNAL) {
+            its_signal_handle(TFM_ITS_REMOVE_SIGNAL, tfm_its_remove_ipc);
         } else {
             tfm_abort();
         }
diff --git a/secure_fw/services/manifestfilename.template b/secure_fw/services/manifestfilename.template
index 7666b6e..0af69ef 100644
--- a/secure_fw/services/manifestfilename.template
+++ b/secure_fw/services/manifestfilename.template
@@ -18,11 +18,7 @@
     {% set ns = namespace(iterator_counter=0) %}
     {% if manifest.services %}
         {% for service in manifest.services %}
-            {% if service.signal %}
-#define {{"%-55s"|format(service.signal)}} (1U << ({{"%2d"|format(ns.iterator_counter)}} + 4))
-            {% else %}
-#define {{"%-55s"|format(service.name+'_SIGNAL')}} (1U << ({{"%2d"|format(ns.iterator_counter)}} + 4))
-            {% endif %}
+#define {{"%-55s"|format(service.name + "_SIGNAL")}} (1U << ({{"%d"|format(ns.iterator_counter)}} + 4))
             {% set ns.iterator_counter = ns.iterator_counter + 1 %}
         {% endfor %}
     {% endif %}
@@ -35,7 +31,7 @@
 
     {% 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))
+#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 %}
diff --git a/secure_fw/services/secure_storage/psa_manifest/tfm_secure_storage.h b/secure_fw/services/secure_storage/psa_manifest/tfm_secure_storage.h
index b6ab3dd..5329ce2 100644
--- a/secure_fw/services/secure_storage/psa_manifest/tfm_secure_storage.h
+++ b/secure_fw/services/secure_storage/psa_manifest/tfm_secure_storage.h
@@ -14,11 +14,11 @@
 extern "C" {
 #endif
 
-#define TFM_SST_SET_SIG                                         (1U << ( 0 + 4))
-#define TFM_SST_GET_SIG                                         (1U << ( 1 + 4))
-#define TFM_SST_GET_INFO_SIG                                    (1U << ( 2 + 4))
-#define TFM_SST_REMOVE_SIG                                      (1U << ( 3 + 4))
-#define TFM_SST_GET_SUPPORT_SIG                                 (1U << ( 4 + 4))
+#define TFM_SST_SET_SIGNAL                                      (1U << (0 + 4))
+#define TFM_SST_GET_SIGNAL                                      (1U << (1 + 4))
+#define TFM_SST_GET_INFO_SIGNAL                                 (1U << (2 + 4))
+#define TFM_SST_REMOVE_SIGNAL                                   (1U << (3 + 4))
+#define TFM_SST_GET_SUPPORT_SIGNAL                              (1U << (4 + 4))
 
 #ifdef __cplusplus
 }
diff --git a/secure_fw/services/secure_storage/tfm_secure_storage.yaml b/secure_fw/services/secure_storage/tfm_secure_storage.yaml
index 2d03998..74e46fa 100644
--- a/secure_fw/services/secure_storage/tfm_secure_storage.yaml
+++ b/secure_fw/services/secure_storage/tfm_secure_storage.yaml
@@ -53,7 +53,6 @@
   "services" : [{
     "name": "TFM_SST_SET",
     "sid": "0x00000060",
-    "signal": "TFM_SST_SET_SIG",
     "non_secure_clients": true,
     "version": 1,
     "version_policy": "STRICT"
@@ -61,7 +60,6 @@
    {
     "name": "TFM_SST_GET",
     "sid": "0x00000061",
-    "signal": "TFM_SST_GET_SIG",
     "non_secure_clients": true,
     "version": 1,
     "version_policy": "STRICT"
@@ -69,7 +67,6 @@
    {
     "name": "TFM_SST_GET_INFO",
     "sid": "0x00000062",
-    "signal": "TFM_SST_GET_INFO_SIG",
     "non_secure_clients": true,
     "version": 1,
     "version_policy": "STRICT"
@@ -77,7 +74,6 @@
    {
     "name": "TFM_SST_REMOVE",
     "sid": "0x00000063",
-    "signal": "TFM_SST_REMOVE_SIG",
     "non_secure_clients": true,
     "version": 1,
     "version_policy": "STRICT"
@@ -85,7 +81,6 @@
    {
     "name": "TFM_SST_GET_SUPPORT",
     "sid": "0x00000064",
-    "signal": "TFM_SST_GET_SUPPORT_SIG",
     "non_secure_clients": true,
     "version": 1,
     "version_policy": "STRICT"
diff --git a/secure_fw/services/secure_storage/tfm_sst_req_mngr.c b/secure_fw/services/secure_storage/tfm_sst_req_mngr.c
index a185c31..15141d8 100644
--- a/secure_fw/services/secure_storage/tfm_sst_req_mngr.c
+++ b/secure_fw/services/secure_storage/tfm_sst_req_mngr.c
@@ -472,16 +472,17 @@
 
     while (1) {
         signals = psa_wait(PSA_WAIT_ANY, PSA_BLOCK);
-        if (signals & TFM_SST_SET_SIG) {
-            ps_signal_handle(TFM_SST_SET_SIG, tfm_sst_set_ipc);
-        } else if (signals & TFM_SST_GET_SIG) {
-            ps_signal_handle(TFM_SST_GET_SIG, tfm_sst_get_ipc);
-        } else if (signals & TFM_SST_GET_INFO_SIG) {
-            ps_signal_handle(TFM_SST_GET_INFO_SIG, tfm_sst_get_info_ipc);
-        } else if (signals & TFM_SST_REMOVE_SIG) {
-            ps_signal_handle(TFM_SST_REMOVE_SIG, tfm_sst_remove_ipc);
-        } else if (signals & TFM_SST_GET_SUPPORT_SIG) {
-            ps_signal_handle(TFM_SST_GET_SUPPORT_SIG, tfm_sst_get_support_ipc);
+        if (signals & TFM_SST_SET_SIGNAL) {
+            ps_signal_handle(TFM_SST_SET_SIGNAL, tfm_sst_set_ipc);
+        } else if (signals & TFM_SST_GET_SIGNAL) {
+            ps_signal_handle(TFM_SST_GET_SIGNAL, tfm_sst_get_ipc);
+        } else if (signals & TFM_SST_GET_INFO_SIGNAL) {
+            ps_signal_handle(TFM_SST_GET_INFO_SIGNAL, tfm_sst_get_info_ipc);
+        } else if (signals & TFM_SST_REMOVE_SIGNAL) {
+            ps_signal_handle(TFM_SST_REMOVE_SIGNAL, tfm_sst_remove_ipc);
+        } else if (signals & TFM_SST_GET_SUPPORT_SIGNAL) {
+            ps_signal_handle(TFM_SST_GET_SUPPORT_SIGNAL,
+                             tfm_sst_get_support_ipc);
         } else {
             tfm_abort();
         }
diff --git a/secure_fw/services/tfm_service_list.inc b/secure_fw/services/tfm_service_list.inc
index 964643d..afbb59c 100644
--- a/secure_fw/services/tfm_service_list.inc
+++ b/secure_fw/services/tfm_service_list.inc
@@ -29,7 +29,7 @@
     {
         .name = "TFM_SST_SET",
         .partition_id = TFM_SP_STORAGE,
-        .signal = TFM_SST_SET_SIG,
+        .signal = TFM_SST_SET_SIGNAL,
         .sid = 0x00000060,
         .non_secure_client = true,
         .version = 1,
@@ -38,7 +38,7 @@
     {
         .name = "TFM_SST_GET",
         .partition_id = TFM_SP_STORAGE,
-        .signal = TFM_SST_GET_SIG,
+        .signal = TFM_SST_GET_SIGNAL,
         .sid = 0x00000061,
         .non_secure_client = true,
         .version = 1,
@@ -47,7 +47,7 @@
     {
         .name = "TFM_SST_GET_INFO",
         .partition_id = TFM_SP_STORAGE,
-        .signal = TFM_SST_GET_INFO_SIG,
+        .signal = TFM_SST_GET_INFO_SIGNAL,
         .sid = 0x00000062,
         .non_secure_client = true,
         .version = 1,
@@ -56,7 +56,7 @@
     {
         .name = "TFM_SST_REMOVE",
         .partition_id = TFM_SP_STORAGE,
-        .signal = TFM_SST_REMOVE_SIG,
+        .signal = TFM_SST_REMOVE_SIGNAL,
         .sid = 0x00000063,
         .non_secure_client = true,
         .version = 1,
@@ -65,7 +65,7 @@
     {
         .name = "TFM_SST_GET_SUPPORT",
         .partition_id = TFM_SP_STORAGE,
-        .signal = TFM_SST_GET_SUPPORT_SIG,
+        .signal = TFM_SST_GET_SUPPORT_SIGNAL,
         .sid = 0x00000064,
         .non_secure_client = true,
         .version = 1,
@@ -76,7 +76,7 @@
     {
         .name = "TFM_ITS_SET",
         .partition_id = TFM_SP_ITS,
-        .signal = TFM_ITS_SET_SIG,
+        .signal = TFM_ITS_SET_SIGNAL,
         .sid = 0x00000070,
         .non_secure_client = true,
         .version = 1,
@@ -85,7 +85,7 @@
     {
         .name = "TFM_ITS_GET",
         .partition_id = TFM_SP_ITS,
-        .signal = TFM_ITS_GET_SIG,
+        .signal = TFM_ITS_GET_SIGNAL,
         .sid = 0x00000071,
         .non_secure_client = true,
         .version = 1,
@@ -94,7 +94,7 @@
     {
         .name = "TFM_ITS_GET_INFO",
         .partition_id = TFM_SP_ITS,
-        .signal = TFM_ITS_GET_INFO_SIG,
+        .signal = TFM_ITS_GET_INFO_SIGNAL,
         .sid = 0x00000072,
         .non_secure_client = true,
         .version = 1,
@@ -103,7 +103,7 @@
     {
         .name = "TFM_ITS_REMOVE",
         .partition_id = TFM_SP_ITS,
-        .signal = TFM_ITS_REMOVE_SIG,
+        .signal = TFM_ITS_REMOVE_SIGNAL,
         .sid = 0x00000073,
         .non_secure_client = true,
         .version = 1,
@@ -114,7 +114,7 @@
     {
         .name = "TFM_CRYPTO",
         .partition_id = TFM_SP_CRYPTO,
-        .signal = TFM_CRYPTO_SIG,
+        .signal = TFM_CRYPTO_SIGNAL,
         .sid = 0x00000080,
         .non_secure_client = true,
         .version = 1,
@@ -125,7 +125,7 @@
     {
         .name = "TFM_ATTEST_GET_TOKEN",
         .partition_id = TFM_SP_INITIAL_ATTESTATION,
-        .signal = PSA_ATTEST_GET_TOKEN_SIG,
+        .signal = TFM_ATTEST_GET_TOKEN_SIGNAL,
         .sid = 0x00000020,
         .non_secure_client = true,
         .version = 1,
@@ -134,7 +134,7 @@
     {
         .name = "TFM_ATTEST_GET_TOKEN_SIZE",
         .partition_id = TFM_SP_INITIAL_ATTESTATION,
-        .signal = PSA_ATTEST_GET_TOKEN_SIZE_SIG,
+        .signal = TFM_ATTEST_GET_TOKEN_SIZE_SIGNAL,
         .sid = 0x00000021,
         .non_secure_client = true,
         .version = 1,
@@ -316,7 +316,7 @@
     {
         .name = "TFM_SECURE_CLIENT_SFN_RUN_TESTS",
         .partition_id = TFM_SP_SECURE_TEST_PARTITION,
-        .signal = TFM_SECURE_CLIENT_SFN_RUN_TESTS_SIG,
+        .signal = TFM_SECURE_CLIENT_SFN_RUN_TESTS_SIGNAL,
         .sid = 0x0000F000,
         .non_secure_client = true,
         .version = 1,
diff --git a/secure_fw/services/tfm_service_list.inc.template b/secure_fw/services/tfm_service_list.inc.template
index 256e3bb..2be5370 100644
--- a/secure_fw/services/tfm_service_list.inc.template
+++ b/secure_fw/services/tfm_service_list.inc.template
@@ -27,11 +27,7 @@
     {{'{'}}
         .name = "{{service.name}}",
         .partition_id = {{manifest.manifest.name}},
-            {% if service.signal %}
-        .signal = {{service.signal}},
-            {% else %}
         .signal = {{service.name}}_SIGNAL,
-            {% endif %}
         .sid = {{service.sid}},
             {% if service.non_secure_clients is sameas true %}
         .non_secure_client = true,