Incorporate feedback on notification patches.
Change-Id: I15642cb739fae98de6fcd01b215821ace2b082ab
diff --git a/driver/linux b/driver/linux
index 2bf9cdd..ec84193 160000
--- a/driver/linux
+++ b/driver/linux
@@ -1 +1 @@
-Subproject commit 2bf9cdd2b08461ef13e51ebcc3a705d7750e17da
+Subproject commit ec841933379cacd66adfe2dde44e2a66161dcf06
diff --git a/inc/hf/vm.h b/inc/hf/vm.h
index 75096a5..c29b6bc 100644
--- a/inc/hf/vm.h
+++ b/inc/hf/vm.h
@@ -82,7 +82,7 @@
struct mailbox mailbox;
/** Wait entries to be used when waiting on other VM mailboxes. */
- struct wait_entry wentry[MAX_VMS];
+ struct wait_entry wait_entries[MAX_VMS];
};
/** Encapsulates a VM whose lock is held. */
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index b0345e2..73c7e66 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -162,7 +162,7 @@
* the notify argument set to true, and this call must have failed because the
* mailbox was not available.
*
- * It should be called repeatedly to retreive a list of VMs.
+ * It should be called repeatedly to retrieve a list of VMs.
*
* Returns -1 if no VM became writable, or the id of the VM whose mailbox
* became writable.
@@ -176,8 +176,8 @@
* Retrieves the next VM waiting to be notified that the mailbox of the
* specified VM became writable. Only primary VMs are allowed to call this.
*
- * Returns -1 if there are no waiters, or the VM id of the next waiter
- * otherwise.
+ * Returns -1 on failure or if there are no waiters; the VM id of the next
+ * waiter otherwise.
*/
static inline int64_t hf_mailbox_waiter_get(uint32_t vm_id)
{
diff --git a/inc/vmapi/hf/types.h b/inc/vmapi/hf/types.h
index f0b39d9..bc6aae6 100644
--- a/inc/vmapi/hf/types.h
+++ b/inc/vmapi/hf/types.h
@@ -47,7 +47,7 @@
#define HF_INVALID_INTID 0xffffffff
/** Interrupt ID indicating the mailbox is readable. */
-#define HF_MAILBOX_READBLE_INTID 1
+#define HF_MAILBOX_READABLE_INTID 1
/** Interrupt ID indicating a mailbox is writable. */
#define HF_MAILBOX_WRITABLE_INTID 2
diff --git a/src/api.c b/src/api.c
index b17d101..1161230 100644
--- a/src/api.c
+++ b/src/api.c
@@ -540,7 +540,8 @@
* setting up for notification if requested.
*/
if (notify) {
- struct wait_entry *entry = ¤t->vm->wentry[vm_id];
+ struct wait_entry *entry =
+ ¤t->vm->wait_entries[vm_id];
/* Append waiter only if it's not there yet. */
if (list_empty(&entry->wait_links)) {
@@ -714,7 +715,7 @@
entry = CONTAINER_OF(vm->mailbox.ready_list.next, struct wait_entry,
ready_links);
list_remove(&entry->ready_links);
- ret = entry - vm->wentry;
+ ret = entry - vm->wait_entries;
exit:
sl_unlock(&vm->lock);
@@ -725,8 +726,8 @@
* Retrieves the next VM waiting to be notified that the mailbox of the
* specified VM became writable. Only primary VMs are allowed to call this.
*
- * Returns -1 if there are no waiters, or the VM id of the next waiter
- * otherwise.
+ * Returns -1 on failure or if there are no waiters; the VM id of the next
+ * waiter otherwise.
*/
int64_t api_mailbox_waiter_get(uint32_t vm_id, const struct vcpu *current)
{
diff --git a/src/vm.c b/src/vm.c
index 9bc616f..38a9328 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -52,9 +52,9 @@
/* Initialise waiter entries. */
for (i = 0; i < MAX_VMS; i++) {
- vm->wentry[i].waiting_vm = vm;
- list_init(&vm->wentry[i].wait_links);
- list_init(&vm->wentry[i].ready_links);
+ vm->wait_entries[i].waiting_vm = vm;
+ list_init(&vm->wait_entries[i].wait_links);
+ list_init(&vm->wait_entries[i].ready_links);
}
/* Do basic initialization of vcpus. */
diff --git a/test/vmapi/primary_with_secondaries/with_services.c b/test/vmapi/primary_with_secondaries/with_services.c
index cd7008a..bc52550 100644
--- a/test/vmapi/primary_with_secondaries/with_services.c
+++ b/test/vmapi/primary_with_secondaries/with_services.c
@@ -248,7 +248,7 @@
/* Clear the mailbox. We expect to be told there are pending waiters. */
EXPECT_EQ(hf_mailbox_clear(), 1);
- /* Retrieve two waiters. */
+ /* Retrieve a single waiter. */
EXPECT_EQ(hf_mailbox_waiter_get(HF_PRIMARY_VM_ID), SERVICE_VM0);
EXPECT_EQ(hf_mailbox_waiter_get(HF_PRIMARY_VM_ID), -1);
@@ -296,7 +296,7 @@
run_res = hf_vcpu_run(SERVICE_VM0, 0);
EXPECT_EQ(run_res.code, HF_VCPU_RUN_NOTIFY_WAITERS);
- /* Retrieve two waiters. */
+ /* Retrieve a single waiter. */
EXPECT_EQ(hf_mailbox_waiter_get(SERVICE_VM0), HF_PRIMARY_VM_ID);
EXPECT_EQ(hf_mailbox_waiter_get(SERVICE_VM0), -1);