ia64/xen-unstable

changeset 16435:e40015e20548

[Mini-OS] Make bind_virq return the port

Make bind_virq() return the port bound to the irq, which is useful
e.g. for masking/unmasking it.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Nov 23 16:25:59 2007 +0000 (2007-11-23)
parents d46265d21dc5
children 81e63d66a64d
files extras/mini-os/arch/ia64/time.c extras/mini-os/events.c extras/mini-os/include/events.h
line diff
     1.1 --- a/extras/mini-os/arch/ia64/time.c	Fri Nov 23 16:23:28 2007 +0000
     1.2 +++ b/extras/mini-os/arch/ia64/time.c	Fri Nov 23 16:25:59 2007 +0000
     1.3 @@ -267,7 +267,7 @@ init_time(void)
     1.4  		printk("efi_get_time() failed\n");
     1.5  
     1.6  	err = bind_virq(VIRQ_ITC, timer_interrupt, NULL);
     1.7 -	if (err != 0) {
     1.8 +	if (err == -1) {
     1.9  		printk("XEN timer request chn bind failed %i\n", err);
    1.10  		return;
    1.11  	}
     2.1 --- a/extras/mini-os/events.c	Fri Nov 23 16:23:28 2007 +0000
     2.2 +++ b/extras/mini-os/events.c	Fri Nov 23 16:25:59 2007 +0000
     2.3 @@ -102,7 +102,7 @@ void unbind_evtchn(evtchn_port_t port )
     2.4  	ev_actions[port].data = NULL;
     2.5  }
     2.6  
     2.7 -int bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)
     2.8 +evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)
     2.9  {
    2.10  	evtchn_bind_virq_t op;
    2.11  
    2.12 @@ -113,11 +113,11 @@ int bind_virq(uint32_t virq, evtchn_hand
    2.13  	if ( HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq, &op) != 0 )
    2.14  	{
    2.15  		printk("Failed to bind virtual IRQ %d\n", virq);
    2.16 -		return 1;
    2.17 +		return -1;
    2.18      }
    2.19      set_bit(op.port,bound_ports);
    2.20      bind_evtchn(op.port, handler, data);
    2.21 -	return 0;
    2.22 +	return op.port;
    2.23  }
    2.24  
    2.25  #if defined(__x86_64__)
     3.1 --- a/extras/mini-os/include/events.h	Fri Nov 23 16:23:28 2007 +0000
     3.2 +++ b/extras/mini-os/include/events.h	Fri Nov 23 16:25:59 2007 +0000
     3.3 @@ -26,7 +26,7 @@ typedef void (*evtchn_handler_t)(evtchn_
     3.4  
     3.5  /* prototypes */
     3.6  int do_event(evtchn_port_t port, struct pt_regs *regs);
     3.7 -int bind_virq(uint32_t virq, evtchn_handler_t handler, void *data);
     3.8 +evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data);
     3.9  evtchn_port_t bind_evtchn(evtchn_port_t port, evtchn_handler_t handler,
    3.10  						  void *data);
    3.11  void unbind_evtchn(evtchn_port_t port);