ia64/xen-unstable

changeset 11484:fc8ae086f706

[MINIOS] Fix to use new event-channel API properly.
Signed-off-by: Mark Williamson <mark.williamson@cl.cam.ac.uk>
author kaf24@firebug.cl.cam.ac.uk
date Fri Sep 15 11:07:25 2006 +0100 (2006-09-15)
parents e26948616552
children 6ca1a8ebfdf4
files extras/mini-os/events.c extras/mini-os/include/events.h extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
line diff
     1.1 --- a/extras/mini-os/events.c	Fri Sep 15 11:04:41 2006 +0100
     1.2 +++ b/extras/mini-os/events.c	Fri Sep 15 11:07:25 2006 +0100
     1.3 @@ -88,19 +88,18 @@ void unbind_evtchn(evtchn_port_t port )
     1.4  
     1.5  int bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)
     1.6  {
     1.7 -	evtchn_op_t op;
     1.8 +	evtchn_bind_virq_t op;
     1.9  
    1.10  	/* Try to bind the virq to a port */
    1.11 -	op.cmd = EVTCHNOP_bind_virq;
    1.12 -	op.u.bind_virq.virq = virq;
    1.13 -	op.u.bind_virq.vcpu = smp_processor_id();
    1.14 +	op.virq = virq;
    1.15 +	op.vcpu = smp_processor_id();
    1.16  
    1.17 -	if ( HYPERVISOR_event_channel_op(&op) != 0 )
    1.18 +	if ( HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq, &op) != 0 )
    1.19  	{
    1.20  		printk("Failed to bind virtual IRQ %d\n", virq);
    1.21  		return 1;
    1.22      }
    1.23 -    bind_evtchn(op.u.bind_virq.port, handler, data);
    1.24 +    bind_evtchn(op.port, handler, data);
    1.25  	return 0;
    1.26  }
    1.27  
    1.28 @@ -151,14 +150,13 @@ void default_handler(evtchn_port_t port,
    1.29  int evtchn_alloc_unbound(domid_t pal, evtchn_handler_t handler,
    1.30  						 void *data, evtchn_port_t *port)
    1.31  {
    1.32 -    evtchn_op_t op;
    1.33 -    op.cmd = EVTCHNOP_alloc_unbound;
    1.34 -    op.u.alloc_unbound.dom = DOMID_SELF;
    1.35 -    op.u.alloc_unbound.remote_dom = pal;
    1.36 -    int err = HYPERVISOR_event_channel_op(&op);
    1.37 +    evtchn_alloc_unbound_t op;
    1.38 +    op.dom = DOMID_SELF;
    1.39 +    op.remote_dom = pal;
    1.40 +    int err = HYPERVISOR_event_channel_op(EVTCHNOP_alloc_unbound, &op);
    1.41      if (err)
    1.42  		return err;
    1.43 -    *port = bind_evtchn(op.u.alloc_unbound.port, handler, data);
    1.44 +    *port = bind_evtchn(op.port, handler, data);
    1.45      return err;
    1.46  }
    1.47  
    1.48 @@ -169,14 +167,13 @@ int evtchn_bind_interdomain(domid_t pal,
    1.49  			    evtchn_handler_t handler, void *data,
    1.50  			    evtchn_port_t *local_port)
    1.51  {
    1.52 -    evtchn_op_t op;
    1.53 -    op.cmd = EVTCHNOP_bind_interdomain;
    1.54 -    op.u.bind_interdomain.remote_dom = pal;
    1.55 -    op.u.bind_interdomain.remote_port = remote_port;
    1.56 -    int err = HYPERVISOR_event_channel_op(&op);
    1.57 +    evtchn_bind_interdomain_t op;
    1.58 +    op.remote_dom = pal;
    1.59 +    op.remote_port = remote_port;
    1.60 +    int err = HYPERVISOR_event_channel_op(EVTCHNOP_bind_interdomain, &op);
    1.61      if (err)
    1.62  		return err;
    1.63 -	evtchn_port_t port = op.u.bind_interdomain.local_port;
    1.64 +	evtchn_port_t port = op.local_port;
    1.65      clear_evtchn(port);	      /* Without, handler gets invoked now! */
    1.66      *local_port = bind_evtchn(port, handler, data);
    1.67      return err;
     2.1 --- a/extras/mini-os/include/events.h	Fri Sep 15 11:04:41 2006 +0100
     2.2 +++ b/extras/mini-os/include/events.h	Fri Sep 15 11:07:25 2006 +0100
     2.3 @@ -39,10 +39,9 @@ int evtchn_bind_interdomain(domid_t pal,
     2.4  
     2.5  static inline int notify_remote_via_evtchn(evtchn_port_t port)
     2.6  {
     2.7 -    evtchn_op_t op;
     2.8 -    op.cmd = EVTCHNOP_send;
     2.9 -    op.u.send.port = port;
    2.10 -    return HYPERVISOR_event_channel_op(&op);
    2.11 +    evtchn_send_t op;
    2.12 +    op.port = port;
    2.13 +    return HYPERVISOR_event_channel_op(EVTCHNOP_send, &op);
    2.14  }
    2.15  
    2.16  
     3.1 --- a/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h	Fri Sep 15 11:04:41 2006 +0100
     3.2 +++ b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h	Fri Sep 15 11:07:25 2006 +0100
     3.3 @@ -238,9 +238,9 @@ HYPERVISOR_update_va_mapping(
     3.4  
     3.5  static inline int
     3.6  HYPERVISOR_event_channel_op(
     3.7 -	void *op)
     3.8 +	int cmd, void *op)
     3.9  {
    3.10 -	return _hypercall1(int, event_channel_op, op);
    3.11 +	return _hypercall2(int, event_channel_op, cmd, op);
    3.12  }
    3.13  
    3.14  static inline int