Use new SPCI beta function identifiers.
Note that this commit doesn't move to the new style of return values yet,
nor does it follow all the semantics of the new version.
Bug: 132395846
Change-Id: I02f41f2b84cfd9babd37aa5e2aae875da85f949e
diff --git a/inc/hf/api.h b/inc/hf/api.h
index a808e5d..e041c96 100644
--- a/inc/hf/api.h
+++ b/inc/hf/api.h
@@ -55,8 +55,7 @@
spci_return_t api_spci_msg_send(uint32_t attributes, struct vcpu *current,
struct vcpu **next);
-int32_t api_spci_msg_recv(uint32_t attributes, struct vcpu *current,
- struct vcpu **next);
+int32_t api_spci_msg_recv(bool block, struct vcpu *current, struct vcpu **next);
int32_t api_spci_yield(struct vcpu *current, struct vcpu **next);
int32_t api_spci_version(void);
spci_return_t api_spci_share_memory(struct vm_locked to_locked,
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index 67c8e35..9edc542 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -125,17 +125,16 @@
}
/**
- * Called by secondary VMs to receive a message. The call can optionally block
- * until a message is received.
+ * Called by secondary VMs to receive a message. This will block until a message
+ * is received.
*
* The mailbox must be cleared before a new message can be received.
*
- * If no message is immediately available, `block` is true, and there are no
- * enabled and pending interrupts (irrespective of whether interrupts are
- * enabled globally), then this will block until a message is available or an
- * enabled interrupt becomes pending. This matches the behaviour of the WFI
- * instruction on aarch64, except that a message becoming available is also
- * treated like a wake-up event.
+ * If no message is immediately available and there are no enabled and pending
+ * interrupts (irrespective of whether interrupts are enabled globally), then
+ * this will block until a message is available or an enabled interrupt becomes
+ * pending. This matches the behaviour of the WFI instruction on aarch64, except
+ * that a message becoming available is also treated like a wake-up event.
*
* Returns:
* - SPCI_SUCCESS if a message is successfully received.
@@ -143,9 +142,26 @@
* during the call.
* - SPCI_RETRY if there was no pending message, and `block` was false.
*/
-static inline int32_t spci_msg_recv(int32_t attributes)
+static inline int32_t spci_msg_wait(void)
{
- return hf_call(SPCI_MSG_RECV_32, attributes, 0, 0);
+ return hf_call(SPCI_MSG_WAIT_32, 0, 0, 0);
+}
+
+/**
+ * Called by secondary VMs to receive a message. The call will return whether or
+ * not a message is available.
+ *
+ * The mailbox must be cleared before a new message can be received.
+ *
+ * Returns:
+ * - SPCI_SUCCESS if a message is successfully received.
+ * - SPCI_INTERRUPTED if the caller is the primary VM or an interrupt happened
+ * during the call.
+ * - SPCI_RETRY if there was no pending message, and `block` was false.
+ */
+static inline int32_t spci_msg_poll(void)
+{
+ return hf_call(SPCI_MSG_POLL_32, 0, 0, 0);
}
/**
diff --git a/inc/vmapi/hf/spci.h b/inc/vmapi/hf/spci.h
index 98d4155..39fcaf1 100644
--- a/inc/vmapi/hf/spci.h
+++ b/inc/vmapi/hf/spci.h
@@ -26,24 +26,31 @@
#define SPCI_HIGH_32_ID 0x8400007F
/* SPCI function identifiers. */
-#define SPCI_VERSION_32 0x84000060
-#define SPCI_MSG_BUF_LIST_EXCHANGE_32 0x84000061
-#define SPCI_MSG_RECV_32 0x84000062
-#define SPCI_MSG_PUT_32 0x84000063
-#define SPCI_MSG_SEND_32 0x84000064
-#define SPCI_MSG_SEND_REC_32 0x84000065
-#define SPCI_RUN_32 0x84000066
-#define SPCI_YIELD_32 0x84000067
+#define SPCI_ERROR_32 0x84000060
+#define SPCI_SUCCESS_32 0x84000061
+#define SPCI_INTERRUPT_32 0x84000062
+#define SPCI_VERSION_32 0x84000063
+#define SPCI_RX_RELEASE_32 0x84000064
+#define SPCI_RXTX_MAP_32 0x84000065
+#define SPCI_RXTX_UNMAP_32 0x84000066
+#define SPCI_PARTITION_INFO_GET_32 0x84000067
+#define SPCI_ID_GET_32 0x84000068
+#define SPCI_MSG_WAIT_32 0x84000069
+#define SPCI_MSG_POLL_32 0x8400006A
+#define SPCI_YIELD_32 0x8400006B
+#define SPCI_MSG_SEND_32 0x8400006C
+#define SPCI_RUN_32 0x8400006D
+#define SPCI_MSG_SEND_DIRECT_REQ_32 0x8400006E
+#define SPCI_MSG_SEND_DIRECT_RESP_32 0x8400006F
-/* SPCI return codes. */
#define SPCI_SUCCESS INT32_C(0)
+/* SPCI error codes. */
#define SPCI_NOT_SUPPORTED INT32_C(-1)
#define SPCI_INVALID_PARAMETERS INT32_C(-2)
#define SPCI_NO_MEMORY INT32_C(-3)
#define SPCI_BUSY INT32_C(-4)
#define SPCI_INTERRUPTED INT32_C(-5)
#define SPCI_DENIED INT32_C(-6)
-/* TODO: return code currently undefined in SPCI alpha2. */
#define SPCI_RETRY INT32_C(-7)
/* Architected memory sharing message IDs. */