feat(notifications): information get interface

Handled FFA_NOTIFICATION_INFO_GET interface, to be used by a VM
(receiver's scheduler), Hypervisor or OS kernel.
Returns a list of IDs including Endpoints and vCPUs IDs that have
pending notifications. Provides support for multiple calls to the
FFA_NOTIFICATION_INFO_GET, in case there still are notifications whose
information needs to be retrieved after a call.

Change-Id: I4e73f18ee3301da4829313ffae247b6d0d262622
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/inc/vmapi/hf/ffa.h b/inc/vmapi/hf/ffa.h
index 6f2dd27..5198be6 100644
--- a/inc/vmapi/hf/ffa.h
+++ b/inc/vmapi/hf/ffa.h
@@ -87,6 +87,7 @@
 #define FFA_DENIED             INT32_C(-6)
 #define FFA_RETRY              INT32_C(-7)
 #define FFA_ABORTED            INT32_C(-8)
+#define FFA_NO_DATA            INT32_C(-9)
 
 /* clang-format on */
 
@@ -435,6 +436,47 @@
 }
 
 /**
+ * The max number of IDs for return of FFA_NOTIFICATION_INFO_GET.
+ */
+#define FFA_NOTIFICATIONS_INFO_GET_MAX_IDS 20U
+
+/**
+ * Number of registers to use in successfull return of interface
+ * FFA_NOTIFICATION_INFO_GET.
+ */
+#define FFA_NOTIFICATIONS_INFO_GET_REGS_RET 5U
+
+#define FFA_NOTIFICATIONS_INFO_GET_FLAG_MORE_PENDING 0x1U
+
+/**
+ * Helper macros for return parameter encoding as described in section 17.7.1
+ * of the FF-A v1.1 Beta0 specification.
+ */
+#define FFA_NOTIFICATIONS_LISTS_COUNT_SHIFT 0x7U
+#define FFA_NOTIFICATIONS_LISTS_COUNT_MASK 0x1fU
+#define FFA_NOTIFICATIONS_LIST_SHIFT(l) (2 * (l - 1) + 12)
+#define FFA_NOTIFICATIONS_LIST_SIZE_MASK 0x3U
+
+static inline uint32_t ffa_notification_info_get_lists_count(
+	struct ffa_value args)
+{
+	return (uint32_t)(args.arg2 >> FFA_NOTIFICATIONS_LISTS_COUNT_SHIFT) &
+	       FFA_NOTIFICATIONS_LISTS_COUNT_MASK;
+}
+
+static inline uint32_t ffa_notification_info_get_list_size(
+	struct ffa_value args, unsigned int list_idx)
+{
+	return ((uint32_t)args.arg2 >> FFA_NOTIFICATIONS_LIST_SHIFT(list_idx)) &
+	       FFA_NOTIFICATIONS_LIST_SIZE_MASK;
+}
+
+static inline bool ffa_notification_info_get_more_pending(struct ffa_value args)
+{
+	return (args.arg2 & FFA_NOTIFICATIONS_INFO_GET_FLAG_MORE_PENDING) != 0U;
+}
+
+/**
  * A set of contiguous pages which is part of a memory region. This corresponds
  * to table 40 of the FF-A 1.0 EAC specification, "Constituent memory region
  * descriptor".