From owner-p4-projects@FreeBSD.ORG Mon Apr 10 04:59:18 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 739BD16A405; Mon, 10 Apr 2006 04:59:18 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3271516A403 for ; Mon, 10 Apr 2006 04:59:18 +0000 (UTC) (envelope-from jmg@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D9EDD43D73 for ; Mon, 10 Apr 2006 04:59:17 +0000 (GMT) (envelope-from jmg@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k3A4xHM1048041 for ; Mon, 10 Apr 2006 04:59:17 GMT (envelope-from jmg@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k3A4xHqv048035 for perforce@freebsd.org; Mon, 10 Apr 2006 04:59:17 GMT (envelope-from jmg@freebsd.org) Date: Mon, 10 Apr 2006 04:59:17 GMT Message-Id: <200604100459.k3A4xHqv048035@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jmg@freebsd.org using -f From: John-Mark Gurney To: Perforce Change Reviews Cc: Subject: PERFORCE change 94899 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: Mon, 10 Apr 2006 04:59:18 -0000 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); }