feat(notifications): add RX buffer full notification helper functions
Add RX buffer full framework notification defines and helper
functions.
RX buffer full notification is set by the partition manager (either
hypervisor or SPMC) when delivering a message using FF-A v1.1
FFA_MSG_SEND2 indirect message ABI.
Change-Id: I6ab01c1ca4090d2686ce747f14da76b5307b8332
Signed-off-by: Federico Recanati <federico.recanati@arm.com>
diff --git a/inc/vmapi/hf/ffa.h b/inc/vmapi/hf/ffa.h
index 5486c71..50abec8 100644
--- a/inc/vmapi/hf/ffa.h
+++ b/inc/vmapi/hf/ffa.h
@@ -561,6 +561,24 @@
*/
#define FFA_NOTIFICATION_FLAG_PER_VCPU (UINT32_C(1) << 0)
+#define FFA_NOTIFICATION_SPM_BUFFER_FULL_MASK FFA_NOTIFICATION_MASK(0)
+#define FFA_NOTIFICATION_HYP_BUFFER_FULL_MASK FFA_NOTIFICATION_MASK(32)
+
+/**
+ * Helper functions to check for buffer full notification.
+ */
+static inline bool is_ffa_hyp_buffer_full_notification(
+ ffa_notifications_bitmap_t framework)
+{
+ return (framework & FFA_NOTIFICATION_HYP_BUFFER_FULL_MASK) != 0;
+}
+
+static inline bool is_ffa_spm_buffer_full_notification(
+ ffa_notifications_bitmap_t framework)
+{
+ return (framework & FFA_NOTIFICATION_SPM_BUFFER_FULL_MASK) != 0;
+}
+
/**
* Helper function to assemble a 64-bit sized bitmap, from the 32-bit sized lo
* and hi.
@@ -585,6 +603,12 @@
return ffa_notifications_bitmap((uint32_t)val.arg4, (uint32_t)val.arg5);
}
+static inline ffa_notifications_bitmap_t ffa_notification_get_from_framework(
+ struct ffa_value val)
+{
+ return ffa_notifications_bitmap((uint32_t)val.arg6, (uint32_t)val.arg7);
+}
+
/**
* Flags used in calls to FFA_NOTIFICATION_GET interface.
*/