feat(notifications): functions to get framework notifications
Extend the vm module with functions to get framework notifications for a
given partition.
This is to be used in the indirect messaging implementation, to get
the RX buffer full notification when partitions receive a message.
Change-Id: I547fd54c9575e4c0120f6cb18973071e201355fd
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/src/api.c b/src/api.c
index 594c9e8..72043d8 100644
--- a/src/api.c
+++ b/src/api.c
@@ -3079,7 +3079,7 @@
ffa_vcpu_index_t vcpu_id,
uint32_t flags, struct vcpu *current)
{
- /* TODO: get framework notifications, when these are supported. */
+ ffa_notifications_bitmap_t framework_notifications = 0;
ffa_notifications_bitmap_t sp_notifications = 0;
ffa_notifications_bitmap_t vm_notifications = 0;
struct vm_locked receiver_locked;
@@ -3146,8 +3146,8 @@
receiver_locked, true, vcpu_id);
}
- ret = api_ffa_notification_get_success_return(sp_notifications,
- vm_notifications, 0);
+ ret = api_ffa_notification_get_success_return(
+ sp_notifications, vm_notifications, framework_notifications);
/*
* If there are no more pending notifications, change `sri_state` to
diff --git a/src/vm.c b/src/vm.c
index 01e7fca..f46967d 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -756,6 +756,17 @@
}
/**
+ * Get pending framework notifications.
+ */
+ffa_notifications_bitmap_t vm_notifications_framework_get_pending(
+ struct vm_locked vm_locked)
+{
+ assert(vm_locked.vm != NULL);
+ return vm_notifications_state_get_pending(
+ &vm_locked.vm->notifications.framework);
+}
+
+/**
* Get pending notification's information to return to the receiver scheduler.
*/
void vm_notifications_info_get_pending(