feat(notifications): bitmaps create and destroy

Handle FF-A calls FFA_NOTIFICATION_BITMAP_CREATE and
FFA_NOTIFICATION_BITMAP_DESTROY.
Interfaces are to be used by the NWd (Hypervisor or single OS kernel).

Change-Id: I0d805875ae6c7f8c080bda04e9e496d9e0d79b00
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/inc/hf/api.h b/inc/hf/api.h
index 7543ac3..75441c4 100644
--- a/inc/hf/api.h
+++ b/inc/hf/api.h
@@ -96,3 +96,8 @@
 struct vcpu *api_switch_to_other_world(struct vcpu *current,
 				       struct ffa_value other_world_ret,
 				       enum vcpu_state vcpu_state);
+struct ffa_value api_ffa_notification_bitmap_create(ffa_vm_id_t vm_id,
+						    ffa_vcpu_count_t vcpu_count,
+						    struct vcpu *current);
+struct ffa_value api_ffa_notification_bitmap_destroy(ffa_vm_id_t vm_id,
+						     struct vcpu *current);
diff --git a/inc/hf/arch/plat/ffa.h b/inc/hf/arch/plat/ffa.h
index fde3bba..57ce170 100644
--- a/inc/hf/arch/plat/ffa.h
+++ b/inc/hf/arch/plat/ffa.h
@@ -25,7 +25,8 @@
 bool plat_ffa_direct_request_forward(ffa_vm_id_t receiver_vm_id,
 				     struct ffa_value args,
 				     struct ffa_value *ret);
-
+bool plat_ffa_is_notifications_create_valid(struct vcpu *current,
+					    ffa_vm_id_t vm_id);
 /**
  * Checks whether managed exit is supported by given SP.
  */
@@ -53,3 +54,19 @@
  * Initializes the NWd VM structures for Notifications support.
  */
 void plat_ffa_vm_init(void);
+
+/**
+ * Get NWd VM's structure.
+ */
+struct vm_locked plat_ffa_vm_find_locked(ffa_vm_id_t vm_id);
+
+/**
+ * Creates a bitmap for the VM of the given ID.
+ */
+struct ffa_value plat_ffa_notifications_bitmap_create(
+	ffa_vm_id_t vm_id, ffa_vcpu_count_t vcpu_count);
+
+/**
+ * Destroys the notifications bitmap for the given VM ID.
+ */
+struct ffa_value plat_ffa_notifications_bitmap_destroy(ffa_vm_id_t vm_id);
diff --git a/inc/hf/vm.h b/inc/hf/vm.h
index f7e674c..6174289 100644
--- a/inc/hf/vm.h
+++ b/inc/hf/vm.h
@@ -225,6 +225,9 @@
 void vm_update_boot(struct vm *vm);
 struct vm *vm_get_first_boot(void);
 
-void vm_notifications_init_bindings(struct notifications *n);
 bool vm_mem_get_mode(struct vm_locked vm_locked, ipaddr_t begin, ipaddr_t end,
 		     uint32_t *mode);
+
+void vm_notifications_init_bindings(struct notifications *n);
+bool vm_are_notifications_pending(struct vm_locked vm_locked, bool from_vm,
+				  ffa_notifications_bitmap_t notifications);