SPM: Add Macros of checking Partition attributes

This patch adds two Macros for checking Partition attributes:
- IS_PARTITION_PSA_ROT
- IS_PARTITION_IPC_MODEL

Change-Id: If4e843d7b68fc343273ab51cdf8ea1bae4b92000
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/secure_fw/spm/cmsis_psa/static_load.c b/secure_fw/spm/cmsis_psa/static_load.c
index 0955cb2..16e797f 100644
--- a/secure_fw/spm/cmsis_psa/static_load.c
+++ b/secure_fw/spm/cmsis_psa/static_load.c
@@ -140,7 +140,7 @@
         services[i].partition = p_partition;
         services[i].next = NULL;
 
-        if (p_ptldinf->flags & PARTITION_MODEL_IPC) {
+        if (IS_PARTITION_IPC_MODEL(p_ptldinf)) {
             service_setting |= p_servldinf[i].signal;
         }
 
diff --git a/secure_fw/spm/ffm/backend_sfn.c b/secure_fw/spm/ffm/backend_sfn.c
index 3edde0c..a0275fc 100644
--- a/secure_fw/spm/ffm/backend_sfn.c
+++ b/secure_fw/spm/ffm/backend_sfn.c
@@ -98,7 +98,7 @@
      * Built-in partitions still have thread instances: NS Agent (TZ) and
      * IDLE partition, and NS Agent (TZ) needs to be specific cared here.
      */
-    if (p_pldi->flags & PARTITION_MODEL_IPC) {
+    if (IS_PARTITION_IPC_MODEL(p_pldi)) {
         THRD_INIT(&p_pt->thrd, &p_pt->ctx_ctrl,
                   TO_THREAD_PRIORITY(PARTITION_PRIORITY(p_pldi->flags)));
 
@@ -125,7 +125,7 @@
     p_curr = GET_CURRENT_COMPONENT();
     /* Call partition initialization routine one by one. */
     UNI_LIST_FOR_EACH(p_part, PARTITION_LIST_ADDR) {
-        if (p_part->p_ldinf->flags & PARTITION_MODEL_IPC) {
+        if (IS_PARTITION_IPC_MODEL(p_part->p_ldinf)) {
             continue;
         }
 
diff --git a/secure_fw/spm/include/load/partition_defs.h b/secure_fw/spm/include/load/partition_defs.h
index 88ca9f8..78e2f18 100644
--- a/secure_fw/spm/include/load/partition_defs.h
+++ b/secure_fw/spm/include/load/partition_defs.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -46,6 +46,11 @@
 #define PTR_TO_REFERENCE(x)                     (uintptr_t)(x)
 #define REFERENCE_TO_PTR(x, t)                  (t)(x)
 
+#define IS_PARTITION_PSA_ROT(pldi)              (!!((pldi)->flags \
+                                                     & PARTITION_MODEL_PSA_ROT))
+#define IS_PARTITION_IPC_MODEL(pldi)            (!!((pldi)->flags \
+                                                         & PARTITION_MODEL_IPC))
+
 /*
  * Common partition structure type, the extendable data is right after it.
  * Extendable data has different size for each partition, and must be 4-byte