feat(ff-a): define memory security state attribute

FF-A v1.1rel0 defines the security state attribute for the
memory transaction descriptor. Add respective definition
to ffa_helpers.h.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: Iefb510f5272587bc9faa96731af0159e2379576b
diff --git a/include/runtime_services/ffa_helpers.h b/include/runtime_services/ffa_helpers.h
index a7cdcb5..149969e 100644
--- a/include/runtime_services/ffa_helpers.h
+++ b/include/runtime_services/ffa_helpers.h
@@ -403,6 +403,17 @@
 typedef uint8_t ffa_memory_access_permissions_t;
 
 /**
+ * FF-A v1.1 REL0 Table 10.18 memory region attributes descriptor NS Bit 6.
+ * Per section 10.10.4.1, NS bit is reserved for FFA_MEM_DONATE/LEND/SHARE
+ * and FFA_MEM_RETRIEVE_REQUEST.
+ */
+enum ffa_memory_security {
+	FFA_MEMORY_SECURITY_UNSPECIFIED = 0,
+	FFA_MEMORY_SECURITY_SECURE = 0,
+	FFA_MEMORY_SECURITY_NON_SECURE,
+};
+
+/**
  * This corresponds to table 10.18 of the FF-A v1.1 EAC0 specification, "Memory
  * region attributes descriptor".
  */
@@ -417,6 +428,9 @@
 #define FFA_MEMORY_TYPE_OFFSET (0x4U)
 #define FFA_MEMORY_TYPE_MASK ((0x3U) << FFA_MEMORY_TYPE_OFFSET)
 
+#define FFA_MEMORY_SECURITY_OFFSET (0x6U)
+#define FFA_MEMORY_SECURITY_MASK ((0x1U) << FFA_MEMORY_SECURITY_OFFSET)
+
 #define FFA_MEMORY_CACHEABILITY_OFFSET (0x2U)
 #define FFA_MEMORY_CACHEABILITY_MASK ((0x3U) << FFA_MEMORY_CACHEABILITY_OFFSET)
 
@@ -452,6 +466,11 @@
 ATTR_FUNCTION_GET(memory_type, ffa_memory_attributes_t, FFA_MEMORY_TYPE_OFFSET,
 		  FFA_MEMORY_TYPE_MASK)
 
+ATTR_FUNCTION_SET(memory_security, ffa_memory_attributes_t,
+		  FFA_MEMORY_SECURITY_OFFSET, FFA_MEMORY_SECURITY_MASK)
+ATTR_FUNCTION_GET(memory_security, ffa_memory_attributes_t,
+		  FFA_MEMORY_SECURITY_OFFSET, FFA_MEMORY_SECURITY_MASK)
+
 ATTR_FUNCTION_SET(memory_cacheability, ffa_memory_attributes_t,
 		  FFA_MEMORY_CACHEABILITY_OFFSET, FFA_MEMORY_CACHEABILITY_MASK)
 ATTR_FUNCTION_GET(memory_cacheability, ffa_memory_attributes_t,