fix(notifications): encoding of vCPU and receiver IDs
In the FFA_NOTIFICATION_GET interface the vCPU and receiver IDs were
encoded in the wrong positions of w1, according to the FF-A v1.1 beta0
specification.
This patch makes the encoding comply with the spec.
Change-Id: I829ee34145787deeeb2881398667fd338d035332
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index 6b57c92..f90bc41 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -445,7 +445,7 @@
{
return ffa_call((struct ffa_value){
.func = FFA_NOTIFICATION_GET_32,
- .arg1 = (receiver_vm_id << 16) | (vcpu_id),
+ .arg1 = (vcpu_id << 16) | (receiver_vm_id),
.arg2 = flags,
});
}
diff --git a/inc/vmapi/hf/ffa.h b/inc/vmapi/hf/ffa.h
index 8cbf0dc..82c742e 100644
--- a/inc/vmapi/hf/ffa.h
+++ b/inc/vmapi/hf/ffa.h
@@ -482,14 +482,9 @@
/** Flag for FFA_NOTIFICATION_SET to delay Schedule Receiver Interrupt */
#define FFA_NOTIFICATIONS_FLAG_DELAY_SRI UINT32_C(0x1 << 1)
-static inline ffa_vm_id_t ffa_notifications_get_receiver(struct ffa_value args)
+static inline ffa_vcpu_index_t ffa_notifications_get_vcpu(struct ffa_value args)
{
- return (args.arg1 >> 16) & 0xffffU;
-}
-
-static inline ffa_vm_id_t ffa_notifications_get_vcpu(struct ffa_value args)
-{
- return args.arg1 & 0xffffU;
+ return (ffa_vcpu_index_t)(args.arg1 >> 16 & 0xffffU);
}
/**