ia64/xen-unstable

changeset 10851:cbfced5fcdb3

[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>
author sos22@douglas.cl.cam.ac.uk
date Fri Jul 28 14:05:02 2006 +0100 (2006-07-28)
parents 97ffb7856239
children 4a669bd50657
files extras/mini-os/events.c extras/mini-os/include/events.h
line diff
     1.1 --- a/extras/mini-os/events.c	Fri Jul 28 14:03:54 2006 +0100
     1.2 +++ b/extras/mini-os/events.c	Fri Jul 28 14:05:02 2006 +0100
     1.3 @@ -161,3 +161,23 @@ int evtchn_alloc_unbound(domid_t pal, ev
     1.4      *port = bind_evtchn(op.u.alloc_unbound.port, handler, data);
     1.5      return err;
     1.6  }
     1.7 +
     1.8 +/* Connect to a port so as to allow the exchange of notifications with
     1.9 +   the pal. Returns the result of the hypervisor call. */
    1.10 +
    1.11 +int evtchn_bind_interdomain(domid_t pal, evtchn_port_t remote_port,
    1.12 +			    evtchn_handler_t handler, void *data,
    1.13 +			    evtchn_port_t *local_port)
    1.14 +{
    1.15 +    evtchn_op_t op;
    1.16 +    op.cmd = EVTCHNOP_bind_interdomain;
    1.17 +    op.u.bind_interdomain.remote_dom = pal;
    1.18 +    op.u.bind_interdomain.remote_port = remote_port;
    1.19 +    int err = HYPERVISOR_event_channel_op(&op);
    1.20 +    if (err)
    1.21 +		return err;
    1.22 +	evtchn_port_t port = op.u.bind_interdomain.local_port;
    1.23 +    clear_evtchn(port);	      /* Without, handler gets invoked now! */
    1.24 +    *local_port = bind_evtchn(port, handler, data);
    1.25 +    return err;
    1.26 +}
     2.1 --- a/extras/mini-os/include/events.h	Fri Jul 28 14:03:54 2006 +0100
     2.2 +++ b/extras/mini-os/include/events.h	Fri Jul 28 14:05:02 2006 +0100
     2.3 @@ -33,6 +33,9 @@ void unbind_evtchn(evtchn_port_t port);
     2.4  void init_events(void);
     2.5  int evtchn_alloc_unbound(domid_t pal, evtchn_handler_t handler,
     2.6  						 void *data, evtchn_port_t *port);
     2.7 +int evtchn_bind_interdomain(domid_t pal, evtchn_port_t remote_port,
     2.8 +							evtchn_handler_t handler, void *data,
     2.9 +							evtchn_port_t *local_port);
    2.10  
    2.11  static inline int notify_remote_via_evtchn(evtchn_port_t port)
    2.12  {