Date: Sat, 12 Apr 2008 17:25:07 GMT From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 139918 for review Message-ID: <200804121725.m3CHP7XS095289@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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),
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804121725.m3CHP7XS095289>