Add support for notifying VMs when mailboxes become writable.

This allows VMs to know when they can retry sending messages to another
VM after an attempt fails because the recipient's mailbox is not
available.

Change-Id: Ib20159f7ecf81544e40149edcd663876c58851c7
diff --git a/src/abi_test.cc b/src/abi_test.cc
index 11ab032..fc64547 100644
--- a/src/abi_test.cc
+++ b/src/abi_test.cc
@@ -211,4 +211,24 @@
 	EXPECT_THAT(res.size, Eq(0x8badf00d));
 }
 
+/**
+ * Encode a 'notify waiters' response without leaking.
+ */
+TEST(abi, hf_vcpu_run_return_encode_interrupt)
+{
+	struct hf_vcpu_run_return res = dirty_vcpu_run_return();
+	res.code = HF_VCPU_RUN_NOTIFY_WAITERS;
+	EXPECT_THAT(hf_vcpu_run_return_encode(res), Eq(6));
+}
+
+/**
+ * Decode a 'notify waiters' response ignoring the irrelevant bits.
+ */
+TEST(abi, hf_vcpu_run_return_decode_interrupt)
+{
+	struct hf_vcpu_run_return res =
+		hf_vcpu_run_return_decode(0x1a1a1a1a2b2b2b06);
+	EXPECT_THAT(res.code, Eq(HF_VCPU_RUN_NOTIFY_WAITERS));
+}
+
 } /* namespace */