Using SPCI memory sharing functions rather than MSG_SEND.
Bug: 132420445
Change-Id: I1d29ebfdf179c7a7c07223f8c027c22c055d333a
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index f2455e2..5d217da 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -131,6 +131,33 @@
.arg4 = attributes});
}
+static inline struct spci_value spci_mem_donate(
+ uint32_t remaining_fragment_count, uint32_t length, uint32_t handle)
+{
+ return spci_call((struct spci_value){.func = SPCI_MEM_DONATE_32,
+ .arg3 = remaining_fragment_count,
+ .arg4 = length,
+ .arg5 = handle});
+}
+
+static inline struct spci_value spci_mem_lend(uint32_t remaining_fragment_count,
+ uint32_t length, uint32_t handle)
+{
+ return spci_call((struct spci_value){.func = SPCI_MEM_LEND_32,
+ .arg3 = remaining_fragment_count,
+ .arg4 = length,
+ .arg5 = handle});
+}
+
+static inline struct spci_value spci_mem_share(
+ uint32_t remaining_fragment_count, uint32_t length, uint32_t handle)
+{
+ return spci_call((struct spci_value){.func = SPCI_MEM_SHARE_32,
+ .arg3 = remaining_fragment_count,
+ .arg4 = length,
+ .arg5 = handle});
+}
+
/**
* Called by secondary VMs to receive a message. This will block until a message
* is received.
diff --git a/inc/vmapi/hf/spci.h b/inc/vmapi/hf/spci.h
index 12600c1..e42c8d5 100644
--- a/inc/vmapi/hf/spci.h
+++ b/inc/vmapi/hf/spci.h
@@ -43,6 +43,9 @@
#define SPCI_MSG_SEND_32 0x8400006E
#define SPCI_MSG_SEND_DIRECT_REQ_32 0x8400006F
#define SPCI_MSG_SEND_DIRECT_RESP_32 0x84000070
+#define SPCI_MEM_DONATE_32 0x84000071
+#define SPCI_MEM_LEND_32 0x84000072
+#define SPCI_MEM_SHARE_32 0x84000073
/* SPCI error codes. */
#define SPCI_NOT_SUPPORTED INT32_C(-1)