Date: Mon, 31 Dec 2007 07:22:53 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 132159 for review Message-ID: <200712310722.lBV7MrDp035110@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=132159 Change 132159 by kmacy@pandemonium:kmacy:xen31 on 2007/12/31 07:22:14 make interrupts work by having find_unbound_irq look at the dynirq range only register pic template on demand for devices Affected files ... .. //depot/projects/xen31/sys/i386/include/xen/evtchn.h#4 edit .. //depot/projects/xen31/sys/xen/evtchn/evtchn.c#4 edit Differences ... ==== //depot/projects/xen31/sys/i386/include/xen/evtchn.h#4 (text+ko) ==== @@ -56,6 +56,8 @@ void unmask_evtchn(int port); + + static inline void clear_evtchn(int port) { @@ -71,6 +73,13 @@ } /* + * Use these to access the event channel underlying the IRQ handle returned + * by bind_*_to_irqhandler(). + */ +int irq_to_evtchn_port(int irq); + + +/* * CHARACTER-DEVICE DEFINITIONS */ ==== //depot/projects/xen31/sys/xen/evtchn/evtchn.c#4 (text+ko) ==== @@ -219,16 +219,18 @@ static int find_unbound_irq(void) { - int irq; - - for (irq = 0; irq < NR_IRQS; irq++) + int dynirq, irq; + + for (dynirq = 0; dynirq < NR_IRQS; dynirq++) { + irq = dynirq_to_irq(dynirq); if (irq_bindcount[irq] == 0) break; - + } + if (irq == NR_IRQS) panic("No available IRQ to bind to: increase NR_IRQS!\n"); - return irq; + return (irq); } static int @@ -509,6 +511,7 @@ int retval; irq = bind_ipi_to_irq(ipi, cpu); + intr_register_source(&xp->xp_pins[irq].xp_intsrc); retval = intr_add_handler(devname, irq, NULL, handler, NULL, irqflags, NULL); if (retval != 0) { unbind_from_irq(irq); @@ -718,8 +721,8 @@ TODO; } - -void notify_remote_via_irq(int irq) +void +notify_remote_via_irq(int irq) { int evtchn = evtchn_from_irq(irq); @@ -877,6 +880,12 @@ mtx_unlock_spin(&irq_mapping_update_lock); } +int +irq_to_evtchn_port(int irq) +{ + return evtchn_from_irq(irq); +} + void mask_evtchn(int port) { @@ -1041,7 +1050,6 @@ tpin->xp_intsrc.is_pic = xp->xp_dynirq_pic; tpin->xp_vector = dynirq_to_irq(i); - intr_register_source(&tpin->xp_intsrc); } /* * Now, we go ahead and claim every PIRQ there is. @@ -1061,7 +1069,6 @@ tpin->xp_intsrc.is_pic = xp->xp_pirq_pic; tpin->xp_vector = pirq_to_irq(i); - intr_register_source(&tpin->xp_intsrc); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712310722.lBV7MrDp035110>