PERFORCE change 135697 for review
Marcel Moolenaar
marcel at FreeBSD.org
Tue Feb 19 02:21:02 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=135697
Change 135697 by marcel at marcel_xcllnt on 2008/02/19 02:20:48
Fix the INTR_FILTER changes.
Affected files ...
.. //depot/projects/e500/sys/dev/quicc/quicc_bfe.h#2 edit
.. //depot/projects/e500/sys/dev/quicc/quicc_core.c#3 edit
Differences ...
==== //depot/projects/e500/sys/dev/quicc/quicc_bfe.h#2 (text+ko) ====
@@ -66,7 +66,7 @@
int quicc_bus_read_ivar(device_t, device_t, int, uintptr_t *);
int quicc_bus_release_resource(device_t, device_t, int, int, struct resource *);
int quicc_bus_setup_intr(device_t, device_t, struct resource *, int,
- void (*)(void *), void *, void **);
+ driver_filter_t *, void (*)(void *), void *, void **);
int quicc_bus_teardown_intr(device_t, device_t, struct resource *, void *);
#endif /* _DEV_QUICC_BFE_H_ */
==== //depot/projects/e500/sys/dev/quicc/quicc_core.c#3 (text+ko) ====
@@ -29,8 +29,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#define __RMAN_RESOURCE_VISIBLE
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@@ -71,11 +69,11 @@
device_t qd_dev;
int qd_devtype;
- driver_intr_t *qd_ih;
+ driver_filter_t *qd_ih;
void *qd_ih_arg;
};
-static void
+static int
quicc_bfe_intr(void *arg)
{
struct quicc_device *qd;
@@ -88,10 +86,12 @@
else
qd = NULL;
- if (qd == NULL || qd->qd_ih == NULL)
+ if (qd == NULL || qd->qd_ih == NULL) {
device_printf(sc->sc_dev, "Stray interrupt %08x\n", sipnr);
- else
- (*qd->qd_ih)(qd->qd_ih_arg);
+ return (FILTER_STRAY);
+ }
+
+ return ((*qd->qd_ih)(qd->qd_ih_arg));
}
int
@@ -124,11 +124,11 @@
if (sc->sc_ires != NULL) {
error = bus_setup_intr(dev, sc->sc_ires,
- INTR_TYPE_TTY | INTR_FAST, NULL, quicc_bfe_intr, sc,
- &sc->sc_icookie);
+ INTR_TYPE_TTY, quicc_bfe_intr, NULL, sc, &sc->sc_icookie);
if (error) {
error = bus_setup_intr(dev, sc->sc_ires,
- INTR_TYPE_TTY | INTR_MPSAFE, NULL, quicc_bfe_intr, sc,
+ INTR_TYPE_TTY | INTR_MPSAFE, NULL,
+ (driver_intr_t *)quicc_bfe_intr, sc,
&sc->sc_icookie);
} else
sc->sc_fastintr = 1;
@@ -328,7 +328,8 @@
int
quicc_bus_setup_intr(device_t dev, device_t child, struct resource *r,
- int flags, void (*ihand)(void *), void *arg, void **cookiep)
+ int flags, driver_filter_t *filt, void (*ihand)(void *), void *arg,
+ void **cookiep)
{
struct quicc_device *qd;
struct quicc_softc *sc;
@@ -337,22 +338,22 @@
return (EINVAL);
/* Interrupt handlers must be FAST or MPSAFE. */
- if ((flags & (INTR_FAST|INTR_MPSAFE)) == 0)
+ if (filt == NULL && !(flags & INTR_MPSAFE))
return (EINVAL);
sc = device_get_softc(dev);
if (sc->sc_polled)
return (ENXIO);
- if (sc->sc_fastintr && !(flags & INTR_FAST)) {
+ if (sc->sc_fastintr && filt == NULL) {
sc->sc_fastintr = 0;
bus_teardown_intr(dev, sc->sc_ires, sc->sc_icookie);
bus_setup_intr(dev, sc->sc_ires, INTR_TYPE_TTY | INTR_MPSAFE,
- NULL, quicc_bfe_intr, sc, &sc->sc_icookie);
+ NULL, (driver_intr_t *)quicc_bfe_intr, sc, &sc->sc_icookie);
}
qd = device_get_ivars(child);
- qd->qd_ih = ihand;
+ qd->qd_ih = (filt != NULL) ? filt : (driver_filter_t *)ihand;
qd->qd_ih_arg = arg;
*cookiep = ihand;
return (0);
More information about the p4-projects
mailing list