From owner-p4-projects@FreeBSD.ORG Tue Feb 19 02:21:02 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9EBB416A46B; Tue, 19 Feb 2008 02:21:02 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BB3F16A421 for ; Tue, 19 Feb 2008 02:21:02 +0000 (UTC) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3DBCC13C43E for ; Tue, 19 Feb 2008 02:21:02 +0000 (UTC) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m1J2L28x029101 for ; Tue, 19 Feb 2008 02:21:02 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m1J2L2fj029098 for perforce@freebsd.org; Tue, 19 Feb 2008 02:21:02 GMT (envelope-from marcel@freebsd.org) Date: Tue, 19 Feb 2008 02:21:02 GMT Message-Id: <200802190221.m1J2L2fj029098@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Cc: Subject: PERFORCE change 135697 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2008 02:21:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=135697 Change 135697 by marcel@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 __FBSDID("$FreeBSD$"); -#define __RMAN_RESOURCE_VISIBLE - #include #include #include @@ -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);