SPCI: SPCI_MSG_RECV.
Morph the existing vmapi api_mailbox_receive onto
api_spci_msg_recv.
Change-Id: Ie78f8985cfc55509fcd71eece22d6397b52d717d
diff --git a/inc/hf/api.h b/inc/hf/api.h
index e588575..c63f95c 100644
--- a/inc/hf/api.h
+++ b/inc/hf/api.h
@@ -32,9 +32,6 @@
struct vcpu **next);
int64_t api_vm_configure(ipaddr_t send, ipaddr_t recv, struct vcpu *current,
struct vcpu **next);
-struct hf_mailbox_receive_return api_mailbox_receive(bool block,
- struct vcpu *current,
- struct vcpu **next);
int64_t api_mailbox_clear(struct vcpu *current, struct vcpu **next);
int64_t api_mailbox_writable_get(const struct vcpu *current);
int64_t api_mailbox_waiter_get(uint32_t vm_id, const struct vcpu *current);
@@ -54,3 +51,5 @@
int32_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);
diff --git a/inc/hf/vm.h b/inc/hf/vm.h
index 069a265..9511d0d 100644
--- a/inc/hf/vm.h
+++ b/inc/hf/vm.h
@@ -54,8 +54,6 @@
struct mailbox {
enum mailbox_state state;
- uint32_t recv_from_id;
- int16_t recv_bytes;
struct spci_message *recv;
const struct spci_message *send;
diff --git a/inc/vmapi/hf/abi.h b/inc/vmapi/hf/abi.h
index c24700c..f46ed29 100644
--- a/inc/vmapi/hf/abi.h
+++ b/inc/vmapi/hf/abi.h
@@ -101,11 +101,6 @@
};
};
-struct hf_mailbox_receive_return {
- uint32_t vm_id;
- uint32_t size;
-};
-
enum hf_share {
/**
* Relinquish ownership and access to the memory and pass them to the
@@ -182,24 +177,3 @@
return ret;
}
-
-/**
- * Encode an hf_mailbox_receive_return struct in the 64-bit packing ABI.
- */
-static inline uint64_t hf_mailbox_receive_return_encode(
- struct hf_mailbox_receive_return res)
-{
- return res.vm_id | ((uint64_t)res.size << 32);
-}
-
-/**
- * Decode an hf_mailbox_receive_return struct from the 64-bit packing ABI.
- */
-static inline struct hf_mailbox_receive_return hf_mailbox_receive_return_decode(
- uint64_t res)
-{
- return (struct hf_mailbox_receive_return){
- .vm_id = (uint32_t)(res & 0xffffffff),
- .size = (uint32_t)(res >> 32),
- };
-}
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index 8bc9627..a10517c 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -30,7 +30,6 @@
#define HF_VCPU_RUN 0xff03
#define HF_VCPU_YIELD 0xff04
#define HF_VM_CONFIGURE 0xff05
-#define HF_MAILBOX_RECEIVE 0xff07
#define HF_MAILBOX_CLEAR 0xff08
#define HF_MAILBOX_WRITABLE_GET 0xff09
#define HF_MAILBOX_WAITER_GET 0xff0a
@@ -140,10 +139,9 @@
* instruction on aarch64, except that a message becoming available is also
* treated like a wake-up event.
*/
-static inline struct hf_mailbox_receive_return hf_mailbox_receive(bool block)
+static inline int32_t spci_msg_recv(int32_t attributes)
{
- return hf_mailbox_receive_return_decode(
- hf_call(HF_MAILBOX_RECEIVE, block, 0, 0));
+ return hf_call(SPCI_MSG_RECV_32, attributes, 0, 0);
}
/**