From owner-p4-projects@FreeBSD.ORG Sat Apr 12 17:25:08 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 580EC1065673; Sat, 12 Apr 2008 17:25:08 +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 1AAA4106564A for ; Sat, 12 Apr 2008 17:25:08 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D53858FC1F for ; Sat, 12 Apr 2008 17:25:07 +0000 (UTC) (envelope-from gonzo@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 m3CHP7ag095291 for ; Sat, 12 Apr 2008 17:25:07 GMT (envelope-from gonzo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m3CHP7XS095289 for perforce@freebsd.org; Sat, 12 Apr 2008 17:25:07 GMT (envelope-from gonzo@FreeBSD.org) Date: Sat, 12 Apr 2008 17:25:07 GMT Message-Id: <200804121725.m3CHP7XS095289@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko To: Perforce Change Reviews Cc: Subject: PERFORCE change 139918 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: Sat, 12 Apr 2008 17:25:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=139918 Change 139918 by gonzo@gonzo_jeeves on 2008/04/12 17:24:16 o Remove commented out setup_intr function o Use bus_generic_activate_../bus_generic_deactivate_... we have nothing to do with resources on this level: IRQ are handled by OBIO and MEM/IOPORT by nexus device. Affected files ... .. //depot/projects/mips2-jnpr/src/sys/mips/mips32/idt/idtpci.c#4 edit Differences ... ==== //depot/projects/mips2-jnpr/src/sys/mips/mips32/idt/idtpci.c#4 (text+ko) ==== @@ -478,7 +478,6 @@ struct idtpci_softc *sc = device_get_softc(bus); struct resource *rv = NULL; struct rman *rm1, *rm2; - void *vaddr; switch (type) { case SYS_RES_IRQ: @@ -507,13 +506,6 @@ if (rv == NULL) return (NULL); - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - vaddr = - (void *)MIPS_PHYS_TO_KSEG1((intptr_t)rman_get_start(rv)); - rman_set_virtual(rv, vaddr); - rman_set_bushandle(rv, (bus_space_handle_t)vaddr); - } - rman_set_rid(rv, *rid); if (flags & RF_ACTIVE) { @@ -527,54 +519,6 @@ } static int -idtpci_activate_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) -{ - if (type == SYS_RES_IRQ) { - /* TODO:enable interrupt here? */ - } - - return (rman_activate_resource(r)); -} - -#if 0 -static int -idtpci_setup_intr(device_t dev, device_t child, struct resource *ires, - int flags, driver_filter_t *filt, driver_intr_t *handler, - void *arg, void **cookiep) -{ - panic("setup_intr"); - struct idtpci_softc *sc = device_get_softc(dev); - struct intr_event *event; - int irq, error; - - irq = rman_get_start(ires); - if (irq >= ICU_LEN || irq == 2) - panic("%s: bad irq or type", __func__); - - event = sc->sc_eventstab[irq]; - if (event == NULL) { - error = intr_event_create(&event, (void *)irq, 0, - (void (*)(void *))NULL, "idtpci intr%d:", irq); - if (error) - return 0; - sc->sc_eventstab[irq] = event; - } - - intr_event_add_handler(event, device_get_nameunit(child), filt, - handler, arg, intr_priority(flags), flags, cookiep); - - /* Enable it, set trigger mode. */ - sc->sc_imask &= ~(1 << irq); - sc->sc_elcr &= ~(1 << irq); - - idtpci_set_icus(sc); - - return (0); -} -#endif - -static int idtpci_teardown_intr(device_t dev, device_t child, struct resource *res, void *cookie) { @@ -596,7 +540,7 @@ DEVMETHOD(bus_write_ivar, idtpci_write_ivar), DEVMETHOD(bus_alloc_resource, idtpci_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), - DEVMETHOD(bus_activate_resource, idtpci_activate_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, idtpci_teardown_intr),