diff options
author | sos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk> | 2006-07-28 14:03:54 +0100 |
---|---|---|
committer | sos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk> | 2006-07-28 14:03:54 +0100 |
commit | 194a6f6b1f79d6bb4c40ce2a4fdafd845be4f2ce (patch) | |
tree | 892fc21a6bbaf65f820c332ddfc72154c7ef0d17 /extras/mini-os | |
parent | a0f55d516b1eec2c53530338e6fab512586eea5f (diff) | |
download | xen-194a6f6b1f79d6bb4c40ce2a4fdafd845be4f2ce.tar.gz xen-194a6f6b1f79d6bb4c40ce2a4fdafd845be4f2ce.tar.bz2 xen-194a6f6b1f79d6bb4c40ce2a4fdafd845be4f2ce.zip |
[MINI-OS] Extend alloc_unbound so that the remote domain isn't always dom0.
Signed-off-by: John D. Ramsdell <ramsdell@mitre.org>
Signed-off-by: Steven Smith <sos22@cam.ac.uk>
Diffstat (limited to 'extras/mini-os')
-rw-r--r-- | extras/mini-os/events.c | 32 | ||||
-rw-r--r-- | extras/mini-os/include/events.h | 4 |
2 files changed, 17 insertions, 19 deletions
diff --git a/extras/mini-os/events.c b/extras/mini-os/events.c index 641c86ceba..dfc1206c2e 100644 --- a/extras/mini-os/events.c +++ b/extras/mini-os/events.c @@ -141,25 +141,23 @@ void default_handler(evtchn_port_t port, struct pt_regs *regs, void *ignore) printk("[Port %d] - event received\n", port); } +/* Create a port available to the pal for exchanging notifications. + Returns the result of the hypervisor call. */ + /* Unfortunate confusion of terminology: the port is unbound as far as Xen is concerned, but we automatically bind a handler to it from inside mini-os. */ -evtchn_port_t evtchn_alloc_unbound(evtchn_handler_t handler, void *data) + +int evtchn_alloc_unbound(domid_t pal, evtchn_handler_t handler, + void *data, evtchn_port_t *port) { - evtchn_port_t port; - evtchn_op_t op; - int err; - - op.cmd = EVTCHNOP_alloc_unbound; - op.u.alloc_unbound.dom = DOMID_SELF; - op.u.alloc_unbound.remote_dom = 0; - - err = HYPERVISOR_event_channel_op(&op); - if (err) { - printk("Failed to alloc unbound evtchn: %d.\n", err); - return -1; - } - port = op.u.alloc_unbound.port; - bind_evtchn(port, handler, data); - return port; + evtchn_op_t op; + op.cmd = EVTCHNOP_alloc_unbound; + op.u.alloc_unbound.dom = DOMID_SELF; + op.u.alloc_unbound.remote_dom = pal; + int err = HYPERVISOR_event_channel_op(&op); + if (err) + return err; + *port = bind_evtchn(op.u.alloc_unbound.port, handler, data); + return err; } diff --git a/extras/mini-os/include/events.h b/extras/mini-os/include/events.h index 1ffcecb61b..f0133621f8 100644 --- a/extras/mini-os/include/events.h +++ b/extras/mini-os/include/events.h @@ -31,8 +31,8 @@ evtchn_port_t bind_evtchn(evtchn_port_t port, evtchn_handler_t handler, void *data); void unbind_evtchn(evtchn_port_t port); void init_events(void); -evtchn_port_t evtchn_alloc_unbound(evtchn_handler_t handler, - void *data); +int evtchn_alloc_unbound(domid_t pal, evtchn_handler_t handler, + void *data, evtchn_port_t *port); static inline int notify_remote_via_evtchn(evtchn_port_t port) { |