aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/events.c
diff options
context:
space:
mode:
authorsos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk>2006-07-28 14:05:02 +0100
committersos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk>2006-07-28 14:05:02 +0100
commite573f4fac04be1866b13b08a31627c7dad06538f (patch)
tree314d6a6a71e4ea6de50b9a5c9d8c7a170f33fd94 /extras/mini-os/events.c
parent194a6f6b1f79d6bb4c40ce2a4fdafd845be4f2ce (diff)
downloadxen-e573f4fac04be1866b13b08a31627c7dad06538f.tar.gz
xen-e573f4fac04be1866b13b08a31627c7dad06538f.tar.bz2
xen-e573f4fac04be1866b13b08a31627c7dad06538f.zip
[MINI-OS] Add evtchn_bind_interdomain to mini-os, allowing clients to
bind to interdomain event channels. Signed-off-by: John D. Ramsdell <ramsdell@mitre.org> Signed-off-by: Steven Smith <sos22@cam.ac.uk>
Diffstat (limited to 'extras/mini-os/events.c')
-rw-r--r--extras/mini-os/events.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/extras/mini-os/events.c b/extras/mini-os/events.c
index dfc1206c2e..57e835225d 100644
--- a/extras/mini-os/events.c
+++ b/extras/mini-os/events.c
@@ -161,3 +161,23 @@ int evtchn_alloc_unbound(domid_t pal, evtchn_handler_t handler,
*port = bind_evtchn(op.u.alloc_unbound.port, handler, data);
return err;
}
+
+/* Connect to a port so as to allow the exchange of notifications with
+ the pal. Returns the result of the hypervisor call. */
+
+int evtchn_bind_interdomain(domid_t pal, evtchn_port_t remote_port,
+ evtchn_handler_t handler, void *data,
+ evtchn_port_t *local_port)
+{
+ evtchn_op_t op;
+ op.cmd = EVTCHNOP_bind_interdomain;
+ op.u.bind_interdomain.remote_dom = pal;
+ op.u.bind_interdomain.remote_port = remote_port;
+ int err = HYPERVISOR_event_channel_op(&op);
+ if (err)
+ return err;
+ evtchn_port_t port = op.u.bind_interdomain.local_port;
+ clear_evtchn(port); /* Without, handler gets invoked now! */
+ *local_port = bind_evtchn(port, handler, data);
+ return err;
+}