PERFORCE change 99229 for review

Paolo Pisati piso at FreeBSD.org
Wed Jun 14 15:42:37 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=99229

Change 99229 by piso at piso_newluxor on 2006/06/14 15:39:27

	Finished converting all the INTR_FAST handlers to behave
	like a filter: on i386 everything compiles fine, now i'm
	going to find out what i broke on !i386.

Affected files ...

.. //depot/projects/soc2006/intr_filter/amd64/isa/clock.c#2 edit
.. //depot/projects/soc2006/intr_filter/arm/at91/at91_pio.c#2 edit
.. //depot/projects/soc2006/intr_filter/arm/at91/at91_rtc.c#2 edit
.. //depot/projects/soc2006/intr_filter/arm/at91/at91_st.c#2 edit
.. //depot/projects/soc2006/intr_filter/arm/sa11x0/sa11x0_ost.c#2 edit
.. //depot/projects/soc2006/intr_filter/arm/xscale/i80321/i80321_timer.c#2 edit
.. //depot/projects/soc2006/intr_filter/dev/aac/aac.c#2 edit
.. //depot/projects/soc2006/intr_filter/dev/aac/aacvar.h#2 edit
.. //depot/projects/soc2006/intr_filter/dev/adlink/adlink.c#2 edit
.. //depot/projects/soc2006/intr_filter/dev/cy/cy.c#2 edit
.. //depot/projects/soc2006/intr_filter/dev/cy/cy_isa.c#2 edit
.. //depot/projects/soc2006/intr_filter/dev/cy/cy_pci.c#2 edit
.. //depot/projects/soc2006/intr_filter/dev/cy/cyvar.h#2 edit
.. //depot/projects/soc2006/intr_filter/dev/em/if_em.c#2 edit
.. //depot/projects/soc2006/intr_filter/dev/ppbus/pps.c#2 edit
.. //depot/projects/soc2006/intr_filter/dev/puc/puc.c#2 edit
.. //depot/projects/soc2006/intr_filter/dev/scc/scc_core.c#2 edit
.. //depot/projects/soc2006/intr_filter/dev/sio/sio.c#2 edit
.. //depot/projects/soc2006/intr_filter/dev/twa/tw_osl_freebsd.c#2 edit
.. //depot/projects/soc2006/intr_filter/dev/uart/uart_core.c#2 edit
.. //depot/projects/soc2006/intr_filter/dev/zs/z8530var.h#2 edit
.. //depot/projects/soc2006/intr_filter/dev/zs/zs.c#2 edit
.. //depot/projects/soc2006/intr_filter/dev/zs/zs_macio.c#2 edit
.. //depot/projects/soc2006/intr_filter/i386/isa/clock.c#2 edit
.. //depot/projects/soc2006/intr_filter/i386/isa/npx.c#2 edit
.. //depot/projects/soc2006/intr_filter/pc98/cbus/clock.c#2 edit
.. //depot/projects/soc2006/intr_filter/pc98/cbus/sio.c#2 edit
.. //depot/projects/soc2006/intr_filter/powerpc/powermac/pswitch.c#2 edit
.. //depot/projects/soc2006/intr_filter/sparc64/pci/psycho.c#2 edit
.. //depot/projects/soc2006/intr_filter/sparc64/sbus/sbus.c#2 edit

Differences ...

==== //depot/projects/soc2006/intr_filter/amd64/isa/clock.c#2 (text+ko) ====

@@ -141,7 +141,7 @@
 	0			/* quality */
 };
 
-static void
+static int
 clkintr(struct trapframe *frame)
 {
 
@@ -158,6 +158,7 @@
 	}
 	KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer"));
 	hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
+	return(FILTER_HANDLED);
 }
 
 int
@@ -212,11 +213,13 @@
  * Stat clock ticks can still be lost, causing minor loss of accuracy
  * in the statistics, but the stat clock will no longer stop.
  */
-static void
+static int
 rtcintr(struct trapframe *frame)
 {
+	int flag = 0;
 
 	while (rtcin(RTC_INTR) & RTCIR_PERIOD) {
+		flag = 1;
 		if (profprocs != 0) {
 			if (--pscnt == 0)
 				pscnt = psdiv;
@@ -225,6 +228,7 @@
 		if (pscnt == psdiv)
 			statclock(TRAPF_USERMODE(frame));
 	}
+	return((flag)?FILTER_HANDLED:FILTER_STRAY);
 }
 
 #include "opt_ddb.h"
@@ -755,6 +759,7 @@
 	 * that it can drive hardclock().  Otherwise, change the 8254
 	 * timecounter to user a simpler algorithm.
 	 */
+	// XXX - FIX_INTR_FILTER
 	if (!using_lapic_timer) {
 		intr_add_handler("clk", 0, (driver_intr_t *)clkintr, NULL,
 		    INTR_TYPE_CLK | INTR_FAST, NULL);
@@ -790,6 +795,7 @@
 
 		/* Enable periodic interrupts from the RTC. */
 		rtc_statusb |= RTCSB_PINTR;
+		// XXX - FIX_INTR_FILTER
 		intr_add_handler("rtc", 8, (driver_intr_t *)rtcintr, NULL,
 		    INTR_TYPE_CLK | INTR_FAST, NULL);
 

==== //depot/projects/soc2006/intr_filter/arm/at91/at91_pio.c#2 (text) ====

@@ -81,7 +81,7 @@
 static int at91_pio_probe(device_t dev);
 static int at91_pio_attach(device_t dev);
 static int at91_pio_detach(device_t dev);
-static void at91_pio_intr(void *);
+static int at91_pio_intr(void *);
 
 /* helper routines */
 static int at91_pio_activate(device_t dev);
@@ -124,8 +124,9 @@
 	 * Activate the interrupt, but disable all interrupts in the hardware
 	 */
 	WR4(sc, PIO_IDR, 0xffffffff);
+	// XXX - FIX_INTR_FILTER
 	err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_FAST,
-	    at91_pio_intr, sc, &sc->intrhand);
+	    (driver_intr_t *)at91_pio_intr, sc, &sc->intrhand);
 	if (err) {
 		AT91_PIO_LOCK_DESTROY(sc);
 		goto out;
@@ -193,7 +194,7 @@
 	return;
 }
 
-static void
+static int
 at91_pio_intr(void *xsc)
 {
 	struct at91_pio_softc *sc = xsc;
@@ -208,7 +209,7 @@
 	AT91_PIO_UNLOCK(sc);
 #endif
 	wakeup(sc);
-	return;
+	return(FILTER_HANDLED);
 }
 
 static int 

==== //depot/projects/soc2006/intr_filter/arm/at91/at91_rtc.c#2 (text) ====

@@ -80,7 +80,7 @@
 static int at91_rtc_probe(device_t dev);
 static int at91_rtc_attach(device_t dev);
 static int at91_rtc_detach(device_t dev);
-static void at91_rtc_intr(void *);
+static int at91_rtc_intr(void *);
 
 /* helper routines */
 static int at91_rtc_activate(device_t dev);
@@ -110,8 +110,9 @@
 	 * Activate the interrupt, but disable all interrupts in the hardware
 	 */
 	WR4(sc, RTC_IDR, 0xffffffff);
+	// XXX - FIX_INTR_FILTER
 	err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_FAST,
-	    at91_rtc_intr, sc, &sc->intrhand);
+	    (driver_intr_t *)at91_rtc_intr, sc, &sc->intrhand);
 	if (err) {
 		AT91_RTC_LOCK_DESTROY(sc);
 		goto out;
@@ -173,7 +174,7 @@
 	return;
 }
 
-static void
+static int
 at91_rtc_intr(void *xsc)
 {
 	struct at91_rtc_softc *sc = xsc;
@@ -188,7 +189,7 @@
 	AT91_RTC_UNLOCK(sc);
 #endif
 	wakeup(sc);
-	return;
+	return(FILTER_HANDLED);
 }
 
 /*

==== //depot/projects/soc2006/intr_filter/arm/at91/at91_st.c#2 (text) ====

@@ -140,7 +140,7 @@
 #endif
 }
 
-static void
+static int
 clock_intr(void *arg)
 {
 	struct trapframe *fp = arg;
@@ -151,7 +151,9 @@
 		tot_count += 32768 / hz;
 #endif
 		hardclock(TRAPF_USERMODE(fp), TRAPF_PC(fp));
+		return(FILTER_HANDLED);
 	}
+	return(FILTER_STRAY);
 }
 
 void
@@ -173,11 +175,12 @@
 	/* The system timer shares the system irq (1) */
 	irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 1, 1, 1,
 	  RF_ACTIVE | RF_SHAREABLE);
+	// XXX - FIX_INTR_FILTER
 	if (!irq)
 		panic("Unable to allocate irq for the system timer");
 	else
 		bus_setup_intr(dev, irq, INTR_TYPE_CLK | INTR_FAST,
-		    clock_intr, NULL, &ih);
+		    (driver_intr_t *)clock_intr, NULL, &ih);
 
 	WR4(ST_PIMR, rel_value);
 

==== //depot/projects/soc2006/intr_filter/arm/sa11x0/sa11x0_ost.c#2 (text+ko) ====

@@ -68,9 +68,9 @@
 static int	saost_attach(device_t);
 
 int		gettick(void);
-static void	clockintr(void *);
+static int	clockintr(void *);
 #if 0
-static void	statintr(void *);
+static int	statintr(void *);
 #endif
 void		rtcinit(void);
 
@@ -142,7 +142,7 @@
 
 }
 
-static void
+static int
 clockintr(arg)
 	void *arg;
 {
@@ -185,10 +185,11 @@
 #if 0
 	mtx_unlock_spin(&clock_lock);
 #endif
+	return(FILTER_HANDLED);
 }
 
 #if 0
-static void
+static int
 statintr(arg)
 	void *arg;
 {
@@ -228,7 +229,7 @@
 
 	saost_sc->sc_statclock_count = nextmatch;
 	statclock(TRAPF_USERMODE(frame));
-
+	return(FILTER_HANDLED);
 }
 #endif
 
@@ -272,11 +273,13 @@
 	rid = 1;
 	irq2 = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
 	    RF_ACTIVE);
-	bus_setup_intr(dev, irq1, INTR_TYPE_CLK | INTR_FAST, clockintr, NULL,
-	    &ih1);
+	// XXX - FIX_INTR_FILTER
+	bus_setup_intr(dev, irq1, INTR_TYPE_CLK | INTR_FAST, 
+		       (driver_intr_t *)clockintr, NULL, &ih1);	    
 #if 0
-	bus_setup_intr(dev, irq2, INTR_TYPE_CLK | INTR_FAST, statintr, NULL
-	    ,&ih2);
+	// XXX - FIX_INTR_FILTER
+	bus_setup_intr(dev, irq2, INTR_TYPE_CLK | INTR_FAST, 
+		       (driver_intr_t *)statintr, NULL, &ih2);		       
 #endif
 	bus_space_write_4(saost_sc->sc_iot, saost_sc->sc_ioh, SAOST_SR, 0xf);
 	bus_space_write_4(saost_sc->sc_iot, saost_sc->sc_ioh, SAOST_IR, 3);

==== //depot/projects/soc2006/intr_filter/arm/xscale/i80321/i80321_timer.c#2 (text+ko) ====

@@ -134,7 +134,7 @@
 DRIVER_MODULE(itimer, iq, i80321_timer_driver, i80321_timer_devclass, 0, 0);
 
 void	counterhandler(void *);
-void	clockhandler(void *);
+int	clockhandler(void *);
 
 
 static __inline uint32_t
@@ -334,11 +334,12 @@
 
 	irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, ICU_INT_TMR0,
 	    ICU_INT_TMR0, 1, RF_ACTIVE);
+	// XXX - FIX_INTR_FILTER
 	if (!irq)
 		panic("Unable to setup the clock irq handler.\n");
 	else
 		bus_setup_intr(dev, irq, INTR_TYPE_CLK | INTR_FAST, 
-		    clockhandler, NULL, &ihl);
+		    (driver_intr_t *)clockhandler, NULL, &ihl);
 	tmr0_write(0);			/* stop timer */
 	tisr_write(TISR_TMR0);		/* clear interrupt */
 
@@ -402,7 +403,7 @@
  *
  *	Handle the hardclock interrupt.
  */
-void
+int
 clockhandler(void *arg)
 {
 	struct trapframe *frame = arg;
@@ -413,7 +414,7 @@
 
 	if (i80321_hardclock_hook != NULL)
 		(*i80321_hardclock_hook)();
-	return;
+	return(FILTER_HANDLED);
 }
 
 void

==== //depot/projects/soc2006/intr_filter/dev/aac/aac.c#2 (text+ko) ====

@@ -311,14 +311,16 @@
 			return (EINVAL);
 		}
 	} else {
+		// XXX - FIX_INTR_FILTER
 		if (bus_setup_intr(sc->aac_dev, sc->aac_irq,
-				   INTR_FAST|INTR_TYPE_BIO, aac_fast_intr,
+				   INTR_FAST|INTR_TYPE_BIO, 
+				   (driver_intr_t *)aac_fast_intr,
 				   sc, &sc->aac_intr)) {
 			device_printf(sc->aac_dev,
 				      "can't set up FAST interrupt\n");
 			if (bus_setup_intr(sc->aac_dev, sc->aac_irq,
 					   INTR_MPSAFE|INTR_TYPE_BIO,
-					   aac_fast_intr, sc, &sc->aac_intr)) {
+					   aac_intr, sc, &sc->aac_intr)) {
 				device_printf(sc->aac_dev,
 					     "can't set up MPSAFE interrupt\n");
 				return (EINVAL);
@@ -780,8 +782,57 @@
 	mtx_unlock(&sc->aac_io_lock);
 }
 
+int
+aac_fast_intr(void *arg)
+{
+	struct aac_softc *sc;
+	u_int16_t reason;
+	int flag = 0;
+
+	debug_called(2);
+
+	sc = (struct aac_softc *)arg;
+
+	/*
+	 * Read the status register directly.  This is faster than taking the
+	 * driver lock and reading the queues directly.  It also saves having
+	 * to turn parts of the driver lock into a spin mutex, which would be
+	 * ugly.
+	 */
+	reason = AAC_GET_ISTATUS(sc);
+	AAC_CLEAR_ISTATUS(sc, reason);
+
+	/* handle completion processing */
+	if (reason & AAC_DB_RESPONSE_READY) {
+		flag = 1;
+		taskqueue_enqueue_fast(taskqueue_fast, &sc->aac_task_complete);
+	}
+
+	/* controller wants to talk to us */
+	if (reason & (AAC_DB_PRINTF | AAC_DB_COMMAND_READY)) {
+		flag = 1;
+		/*
+		 * XXX Make sure that we don't get fooled by strange messages
+		 * that start with a NULL.
+		 */
+		if ((reason & AAC_DB_PRINTF) &&
+			(sc->aac_common->ac_printf[0] == 0))
+			sc->aac_common->ac_printf[0] = 32;
+
+		/*
+		 * This might miss doing the actual wakeup.  However, the
+		 * msleep that this is waking up has a timeout, so it will
+		 * wake up eventually.  AIFs and printfs are low enough
+		 * priority that they can handle hanging out for a few seconds
+		 * if needed.
+		 */
+		wakeup(sc->aifthread);
+	}
+	return((flag)?FILTER_HANDLED:FILTER_STRAY);
+}
+
 void
-aac_fast_intr(void *arg)
+aac_intr(void *arg)
 {
 	struct aac_softc *sc;
 	u_int16_t reason;

==== //depot/projects/soc2006/intr_filter/dev/aac/aacvar.h#2 (text+ko) ====

@@ -425,7 +425,8 @@
 extern int		aac_suspend(device_t dev); 
 extern int		aac_resume(device_t dev);
 extern void		aac_new_intr(void *arg);
-extern void		aac_fast_intr(void *arg);
+extern int		aac_fast_intr(void *arg);
+extern void		aac_intr(void *arg);
 extern void		aac_submit_bio(struct bio *bp);
 extern void		aac_biodone(struct bio *bp);
 extern void		aac_startio(struct aac_softc *sc);

==== //depot/projects/soc2006/intr_filter/dev/adlink/adlink.c#2 (text+ko) ====

@@ -115,7 +115,7 @@
 
 static d_ioctl_t adlink_ioctl;
 static d_mmap_t	adlink_mmap;
-static void adlink_intr(void *arg);
+static intr adlink_intr(void *arg);
 
 static struct cdevsw adlink_cdevsw = {
 	.d_version =	D_VERSION,
@@ -124,7 +124,7 @@
 	.d_name =	"adlink",
 };
 
-static void
+static intr
 adlink_intr(void *arg)
 {
 	struct softc *sc;
@@ -134,7 +134,7 @@
 	sc = arg;
 	u = bus_read_4(sc->res[0], 0x38);
 	if (!(u & 0x00800000))
-		return;
+		return; // XXX - FILTER_STRAY?
 	bus_write_4(sc->res[0], 0x38, u | 0x003f4000);
 
 	sc->sample += sc->p0->chunksize / 2;
@@ -147,7 +147,7 @@
 
 	if (sc->p0->state != STATE_RUN) {
 		printf("adlink: stopping %d\n", sc->p0->state);
-		return;
+		return; // XXX - FILTER_STRAY?
 	}
 
 	pg = pg->next;
@@ -156,6 +156,7 @@
 	bus_write_4(sc->res[0], 0x24, pg->phys);
 	bus_write_4(sc->res[0], 0x28, sc->p0->chunksize);
 	wakeup(sc);
+	return(FILTER_HANDLED);
 }
 
 static int
@@ -372,9 +373,10 @@
 	if (error)
 		return (error);
 
+	// XXX - FIX_INTR_FILTER
 	i = bus_setup_intr(self, sc->res[2],
 	    INTR_MPSAFE | INTR_TYPE_MISC | INTR_FAST,
-	    adlink_intr, sc, &sc->intrhand);
+	    (driver_intr_t *)adlink_intr, sc, &sc->intrhand);
 	if (i) {
 		printf("adlink: Couldn't get FAST intr\n");
 		i = bus_setup_intr(self, sc->res[2],

==== //depot/projects/soc2006/intr_filter/dev/cy/cy.c#2 (text+ko) ====

@@ -644,7 +644,7 @@
 			  com->mcr_image |= com->mcr_rts);
 }
 
-void
+intr
 cyintr(void *vcom)
 {
 	struct com_s	*basecom;
@@ -671,7 +671,7 @@
 		/* poll to see if it has any work */
 		status = cd_inb(iobase, CD1400_SVRR, cy_align);
 		if (status == 0)
-			continue;
+			continue; // XXX - FILTER_STRAY?
 #ifdef CyDebug
 		++cy_svrr_probes;
 #endif
@@ -1111,6 +1111,7 @@
 	swi_sched(cy_slow_ih, SWI_DELAY);
 
 	COM_UNLOCK();
+	return(FILTER_HANDLED);
 }
 
 static void

==== //depot/projects/soc2006/intr_filter/dev/cy/cy_isa.c#2 (text+ko) ====

@@ -132,8 +132,9 @@
 		device_printf(dev, "interrupt resource allocation failed\n");
 		goto fail;
 	}
-	if (bus_setup_intr(dev, irq_res, INTR_TYPE_TTY | INTR_FAST, cyintr,
-	    vsc, &irq_cookie) != 0) {
+	// XXX - FIX_INTR_FILTER
+	if (bus_setup_intr(dev, irq_res, INTR_TYPE_TTY | INTR_FAST, 
+			   (driver_intr_t *)cyintr, vsc, &irq_cookie) != 0) {	    
 		device_printf(dev, "interrupt setup failed\n");
 		goto fail;
 	}

==== //depot/projects/soc2006/intr_filter/dev/cy/cy_pci.c#2 (text+ko) ====

@@ -145,8 +145,9 @@
 		goto fail;
 	}
 #ifdef CY_PCI_FASTINTR
+	// XXX - FIX_INTR_FILTER
 	irq_setup = bus_setup_intr(dev, irq_res, INTR_TYPE_TTY | INTR_FAST,
-	    cyintr, vsc, &irq_cookie);
+	    (driver_intr_t *)cyintr, vsc, &irq_cookie);
 #else
 	irq_setup = ENXIO;
 #endif

==== //depot/projects/soc2006/intr_filter/dev/cy/cyvar.h#2 (text+ko) ====

@@ -32,5 +32,5 @@
 extern	char		cy_driver_name[];
 
 void	*cyattach_common(cy_addr cy_iobase, int cy_align);
-driver_intr_t	cyintr;
+driver_filter_t	cyintr;
 int	cy_units(cy_addr cy_iobase, int cy_align);

==== //depot/projects/soc2006/intr_filter/dev/em/if_em.c#2 (text+ko) ====

@@ -257,7 +257,7 @@
 static poll_handler_t em_poll;
 static void	em_intr(void *);
 #else
-static void	em_intr_fast(void *);
+static int	em_intr_fast(void *);
 static void	em_add_int_process_limit(struct em_softc *, const char *,
 		const char *, int *, int);
 static void	em_handle_rxtx(void *context, int pending);
@@ -1202,7 +1202,7 @@
  *  Fast Interrupt Service routine  
  *
  *********************************************************************/
-static void
+static int
 em_intr_fast(void *arg)
 {
 	struct em_softc	*sc = arg;
@@ -1215,11 +1215,11 @@
 
 	/* Hot eject?  */
 	if (reg_icr == 0xffffffff)
-		return;
+		return(FILTER_STRAY);
 
 	/* Definitely not our interrupt.  */
 	if (reg_icr == 0x0)
-		return;
+		return(FILTER_STRAY);
 
 	/*
 	 * Starting with the 82571 chip, bit 31 should be used to
@@ -1227,7 +1227,7 @@
 	 */
 	if (sc->hw.mac_type >= em_82571 &&
 	    (reg_icr & E1000_ICR_INT_ASSERTED) == 0)
-		return;
+		return(FILTER_STRAY);
 
 	/*
 	 * Mask interrupts until the taskqueue is finished running.  This is
@@ -1243,6 +1243,7 @@
 
 	if (reg_icr & E1000_ICR_RXO)
 		sc->rx_overruns++;
+	return(FILTER_HANDLED);
 }
 #endif /* ! DEVICE_POLLING */
 
@@ -1991,8 +1992,9 @@
 	    taskqueue_thread_enqueue, &sc->tq);
 	taskqueue_start_threads(&sc->tq, 1, PI_NET, "%s taskq",
 	    device_get_nameunit(sc->dev));
+	// XXX - FIX_INTR_FILTER
 	if ((error = bus_setup_intr(dev, sc->res_interrupt,
-	    INTR_TYPE_NET | INTR_FAST, em_intr_fast, sc,
+	    INTR_TYPE_NET | INTR_FAST, (driver_intr_t *)em_intr_fast, sc,
 	    &sc->int_handler_tag)) != 0) {
 		device_printf(dev, "Failed to register fast interrupt "
 			    "handler: %d\n", error);

==== //depot/projects/soc2006/intr_filter/dev/ppbus/pps.c#2 (text+ko) ====

@@ -51,7 +51,7 @@
 	void *intr_cookie;		/* interrupt registration cookie */
 };
 
-static void	ppsintr(void *arg);
+static int	ppsintr(void *arg);
 static void 	ppshcpoll(void *arg);
 
 #define DEVTOSOFTC(dev) \
@@ -203,9 +203,11 @@
 		if (ppb_request_bus(ppbus, ppsdev, PPB_WAIT|PPB_INTR))
 			return (EINTR);
 
+		// XXX - FIX_INTR_FILTER
 		/* attach the interrupt handler */
 		if ((error = bus_setup_intr(ppsdev, sc->intr_resource,
-		    (INTR_TYPE_TTY | INTR_MPSAFE | INTR_FAST), ppsintr,
+		    (INTR_TYPE_TTY | INTR_MPSAFE | INTR_FAST), 
+		    (driver_intr_t *)ppsintr,
 		    sc, &sc->intr_cookie))) {
 			ppb_release_bus(ppbus, ppsdev);
 			return (error);
@@ -276,14 +278,14 @@
 	mtx_unlock_spin(&sc->mtx);
 }
 
-static void
+static int
 ppsintr(void *arg)
 {
 	struct pps_data *sc = (struct pps_data *)arg;
 
 	pps_capture(&sc->pps[0]);
 	if (!(ppb_rstr(sc->ppbus) & nACK))
-		return;
+		return(FILTER_STRAY);
 	if (sc->pps[0].ppsparam.mode & PPS_ECHOASSERT) 
 		ppb_wctr(sc->ppbus, IRQENABLE | AUTOFEED);
 	mtx_lock_spin(&sc->mtx);
@@ -291,6 +293,7 @@
 	mtx_unlock_spin(&sc->mtx);
 	if (sc->pps[0].ppsparam.mode & PPS_ECHOASSERT) 
 		ppb_wctr(sc->ppbus, IRQENABLE);
+	return(FILTER_HANDLED);
 }
 
 static int

==== //depot/projects/soc2006/intr_filter/dev/puc/puc.c#2 (text+ko) ====

@@ -125,7 +125,7 @@
 	return (bar);
 }
 
-static void
+static int
 puc_intr(void *arg)
 {
 	struct puc_port *port;
@@ -183,7 +183,9 @@
 			if (port->p_ihsrc[i] != NULL)
 				(*port->p_ihsrc[i])(port->p_iharg);
 		}
+		return(FILTER_HANDLED);
 	}
+	return(FILTER_STRAY);
 }
 
 int
@@ -311,12 +313,14 @@
 	sc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irid,
 	    RF_ACTIVE|RF_SHAREABLE);
 	if (sc->sc_ires != NULL) {
+		// XXX - FIX_INTR_FILTER
 		error = bus_setup_intr(dev, sc->sc_ires,
-		    INTR_TYPE_TTY | INTR_FAST, puc_intr, sc, &sc->sc_icookie);
+		    INTR_TYPE_TTY | INTR_FAST, (driver_intr_t *)puc_intr, 
+		    sc, &sc->sc_icookie);
 		if (error)
 			error = bus_setup_intr(dev, sc->sc_ires,
-			    INTR_TYPE_TTY | INTR_MPSAFE, puc_intr, sc,
-			    &sc->sc_icookie);
+			    INTR_TYPE_TTY | INTR_MPSAFE, 
+			    (driver_intr_t *)puc_intr, sc, &sc->sc_icookie);			    
 		else
 			sc->sc_fastintr = 1;
 

==== //depot/projects/soc2006/intr_filter/dev/scc/scc_core.c#2 (text) ====

@@ -50,7 +50,7 @@
 
 MALLOC_DEFINE(M_SCC, "SCC", "SCC driver");
 
-static void
+static int
 scc_bfe_intr(void *arg)
 {
 	struct scc_softc *sc = arg;
@@ -88,7 +88,9 @@
 			else
 				SCC_ICLEAR(sc, ch);
 		}
+		return(FILTER_HANDLED);
 	}
+	return(FILTER_STRAY);
 }
 
 int
@@ -216,13 +218,14 @@
 		ch = &sc->sc_chan[c];
 		if (ch->ch_ires == NULL)
 			continue;
+		// XXX - FIX_INTR_FILTER
 		error = bus_setup_intr(dev, ch->ch_ires,
-		    INTR_TYPE_TTY | INTR_FAST, scc_bfe_intr, sc,
-		    &ch->ch_icookie);
+		    INTR_TYPE_TTY | INTR_FAST, (driver_intr_t *)scc_bfe_intr, 
+		    sc, &ch->ch_icookie);
 		if (error) {
 			error = bus_setup_intr(dev, ch->ch_ires,
-			    INTR_TYPE_TTY | INTR_MPSAFE, scc_bfe_intr, sc,
-			    &ch->ch_icookie);
+			    INTR_TYPE_TTY | INTR_MPSAFE, 
+			    (driver_intr_t *)scc_bfe_intr, sc, &ch->ch_icookie);			    
 		} else
 			sc->sc_fastintr = 1;
 
@@ -521,8 +524,8 @@
 				continue;
 			bus_teardown_intr(dev, ch->ch_ires, ch->ch_icookie);
 			bus_setup_intr(dev, ch->ch_ires,
-			    INTR_TYPE_TTY | INTR_MPSAFE, scc_bfe_intr, sc,
-			    &ch->ch_icookie);
+			    INTR_TYPE_TTY | INTR_MPSAFE, 
+			    (driver_intr_t *)scc_bfe_intr, sc, &ch->ch_icookie);			    
 		}
 	}
 

==== //depot/projects/soc2006/intr_filter/dev/sio/sio.c#2 (text+ko) ====

@@ -263,7 +263,7 @@
 static	int	comopen(struct tty *tp, struct cdev *dev);
 static	void	sioinput(struct com_s *com);
 static	void	siointr1(struct com_s *com);
-static	void	siointr(void *arg);
+static	int	siointr(void *arg);
 static	int	commodem(struct tty *tp, int sigon, int sigoff);
 static	int	comparam(struct tty *tp, struct termios *t);
 static	void	siopoll(void *);
@@ -1074,13 +1074,15 @@
 	rid = 0;
 	com->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE);
 	if (com->irqres) {
+		// XXX - FIX_INTR_FILTER
 		ret = bus_setup_intr(dev, com->irqres,
 				     INTR_TYPE_TTY | INTR_FAST,
-				     siointr, com, &com->cookie);
+				     (driver_intr_t *)siointr, com, 
+				     &com->cookie);
 		if (ret) {
 			ret = bus_setup_intr(dev,
 					     com->irqres, INTR_TYPE_TTY,
-					     siointr, com, &com->cookie);
+					     (driver_intr_t *)siointr, com, &com->cookie);
 			if (ret == 0)
 				device_printf(dev, "unable to activate interrupt in fast mode - using normal mode\n");
 		}
@@ -1378,7 +1380,7 @@
 		outb(com->modem_ctl_port, com->mcr_image |= MCR_RTS);
 }
 
-static void
+static int
 siointr(arg)
 	void		*arg;
 {
@@ -1422,6 +1424,7 @@
 	} while (possibly_more_intrs);
 	mtx_unlock_spin(&sio_lock);
 #endif /* COM_MULTIPORT */
+	return(FILTER_HANDLED);
 }
 
 static struct timespec siots[8];

==== //depot/projects/soc2006/intr_filter/dev/twa/tw_osl_freebsd.c#2 (text+ko) ====

@@ -174,9 +174,11 @@
 static TW_INT32	twa_detach(device_t dev);
 static TW_INT32	twa_shutdown(device_t dev);
 static TW_VOID	twa_busdma_lock(TW_VOID *lock_arg, bus_dma_lock_op_t op);
-static TW_VOID	twa_pci_intr(TW_VOID *arg);
 #ifdef TW_OSLI_DEFERRED_INTR_USED
+static int	twa_pci_intr_fast(TW_VOID *arg);
 static TW_VOID	twa_deferred_intr(TW_VOID *context, TW_INT32 pending);
+#else
+static TW_VOID	twa_pci_intr(TW_VOID *arg);
 #endif /* TW_OSLI_DEFERRED_INTR_USED */
 
 static TW_INT32	tw_osli_alloc_mem(struct twa_softc *sc);
@@ -360,7 +362,12 @@
 			| INTR_FAST
 #endif /* TW_OSLI_DEFERRED_INTR_USED */
 			) : 0) | INTR_TYPE_CAM,
-			twa_pci_intr, sc, &sc->intr_handle))) {
+#ifdef TW_OSLI_DEFERRED_INTR_USED
+			(driver_intr_t *)twa_pci_intr_fast,
+#else
+			twa_pci_intr,	    
+#endif 
+			sc, &sc->intr_handle))) {
 		tw_osli_printf(sc, "error = %d",
 			TW_CL_SEVERITY_ERROR_STRING,
 			TW_CL_MESSAGE_SOURCE_FREEBSD_DRIVER,
@@ -975,7 +982,28 @@
 }
 
 
+#ifdef TW_OSLI_DEFERRED_INTR_USED
+/*
+ * Function name:	twa_pci_intr_fast
+ * Description:		Interrupt handler.  Wrapper for twa_interrupt.
+ *
+ * Input:		arg	-- ptr to OSL internal ctlr context
+ * Output:		FILTER_HANDLED or FILTER_STRAY
+ * Return value:	None
+ */
+static int
+twa_pci_intr_fast(TW_VOID *arg)
+{
+	struct twa_softc	*sc = (struct twa_softc *)arg;
 
+	tw_osli_dbg_dprintf(10, sc, "entered");
+	if (tw_cl_interrupt(&(sc->ctlr_handle))) {
+		tw_cl_deferred_interrupt(&(sc->ctlr_handle));
+		return(FILTER_HANDLED);
+	}
+	return(FILTER_STRAY);
+}
+#else
 /*
  * Function name:	twa_pci_intr
  * Description:		Interrupt handler.  Wrapper for twa_interrupt.
@@ -991,15 +1019,9 @@
 
 	tw_osli_dbg_dprintf(10, sc, "entered");
 	if (tw_cl_interrupt(&(sc->ctlr_handle)))
-#ifdef TW_OSLI_DEFERRED_INTR_USED
-		taskqueue_enqueue_fast(taskqueue_fast,
-			&(sc->deferred_intr_callback));
-#else /* TW_OSLI_DEFERRED_INTR_USED */
 		tw_cl_deferred_interrupt(&(sc->ctlr_handle));
-#endif /* TW_OSLI_DEFERRED_INTR_USED */
 }
-
-
+#endif
 
 #ifdef TW_OSLI_DEFERRED_INTR_USED
 

==== //depot/projects/soc2006/intr_filter/dev/uart/uart_core.c#2 (text+ko) ====

@@ -227,13 +227,14 @@
 	return (0);
 }
 
-static void
+static int
 uart_intr(void *arg)
 {
 	struct uart_softc *sc = arg;
-	int ipend;
+	int flag = 0, ipend;
 
 	while (!sc->sc_leaving && (ipend = UART_IPEND(sc)) != 0) {
+		flag = 1;
 		if (ipend & SER_INT_OVERRUN)
 			uart_intr_overrun(sc);
 		if (ipend & SER_INT_BREAK)
@@ -243,8 +244,9 @@
 		if (ipend & SER_INT_SIGCHG)
 			uart_intr_sigchg(sc);
 		if (ipend & SER_INT_TXIDLE)
-			uart_intr_txidle(sc);
+			uart_intr_txidle(sc);		
 	}
+	return((flag)?FILTER_HANDLED:FILTER_STRAY);
 }
 
 serdev_intr_t *
@@ -400,13 +402,14 @@
 	sc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irid,
 	    RF_ACTIVE | RF_SHAREABLE);
 	if (sc->sc_ires != NULL) {
+		// XXX - FIX_INTR_HANDLER
 		error = bus_setup_intr(dev,
-		    sc->sc_ires, INTR_TYPE_TTY | INTR_FAST, uart_intr,
-		    sc, &sc->sc_icookie);
+		    sc->sc_ires, INTR_TYPE_TTY | INTR_FAST, 
+		    (driver_intr_t *)uart_intr, sc, &sc->sc_icookie);		    
 		if (error)
 			error = bus_setup_intr(dev,
 			    sc->sc_ires, INTR_TYPE_TTY | INTR_MPSAFE,
-			    uart_intr, sc, &sc->sc_icookie);
+			    (driver_intr_t *)uart_intr, sc, &sc->sc_icookie);
 		else
 			sc->sc_fastintr = 1;
 

==== //depot/projects/soc2006/intr_filter/dev/zs/z8530var.h#2 (text+ko) ====

@@ -65,7 +65,7 @@
 
 int zs_attach(device_t dev);
 int zs_probe(device_t dev);
-void zs_intr(void *v);
+int zs_intr(void *v);
 
 int zstty_attach(device_t dev);
 int zstty_probe(device_t dev);

==== //depot/projects/soc2006/intr_filter/dev/zs/zs.c#2 (text+ko) ====

@@ -197,7 +197,7 @@
 	return (0);
 }
 
-void
+int
 zs_intr(void *v)
 {
 	struct zs_softc *sc = v;
@@ -216,8 +216,11 @@
 		needsoft |= zstty_intr(sc->sc_child[0], rr3 >> 3);
 	if ((rr3 & (ZSRR3_IP_B_RX | ZSRR3_IP_B_TX | ZSRR3_IP_B_STAT)) != 0)
 		needsoft |= zstty_intr(sc->sc_child[1], rr3);
-	if (needsoft)
+	if (needsoft) {
 		swi_sched(sc->sc_softih, 0);
+		return(FILTER_HANDLED);
+	}
+	return(FILTER_STRAY);
 }
 
 static void

==== //depot/projects/soc2006/intr_filter/dev/zs/zs_macio.c#2 (text+ko) ====

@@ -158,8 +158,9 @@
 		device_printf(dev, "could not allocate interrupt 1\n");
 		goto error;
 	}
+	// XXX - FIX_INTR_FILTER
 	if (bus_setup_intr(dev, sc->sc_irqres1, INTR_TYPE_TTY | INTR_FAST,
-	    zs_intr, sc, &sc->sc_ih1) != 0) {
+	    (driver_intr_t *)zs_intr, sc, &sc->sc_ih1) != 0) {
 		device_printf(dev, "could not setup interrupt 1\n");
 		goto error;
 	}
@@ -170,8 +171,9 @@
 		device_printf(dev, "could not allocate interrupt 2\n");
 		goto error;
 	}
+	// XXX - FIX_INTR_FILTER
 	if (bus_setup_intr(dev, sc->sc_irqres2, INTR_TYPE_TTY | INTR_FAST,
-	    zs_intr, sc, &sc->sc_ih2) != 0) {
+	    (driver_intr_t *)zs_intr, sc, &sc->sc_ih2) != 0) {
 		device_printf(dev, "could not setup interrupt 2\n");
 		goto error;
 	}

==== //depot/projects/soc2006/intr_filter/i386/isa/clock.c#2 (text+ko) ====

@@ -155,7 +155,7 @@
 	0			/* quality */
 };
 
-static void
+static int
 clkintr(struct trapframe *frame)
 {
 
@@ -177,6 +177,7 @@
 	if (MCA_system)
 		outb(0x61, inb(0x61) | 0x80);

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list