feat(ff-a): notifications bind and unbind ABIs
Defined wrappers for FF-A calls:
- FFA_NOTIFICATION_BIND;
- FFA_NOTIFICATION_UNBIND;
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I556faa2ef457f11e4469ca61b98ee4c06915fd01
diff --git a/include/runtime_services/ffa_helpers.h b/include/runtime_services/ffa_helpers.h
index 07bc33a..c371c55 100644
--- a/include/runtime_services/ffa_helpers.h
+++ b/include/runtime_services/ffa_helpers.h
@@ -27,6 +27,7 @@
#ifndef __ASSEMBLY__
+#include <cassert.h>
#include <stdint.h>
/** Partition property: partition supports receipt of direct requests. */
@@ -59,6 +60,16 @@
return (ffa_id_t) val.ret2 & 0xffff;
}
+typedef uint64_t ffa_notification_bitmap_t;
+
+#define FFA_NOTIFICATION(ID) (UINT64_C(1) << ID)
+
+#define MAX_FFA_NOTIFICATIONS UINT32_C(64)
+
+#define FFA_NOTIFICATIONS_FLAG_PER_VCPU UINT32_C(0x1 << 0)
+
+#define FFA_NOTIFICATIONS_FLAGS_VCPU_ID(id) UINT32_C((id & 0xFFFF) << 16)
+
enum ffa_data_access {
FFA_DATA_ACCESS_NOT_SPECIFIED,
FFA_DATA_ACCESS_RO,
@@ -318,7 +329,8 @@
static inline ffa_memory_handle_t ffa_assemble_handle(uint32_t h1, uint32_t h2)
{
- return (uint64_t)h1 | (uint64_t)h2 << 32;
+ return (ffa_notification_bitmap_t)h1 |
+ (ffa_notification_bitmap_t)h2 << 32;
}
static inline ffa_memory_handle_t ffa_mem_success_handle(smc_ret_values r)
@@ -428,7 +440,11 @@
smc_ret_values ffa_notification_bitmap_create(ffa_id_t vm_id,
ffa_vcpu_count_t vcpu_count);
smc_ret_values ffa_notification_bitmap_destroy(ffa_id_t vm_id);
-
+smc_ret_values ffa_notification_bind(ffa_id_t sender, ffa_id_t receiver,
+ uint32_t flags,
+ ffa_notification_bitmap_t notifications);
+smc_ret_values ffa_notification_unbind(ffa_id_t sender, ffa_id_t receiver,
+ ffa_notification_bitmap_t notifications);
#endif /* __ASSEMBLY__ */
#endif /* FFA_HELPERS_H */