feat(indirect message): add FFA_MSG_SEND2 support

FF-A v1.1 indirect message FFA_MSG_SEND2 support, allowing indirect
messaging between any endpoint (VM and SP).
When one of the endpoints is an SP, the SPMC is responsible for message
delivery to the receiver, potentially in the other world.
In order to allow cross world communication the SPMC is aware of VM
mailboxes and the Hypervisor forwards the FFA_MSG_SEND2 message to the
SPMC when the receiver is an SP.

Change-Id: Iba9b3d299b051ed3b105cb9e2b63e65fd4f662ce
Signed-off-by: Federico Recanati <federico.recanati@arm.com>
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index ef55d8f..245be99 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -174,6 +174,24 @@
 		.arg4 = attributes});
 }
 
+/**
+ * Copies data from the sender's send buffer to the recipient's receive buffer
+ * and notifies the receiver.
+ *
+ * `flags` may include a 'Delay Schedule Receiver interrupt'.
+ *
+ * Returns FFA_SUCCESS if the message is sent, or an error code otherwise:
+ *  - INVALID_PARAMETERS: one or more of the parameters do not conform.
+ *  - BUSY: receiver's mailbox was full.
+ *  - DENIED: receiver is not in a state to handle the request or doesn't
+ *    support indirect messages.
+ */
+static inline struct ffa_value ffa_msg_send2(uint32_t flags)
+{
+	return ffa_call((struct ffa_value){
+		.func = FFA_MSG_SEND2_32, .arg1 = 0, .arg2 = flags});
+}
+
 static inline struct ffa_value ffa_mem_donate(uint32_t length,
 					      uint32_t fragment_length)
 {
diff --git a/inc/vmapi/hf/ffa.h b/inc/vmapi/hf/ffa.h
index 43b9d30..3011105 100644
--- a/inc/vmapi/hf/ffa.h
+++ b/inc/vmapi/hf/ffa.h
@@ -372,6 +372,11 @@
 	return args.arg4;
 }
 
+static inline uint32_t ffa_msg_send2_flags(struct ffa_value args)
+{
+	return args.arg2;
+}
+
 static inline uint32_t ffa_partition_info_get_count(struct ffa_value args)
 {
 	return args.arg2;