Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Mar 2007 17:17:30 GMT
From:      Paolo Pisati <piso@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 115344 for review
Message-ID:  <200703051717.l25HHUYn097723@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=115344

Change 115344 by piso@piso_longino on 2007/03/05 17:16:31

	Restore ability to use filter+ithread handler for fhc,
	psycho and sbus.

Affected files ...

.. //depot/projects/soc2006/intr_filter/sparc64/fhc/fhc.c#6 edit
.. //depot/projects/soc2006/intr_filter/sparc64/pci/psycho.c#12 edit
.. //depot/projects/soc2006/intr_filter/sparc64/sbus/sbus.c#10 edit

Differences ...

==== //depot/projects/soc2006/intr_filter/sparc64/fhc/fhc.c#6 (text+ko) ====

@@ -51,7 +51,7 @@
 
 struct fhc_clr {
 	driver_filter_t		*fc_filter;
-	driver_filter_t		*fc_func;
+	driver_intr_t		*fc_func;
 	void			*fc_arg;
 	void			*fc_cookie;
 	bus_space_tag_t		fc_bt;
@@ -64,7 +64,7 @@
 };
 
 static int fhc_filter_stub(void *);
-static int fhc_intr_stub(void *);
+static void fhc_intr_stub(void *);
 static void fhc_led_func(void *, int);
 static int fhc_print_res(struct fhc_devinfo *);
 
@@ -219,7 +219,7 @@
 	long vec;
 	uint32_t inr;
 
-	if (filt != NULL && func != NULL)
+	if (filter != NULL && func != NULL)
 		return (EINVAL);
 
 	sc = device_get_softc(bus);
@@ -244,7 +244,7 @@
 	if (fc == NULL)
 		return (0);
 	fc->fc_filter = filter;
-	fc->fc_func = (filt != NULL) ? filt : (driver_filter_t *)func;
+	fc->fc_func = func;
 	fc->fc_arg = arg;
 	fc->fc_bt = bt;
 	fc->fc_bh = bh;
@@ -298,12 +298,12 @@
 	return (res);
 }
 
+void
 fhc_intr_stub(void *arg)
 {
 	struct fhc_clr *fc = arg;
 
 	fc->fc_func(fc->fc_arg);
-	return (FILTER_HANDLED);
 }
 
 struct resource *

==== //depot/projects/soc2006/intr_filter/sparc64/pci/psycho.c#12 (text+ko) ====

@@ -85,7 +85,7 @@
 static int psycho_find_intrmap(struct psycho_softc *, int, bus_addr_t *,
     bus_addr_t *, u_long *);
 static int psycho_filter_stub(void *);
-static int psycho_intr_stub(void *);
+static void psycho_intr_stub(void *);
 static bus_space_tag_t psycho_alloc_bus_tag(struct psycho_softc *, int);
 
 /* Interrupt handlers */
@@ -93,11 +93,7 @@
 static int psycho_ce(void *);
 static int psycho_pci_bus(void *);
 static 
-#ifdef DEBUGGER_ON_POWERFAIL
 int
-#else
-void
-#endif
 psycho_powerfail(void *);
 static int psycho_overtemp(void *);
 #ifdef PSYCHO_MAP_WAKEUP
@@ -178,7 +174,7 @@
 	struct psycho_softc	*pci_sc;
 	bus_addr_t		pci_clr;	/* clear register */
 	driver_filter_t		*pci_filter;
-	driver_filter_t		*pci_handler;	/* handler to call */
+	driver_intr_t		*pci_handler;	/* handler to call */
 	void			*pci_arg;	/* argument for the handler */
 	void			*pci_cookie;	/* parent bus int. cookie */
 	device_t		pci_ppb;	/* farest PCI-PCI bridge */
@@ -709,8 +705,8 @@
 		    &sc->sc_ihand[index]);
 	else
 		res = bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], 
-		    INTR_TYPE_MISC | iflags, NULL, handler, sc, 
-		    &sc->sc_ihand[index]);
+		    INTR_TYPE_MISC | iflags, NULL, (driver_intr_t *)handler, 
+		    sc, &sc->sc_ihand[index]);
 	if (res != 0)
 		panic("%s: failed to get interrupt", __func__);
 	PSYCHO_WRITE8(sc, map, INTMAP_ENABLE(mr, PCPU_GET(mid)));
@@ -822,11 +818,7 @@
 }
 
 static 
-#ifdef DEBUGGER_ON_POWERFAIL
 int
-#else
-void
-#endif
 psycho_powerfail(void *arg)
 {
 
@@ -835,12 +827,12 @@
 
 	kdb_enter("powerfail");
 	PSYCHO_WRITE8(sc, PSR_POWER_INT_CLR, 0);
-	return(FILTER_HANDLED);
+	return (FILTER_HANDLED);
 #else
 	printf("Power Failure Detected: Shutting down NOW.\n");
 	shutdown_nice(0);
+	return (FILTER_HANDLED);
 #endif
-	return (FILTER_HANDLED);
 }
 
 static int
@@ -1035,7 +1027,7 @@
 }
 
 /* Write to the correct clr register, and call the actual handler. */
-static int
+static void
 psycho_intr_stub(void *arg)
 {
 	struct psycho_clr *pc = arg;
@@ -1046,7 +1038,6 @@
 		(void)PSYCHO_READ8(pc->pci_sc, PSR_DMA_WRITE_SYNC);
 	}
 	pc->pci_handler(pc->pci_arg);
-	return (FILTER_HANDLED);
 }
 
 static int
@@ -1067,7 +1058,7 @@
 	uint64_t mr;
 	int error, ino;
 
-	if (filt != NULL && intr != NULL)
+	if (filter != NULL && intr != NULL)
 		return (EINVAL);
 
 	sc = device_get_softc(dev);
@@ -1100,7 +1091,7 @@
 	pc->pci_sc = sc;
 	pc->pci_arg = arg;
 	pc->pci_filter = filter;
-	pc->pci_handler = (filt != NULL) ? filt : (driver_filter_t *)intr;
+	pc->pci_handler = intr;
 	pc->pci_clr = intrclrptr;
 
 	/*

==== //depot/projects/soc2006/intr_filter/sparc64/sbus/sbus.c#10 (text+ko) ====

@@ -182,7 +182,7 @@
 	struct sbus_softc	*scl_sc;
 	bus_addr_t		scl_clr;	/* clear register */
 	driver_filter_t		*scl_filter;
-	driver_filter_t		*scl_handler;	/* handler to call */
+	driver_intr_t		*scl_handler;	/* handler to call */
 	void			*scl_arg;	/* argument for the handler */
 	void			*scl_cookie;	/* parent bus int. cookie */
 };
@@ -211,7 +211,7 @@
     phandle_t);
 static void sbus_destroy_dinfo(struct sbus_devinfo *);
 static int sbus_filter_stub(void *);
-static int sbus_intr_stub(void *);
+static void sbus_intr_stub(void *);
 static bus_space_tag_t sbus_alloc_bustag(struct sbus_softc *);
 static int sbus_overtemp(void *);
 static int sbus_pwrfail(void *);
@@ -654,14 +654,13 @@
 }
 
 /* Write to the correct clr register, and call the actual handler. */
-static int
+static void
 sbus_intr_stub(void *arg)
 {
 	struct sbus_clr *scl;
 
 	scl = (struct sbus_clr *)arg;
 	scl->scl_handler(scl->scl_arg);
-	return (FILTER_HANDLED);
 }
 
 static int
@@ -716,8 +715,8 @@
 
 	scl->scl_sc = sc;
 	scl->scl_arg = arg;
-	scl->scl_filter = filter;
-	scl->scl_handler = (filt != NULL) ? filt : (driver_filter_t *)intr;
+	scl->scl_filter = filt;
+	scl->scl_handler = intr;
 	scl->scl_clr = intrclrptr;
 	/* Disable the interrupt while we fiddle with it */
 	SYSIO_WRITE8(sc, intrmapptr, intrmap & ~INTMAP_V);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703051717.l25HHUYn097723>