Date: Mon, 10 Apr 2006 04:59:17 GMT From: John-Mark Gurney <jmg@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 94899 for review Message-ID: <200604100459.k3A4xHqv048035@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=94899 Change 94899 by jmg@jmg_carbon-60 on 2006/04/10 04:59:05 move interrupts to per devhandle as the uniqueness is devhandle+devino and not just devino.. Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/nexus.c#6 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/nexus.c#6 (text+ko) ==== @@ -72,12 +72,12 @@ struct nexus_devinfo { struct ofw_bus_devinfo ndi_obdinfo; struct resource_list ndi_rl; + struct rman ndi_intr_rman; - devhandle_t ndi_devhandle; + devhandle_t ndi_devhandle; }; struct nexus_softc { - struct rman sc_intr_rman; struct rman sc_mem_rman; }; @@ -203,13 +203,9 @@ panic("%s: OF_peer failed.", __func__); sc = device_get_softc(dev); - sc->sc_intr_rman.rm_type = RMAN_ARRAY; - sc->sc_intr_rman.rm_descr = "Interrupts"; sc->sc_mem_rman.rm_type = RMAN_ARRAY; sc->sc_mem_rman.rm_descr = "Device Memory"; - if (rman_init(&sc->sc_intr_rman) != 0 || - rman_init(&sc->sc_mem_rman) != 0 || - rman_manage_region(&sc->sc_intr_rman, 0, IV_MAX - 1) != 0 || + if (rman_init(&sc->sc_mem_rman) != 0 || rman_manage_region(&sc->sc_mem_rman, 0ULL, ~0ULL) != 0) panic("%s: failed to set up rmans.", __func__); @@ -408,6 +404,7 @@ u_long start, u_long end, u_long count, u_int flags) { struct nexus_softc *sc; + struct nexus_devinfo *ndi; struct rman *rm; struct resource *rv; struct resource_list_entry *rle; @@ -417,6 +414,7 @@ needactivate = flags & RF_ACTIVE; passthrough = (device_get_parent(child) != bus); sc = device_get_softc(bus); + ndi = device_get_ivars(child); rle = NULL; if (!passthrough) { @@ -435,7 +433,7 @@ switch (type) { case SYS_RES_IRQ: - rm = &sc->sc_intr_rman; + rm = &ndi->ndi_intr_rman; break; case SYS_RES_MEMORY: rm = &sc->sc_mem_rman; @@ -575,6 +573,12 @@ } free(intr, M_OFWPROP); + ndi->ndi_intr_rman.rm_type = RMAN_ARRAY; + ndi->ndi_intr_rman.rm_descr = "Interrupts"; + if (rman_init(&ndi->ndi_intr_rman) != 0 || + rman_manage_region(&ndi->ndi_intr_rman, 0, IV_MAX - 1) != 0 || + panic("%s: failed to set up rmans.", __func__); + return (ndi); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604100459.k3A4xHqv048035>