SPCI: Introduce SPCI_MSG_SEND.
Morph the vmapi service HF_MAILBOX_SEND onto SPCI_MSG_SEND.
The current SPCI_MSG_SEND only allows for implementation defined
messages to be exchanged between VMs.
The new SPCI service returns SPCI_SUCCESS if message is delivered or one
of the following error codes:
SPCI_INVALID_PARAMETER: one of the parameters in the header does
not conform;
SPCI_BUSY: the mailbox was full or the target VM does not exist.
Adapted the tests to this new service.
Added tests specific to spci_message_init and spci_msg_send.
Change-Id: I55adfe68502ddc7bf864432f3e567b6cfe785f92
diff --git a/test/hftest/hftest_service.c b/test/hftest/hftest_service.c
index 9850a07..2a1b2a0 100644
--- a/test/hftest/hftest_service.c
+++ b/test/hftest/hftest_service.c
@@ -20,6 +20,7 @@
#include "hf/arch/std.h"
#include "hf/memiter.h"
+#include "hf/spci.h"
#include "vmapi/hf/call.h"
@@ -80,17 +81,18 @@
{
struct memiter args;
hftest_test_fn service;
- struct hf_mailbox_receive_return res;
struct hftest_context *ctx;
+ struct spci_message *recv_msg = (struct spci_message *)recv;
+
/* Prepare the context. */
/* Set up the mailbox. */
hf_vm_configure(send_addr, recv_addr);
/* Receive the name of the service to run. */
- res = hf_mailbox_receive(true);
- memiter_init(&args, recv, res.size);
+ hf_mailbox_receive(true);
+ memiter_init(&args, recv_msg->payload, recv_msg->length);
service = find_service(&args);
hf_mailbox_clear();
@@ -108,8 +110,8 @@
ctx = hftest_get_context();
memset(ctx, 0, sizeof(*ctx));
ctx->abort = abort;
- ctx->send = send;
- ctx->recv = recv;
+ ctx->send = (struct spci_message *)send;
+ ctx->recv = (struct spci_message *)recv;
/* Pause so the next time cycles are given the service will be run. */
hf_vcpu_yield();