SPCI: SPCI_YIELD.
Adapted hf_vcpu_yield to conform with the spci_yield specification.
Change-Id: I7ad11e83f068a09a19fd930dcead787b5a22e498
diff --git a/test/hftest/hftest_service.c b/test/hftest/hftest_service.c
index 1278617..5b9fafb 100644
--- a/test/hftest/hftest_service.c
+++ b/test/hftest/hftest_service.c
@@ -114,7 +114,7 @@
ctx->memory_size = memory_size;
/* Pause so the next time cycles are given the service will be run. */
- hf_vcpu_yield();
+ spci_yield();
/* Let the service run. */
service();
diff --git a/test/vmapi/primary_only/primary_only.c b/test/vmapi/primary_only/primary_only.c
index df19d32..6cb8f46 100644
--- a/test/vmapi/primary_only/primary_only.c
+++ b/test/vmapi/primary_only/primary_only.c
@@ -91,9 +91,9 @@
/**
* Yielding from the primary is a noop.
*/
-TEST(hf_vcpu_yield, yield_is_noop_for_primary)
+TEST(spci_yield, yield_is_noop_for_primary)
{
- hf_vcpu_yield();
+ EXPECT_EQ(spci_yield(), SPCI_SUCCESS);
}
/**
diff --git a/test/vmapi/primary_with_secondaries/services/boot.c b/test/vmapi/primary_with_secondaries/services/boot.c
index 965c5bb..4ca4390 100644
--- a/test/vmapi/primary_with_secondaries/services/boot.c
+++ b/test/vmapi/primary_with_secondaries/services/boot.c
@@ -47,7 +47,7 @@
ASSERT_NE(checksum, 0);
dlog("Checksum of all memory is %d\n", checksum);
- hf_vcpu_yield();
+ spci_yield();
}
TEST_SERVICE(boot_memory_underrun)
diff --git a/test/vmapi/primary_with_secondaries/services/floating_point.c b/test/vmapi/primary_with_secondaries/services/floating_point.c
index 2ba57c9..d98fdb9 100644
--- a/test/vmapi/primary_with_secondaries/services/floating_point.c
+++ b/test/vmapi/primary_with_secondaries/services/floating_point.c
@@ -27,8 +27,8 @@
{
const double value = 0.75;
fill_fp_registers(value);
- hf_vcpu_yield();
+ EXPECT_EQ(spci_yield(), SPCI_SUCCESS);
ASSERT_TRUE(check_fp_register(value));
- hf_vcpu_yield();
+ spci_yield();
}
diff --git a/test/vmapi/primary_with_secondaries/services/interruptible_echo.c b/test/vmapi/primary_with_secondaries/services/interruptible_echo.c
index 760998c..296065f 100644
--- a/test/vmapi/primary_with_secondaries/services/interruptible_echo.c
+++ b/test/vmapi/primary_with_secondaries/services/interruptible_echo.c
@@ -44,7 +44,7 @@
/* Retry if interrupted but made visible with the yield. */
while (res == SPCI_INTERRUPTED) {
- hf_vcpu_yield();
+ spci_yield();
res = spci_msg_recv(SPCI_MSG_RECV_BLOCK);
}
diff --git a/test/vmapi/primary_with_secondaries/services/memory.c b/test/vmapi/primary_with_secondaries/services/memory.c
index 0175577..f17932c 100644
--- a/test/vmapi/primary_with_secondaries/services/memory.c
+++ b/test/vmapi/primary_with_secondaries/services/memory.c
@@ -42,7 +42,7 @@
}
/* Allow the memory to be populated. */
- hf_vcpu_yield();
+ EXPECT_EQ(spci_yield(), SPCI_SUCCESS);
/* Increment each byte of memory. */
for (i = 0; i < PAGE_SIZE; ++i) {
diff --git a/test/vmapi/primary_with_secondaries/services/spci_check.c b/test/vmapi/primary_with_secondaries/services/spci_check.c
index 4f4ce6e..d44da6a 100644
--- a/test/vmapi/primary_with_secondaries/services/spci_check.c
+++ b/test/vmapi/primary_with_secondaries/services/spci_check.c
@@ -61,7 +61,7 @@
/* Ensure that the payload was correctly transmitted. */
EXPECT_EQ(memcmp(recv_buf->payload, message, sizeof(message)), 0);
- hf_vcpu_yield();
+ spci_yield();
}
TEST_SERVICE(spci_length)
@@ -79,7 +79,7 @@
EXPECT_NE(memcmp(recv_buf->payload, message, sizeof(message)), 0);
EXPECT_EQ(memcmp(recv_buf->payload, message, recv_buf->length), 0);
- hf_vcpu_yield();
+ spci_yield();
}
TEST_SERVICE(spci_recv_non_blocking)
@@ -87,5 +87,5 @@
/* Wait for single message to be sent by the primary VM. */
EXPECT_EQ(spci_msg_recv(0), SPCI_RETRY);
- hf_vcpu_yield();
+ spci_yield();
}