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/test/hftest/service.c b/test/hftest/service.c
index 72efa7d..3031772 100644
--- a/test/hftest/service.c
+++ b/test/hftest/service.c
@@ -102,7 +102,7 @@
hf_vm_configure(send_addr, recv_addr);
/* Receive the name of the service to run. */
- spci_msg_recv(SPCI_MSG_RECV_BLOCK);
+ spci_msg_wait();
memiter_init(&args, recv_msg->payload, recv_msg->length);
service = find_service(&args);
hf_mailbox_clear();
diff --git a/test/linux/hftest_socket.c b/test/linux/hftest_socket.c
index 0b69ea7..7a9d7f1 100644
--- a/test/linux/hftest_socket.c
+++ b/test/linux/hftest_socket.c
@@ -83,7 +83,7 @@
struct spci_message *recv_buf = (struct spci_message *)recv;
/* Receive the packet. */
- spci_msg_recv(SPCI_MSG_RECV_BLOCK);
+ spci_msg_wait();
EXPECT_LE(recv_buf->length, SPCI_MSG_PAYLOAD_MAX);
/* Echo the message back to the sender. */
diff --git a/test/vmapi/gicv3/services/common.c b/test/vmapi/gicv3/services/common.c
index b6edc56..d5d3cd2 100644
--- a/test/vmapi/gicv3/services/common.c
+++ b/test/vmapi/gicv3/services/common.c
@@ -28,7 +28,7 @@
int32_t received;
do {
- received = spci_msg_recv(SPCI_MSG_RECV_BLOCK);
+ received = spci_msg_wait();
} while (received == SPCI_INTERRUPTED);
return received;
diff --git a/test/vmapi/gicv3/services/timer.c b/test/vmapi/gicv3/services/timer.c
index 0cc7341..d99aa78 100644
--- a/test/vmapi/gicv3/services/timer.c
+++ b/test/vmapi/gicv3/services/timer.c
@@ -113,7 +113,7 @@
event_wait();
}
} else if (receive) {
- int32_t res = spci_msg_recv(SPCI_MSG_RECV_BLOCK);
+ int32_t res = spci_msg_wait();
EXPECT_EQ(res, SPCI_INTERRUPTED);
} else {
diff --git a/test/vmapi/primary_with_secondaries/no_services.c b/test/vmapi/primary_with_secondaries/no_services.c
index 975ea6d..2f2c0b5 100644
--- a/test/vmapi/primary_with_secondaries/no_services.c
+++ b/test/vmapi/primary_with_secondaries/no_services.c
@@ -146,7 +146,7 @@
*/
TEST(hf_mailbox_receive, cannot_receive_from_primary_blocking)
{
- int32_t res = spci_msg_recv(SPCI_MSG_RECV_BLOCK);
+ int32_t res = spci_msg_wait();
EXPECT_NE(res, SPCI_SUCCESS);
}
@@ -155,6 +155,6 @@
*/
TEST(hf_mailbox_receive, cannot_receive_from_primary_non_blocking)
{
- int32_t res = spci_msg_recv(0);
+ int32_t res = spci_msg_poll();
EXPECT_NE(res, SPCI_SUCCESS);
}
diff --git a/test/vmapi/primary_with_secondaries/services/echo.c b/test/vmapi/primary_with_secondaries/services/echo.c
index 04cb6a3..a9d5b02 100644
--- a/test/vmapi/primary_with_secondaries/services/echo.c
+++ b/test/vmapi/primary_with_secondaries/services/echo.c
@@ -25,7 +25,7 @@
{
/* Loop, echo messages back to the sender. */
for (;;) {
- spci_msg_recv(SPCI_MSG_RECV_BLOCK);
+ spci_msg_wait();
struct spci_message *send_buf = SERVICE_SEND_BUFFER();
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
diff --git a/test/vmapi/primary_with_secondaries/services/echo_with_notification.c b/test/vmapi/primary_with_secondaries/services/echo_with_notification.c
index 03dcfd4..b32a6f6 100644
--- a/test/vmapi/primary_with_secondaries/services/echo_with_notification.c
+++ b/test/vmapi/primary_with_secondaries/services/echo_with_notification.c
@@ -53,7 +53,7 @@
/* Loop, echo messages back to the sender. */
for (;;) {
- spci_msg_recv(SPCI_MSG_RECV_BLOCK);
+ spci_msg_wait();
struct spci_message *send_buf = SERVICE_SEND_BUFFER();
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
diff --git a/test/vmapi/primary_with_secondaries/services/interruptible.c b/test/vmapi/primary_with_secondaries/services/interruptible.c
index 5a04515..adc9b16 100644
--- a/test/vmapi/primary_with_secondaries/services/interruptible.c
+++ b/test/vmapi/primary_with_secondaries/services/interruptible.c
@@ -56,7 +56,7 @@
int32_t received;
do {
- received = spci_msg_recv(SPCI_MSG_RECV_BLOCK);
+ received = spci_msg_wait();
} while (received == SPCI_INTERRUPTED);
return received;
diff --git a/test/vmapi/primary_with_secondaries/services/interruptible_echo.c b/test/vmapi/primary_with_secondaries/services/interruptible_echo.c
index 296065f..07a4cbc 100644
--- a/test/vmapi/primary_with_secondaries/services/interruptible_echo.c
+++ b/test/vmapi/primary_with_secondaries/services/interruptible_echo.c
@@ -38,14 +38,14 @@
arch_irq_enable();
for (;;) {
- uint32_t res = spci_msg_recv(SPCI_MSG_RECV_BLOCK);
+ uint32_t res = spci_msg_wait();
struct spci_message *message = SERVICE_SEND_BUFFER();
struct spci_message *recv_message = SERVICE_RECV_BUFFER();
/* Retry if interrupted but made visible with the yield. */
while (res == SPCI_INTERRUPTED) {
spci_yield();
- res = spci_msg_recv(SPCI_MSG_RECV_BLOCK);
+ res = spci_msg_wait();
}
memcpy_s(message->payload, SPCI_MSG_PAYLOAD_MAX,
diff --git a/test/vmapi/primary_with_secondaries/services/memory.c b/test/vmapi/primary_with_secondaries/services/memory.c
index cfd05f6..fbd7cb1 100644
--- a/test/vmapi/primary_with_secondaries/services/memory.c
+++ b/test/vmapi/primary_with_secondaries/services/memory.c
@@ -28,7 +28,7 @@
{
/* Loop, writing message to the shared memory. */
for (;;) {
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), 0);
+ EXPECT_EQ(spci_msg_wait(), 0);
uint8_t *ptr;
size_t i;
@@ -60,7 +60,7 @@
{
/* Loop, giving memory back to the sender. */
for (;;) {
- spci_msg_recv(SPCI_MSG_RECV_BLOCK);
+ spci_msg_wait();
uint8_t *ptr;
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
@@ -98,7 +98,7 @@
{
/* Loop, giving memory back to the sender. */
for (;;) {
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), 0);
+ EXPECT_EQ(spci_msg_wait(), 0);
uint8_t *ptr;
/* Check the memory was cleared. */
@@ -179,7 +179,7 @@
{
/* Loop, giving memory back to the sender. */
for (;;) {
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), 0);
+ EXPECT_EQ(spci_msg_wait(), 0);
uint8_t *ptr;
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
@@ -211,7 +211,7 @@
TEST_SERVICE(spci_donate_check_upper_bound)
{
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), 0);
+ EXPECT_EQ(spci_msg_wait(), 0);
uint8_t *ptr;
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
@@ -227,7 +227,7 @@
TEST_SERVICE(spci_donate_check_lower_bound)
{
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), 0);
+ EXPECT_EQ(spci_msg_wait(), 0);
uint8_t *ptr;
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
@@ -246,7 +246,7 @@
*/
TEST_SERVICE(spci_donate_secondary_and_fault)
{
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), 0);
+ EXPECT_EQ(spci_msg_wait(), 0);
uint8_t *ptr;
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
@@ -274,7 +274,7 @@
*/
TEST_SERVICE(spci_donate_twice)
{
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), 0);
+ EXPECT_EQ(spci_msg_wait(), 0);
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
struct spci_message *send_buf = SERVICE_SEND_BUFFER();
@@ -307,7 +307,7 @@
TEST_SERVICE(spci_memory_receive)
{
for (;;) {
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), 0);
+ EXPECT_EQ(spci_msg_wait(), 0);
uint8_t *ptr;
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
@@ -330,7 +330,7 @@
*/
TEST_SERVICE(spci_donate_invalid_source)
{
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), 0);
+ EXPECT_EQ(spci_msg_wait(), 0);
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
struct spci_message *send_buf = SERVICE_SEND_BUFFER();
@@ -356,7 +356,7 @@
{
/* Loop, giving memory back to the sender. */
for (;;) {
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), SPCI_SUCCESS);
+ EXPECT_EQ(spci_msg_wait(), SPCI_SUCCESS);
uint8_t *ptr;
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
@@ -396,7 +396,7 @@
TEST_SERVICE(spci_memory_donate_relinquish)
{
for (;;) {
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), SPCI_SUCCESS);
+ EXPECT_EQ(spci_msg_wait(), SPCI_SUCCESS);
uint8_t *ptr;
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
@@ -429,7 +429,7 @@
*/
TEST_SERVICE(spci_lend_invalid_source)
{
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), SPCI_SUCCESS);
+ EXPECT_EQ(spci_msg_wait(), SPCI_SUCCESS);
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
struct spci_message *send_buf = SERVICE_SEND_BUFFER();
@@ -465,7 +465,7 @@
TEST_SERVICE(spci_memory_lend_relinquish_X)
{
for (;;) {
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), SPCI_SUCCESS);
+ EXPECT_EQ(spci_msg_wait(), SPCI_SUCCESS);
uint64_t *ptr;
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
@@ -499,7 +499,7 @@
TEST_SERVICE(spci_memory_lend_relinquish_RW)
{
for (;;) {
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), SPCI_SUCCESS);
+ EXPECT_EQ(spci_msg_wait(), SPCI_SUCCESS);
uint8_t *ptr;
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
@@ -537,7 +537,7 @@
*/
TEST_SERVICE(spci_lend_check_lower_bound)
{
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), SPCI_SUCCESS);
+ EXPECT_EQ(spci_msg_wait(), SPCI_SUCCESS);
uint8_t *ptr;
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
@@ -557,7 +557,7 @@
*/
TEST_SERVICE(spci_lend_check_upper_bound)
{
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), SPCI_SUCCESS);
+ EXPECT_EQ(spci_msg_wait(), SPCI_SUCCESS);
uint8_t *ptr;
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
@@ -574,7 +574,7 @@
TEST_SERVICE(spci_memory_lend_twice)
{
- EXPECT_EQ(spci_msg_recv(SPCI_MSG_RECV_BLOCK), SPCI_SUCCESS);
+ EXPECT_EQ(spci_msg_wait(), SPCI_SUCCESS);
uint8_t *ptr;
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
diff --git a/test/vmapi/primary_with_secondaries/services/receive_block.c b/test/vmapi/primary_with_secondaries/services/receive_block.c
index 0b8a1b5..1b03506 100644
--- a/test/vmapi/primary_with_secondaries/services/receive_block.c
+++ b/test/vmapi/primary_with_secondaries/services/receive_block.c
@@ -46,7 +46,7 @@
hf_interrupt_enable(EXTERNAL_INTERRUPT_ID_A, true);
for (i = 0; i < 10; ++i) {
- int32_t res = spci_msg_recv(SPCI_MSG_RECV_BLOCK);
+ int32_t res = spci_msg_wait();
EXPECT_EQ(res, SPCI_INTERRUPTED);
}
diff --git a/test/vmapi/primary_with_secondaries/services/relay.c b/test/vmapi/primary_with_secondaries/services/relay.c
index 5ccda5f..86eed79 100644
--- a/test/vmapi/primary_with_secondaries/services/relay.c
+++ b/test/vmapi/primary_with_secondaries/services/relay.c
@@ -36,7 +36,7 @@
uint32_t next_message_size;
/* Receive the message to relay. */
- spci_msg_recv(SPCI_MSG_RECV_BLOCK);
+ spci_msg_wait();
/* Prepare to relay the message. */
struct spci_message *recv_buf = SERVICE_RECV_BUFFER();
diff --git a/test/vmapi/primary_with_secondaries/services/spci_check.c b/test/vmapi/primary_with_secondaries/services/spci_check.c
index d44da6a..1d626ba 100644
--- a/test/vmapi/primary_with_secondaries/services/spci_check.c
+++ b/test/vmapi/primary_with_secondaries/services/spci_check.c
@@ -41,7 +41,7 @@
};
/* Wait for single message to be sent by the primary VM. */
- spci_msg_recv(SPCI_MSG_RECV_BLOCK);
+ spci_msg_wait();
/* Ensure message header has all fields correctly set. */
EXPECT_EQ(recv_buf->flags, expected_message.flags);
@@ -70,7 +70,7 @@
const char message[] = "this should be truncated";
/* Wait for single message to be sent by the primary VM. */
- spci_msg_recv(SPCI_MSG_RECV_BLOCK);
+ spci_msg_wait();
/* Verify the length is as expected. */
EXPECT_EQ(16, recv_buf->length);
@@ -85,7 +85,7 @@
TEST_SERVICE(spci_recv_non_blocking)
{
/* Wait for single message to be sent by the primary VM. */
- EXPECT_EQ(spci_msg_recv(0), SPCI_RETRY);
+ EXPECT_EQ(spci_msg_poll(), SPCI_RETRY);
spci_yield();
}