aboutsummaryrefslogtreecommitdiff
path: root/include/hw/hyperv/hyperv.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/hw/hyperv/hyperv.h')
-rw-r--r--include/hw/hyperv/hyperv.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/hw/hyperv/hyperv.h b/include/hw/hyperv/hyperv.h
index df92ed7e66..597381cb01 100644
--- a/include/hw/hyperv/hyperv.h
+++ b/include/hw/hyperv/hyperv.h
@@ -40,6 +40,18 @@ int hyperv_post_msg(HvSintRoute *sint_route, struct hyperv_message *msg);
int hyperv_set_event_flag(HvSintRoute *sint_route, unsigned eventno);
/*
+ * Handler for messages arriving from the guest via HV_POST_MESSAGE hypercall.
+ * Executed in vcpu context.
+ */
+typedef uint16_t (*HvMsgHandler)(const struct hyperv_post_message_input *msg,
+ void *data);
+/*
+ * Associate @handler with the message connection @conn_id, such that @handler
+ * is called with @data when the guest executes HV_POST_MESSAGE hypercall on
+ * @conn_id. If @handler is NULL clear the association.
+ */
+int hyperv_set_msg_handler(uint32_t conn_id, HvMsgHandler handler, void *data);
+/*
* Associate @notifier with the event connection @conn_id, such that @notifier
* is signaled when the guest executes HV_SIGNAL_EVENT hypercall on @conn_id.
* If @notifier is NULL clear the association.
@@ -47,6 +59,12 @@ int hyperv_set_event_flag(HvSintRoute *sint_route, unsigned eventno);
int hyperv_set_event_flag_handler(uint32_t conn_id, EventNotifier *notifier);
/*
+ * Process HV_POST_MESSAGE hypercall: parse the data in the guest memory as
+ * specified in @param, and call the HvMsgHandler associated with the
+ * connection on the message contained therein.
+ */
+uint16_t hyperv_hcall_post_message(uint64_t param, bool fast);
+/*
* Process HV_SIGNAL_EVENT hypercall: signal the EventNotifier associated with
* the connection as specified in @param.
*/