From owner-p4-projects@FreeBSD.ORG Sat Oct 7 23:15:05 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 148E416A47B; Sat, 7 Oct 2006 23:15:05 +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 DD42216A403 for ; Sat, 7 Oct 2006 23:15:04 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 71E1143D4C for ; Sat, 7 Oct 2006 23:15:04 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k97NF4Bh035562 for ; Sat, 7 Oct 2006 23:15:04 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k97NF3gt035541 for perforce@freebsd.org; Sat, 7 Oct 2006 23:15:03 GMT (envelope-from jb@freebsd.org) Date: Sat, 7 Oct 2006 23:15:03 GMT Message-Id: <200610072315.k97NF3gt035541@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 107461 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, 07 Oct 2006 23:15:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=107461 Change 107461 by jb@jb_freebsd7 on 2006/10/07 23:14:39 Manually update these files to match current since perforce appears to have ignored the updates, probably because they were originally integrated from a perforce branch. Affected files ... .. //depot/projects/dtrace/src/sys/sun4v/sun4v/autoconf.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/bus_machdep.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/clock.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/counter.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/db_disasm.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/db_hwwatch.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/db_interface.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/db_trace.c#4 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/dump_machdep.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/eeprom.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/elf_machdep.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/exception.S#4 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/gdb_machdep.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/hcall.S#4 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/hv_pci.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/hviommu.c#4 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/identcpu.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/in_cksum.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/interrupt.S#7 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/intr_machdep.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/iommu.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/locore.S#4 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/machdep.c#5 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/mem.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/mp_exception.S#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/mp_locore.S#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/mp_machdep.c#5 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/nexus.c#4 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/ofw_bus.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/ofw_machdep.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/pmap.c#14 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/prof_machdep.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/rtc.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/rwindow.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/simdisk.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/support.S#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/swtch.S#5 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/sys_machdep.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/t1_copy.S#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/tick.c#5 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/tlb.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/trap.c#9 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/trap_trace.S#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/tsb.c#4 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/tte.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/tte_hash.c#4 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/uio_machdep.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/vm_machdep.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/vnex.c#3 edit .. //depot/projects/dtrace/src/sys/sun4v/sun4v/wbuf.S#4 edit Differences ... ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/autoconf.c#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/sparc64/sparc64/autoconf.c,v 1.13 2005/05/29 23:44:22 marcel Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/autoconf.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ #include "opt_isa.h" ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/bus_machdep.c#3 (text+ko) ==== @@ -97,7 +97,7 @@ * and * from: FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.24 2001/08/15 * - * $FreeBSD: src/sys/sparc64/sparc64/bus_machdep.c,v 1.43 2005/01/15 09:20:47 scottl Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/bus_machdep.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/clock.c#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/sparc64/sparc64/clock.c,v 1.10 2003/02/03 17:53:15 jake Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/clock.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/counter.c#3 (text+ko) ==== @@ -22,7 +22,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/sparc64/sparc64/counter.c,v 1.6 2004/09/30 14:30:29 kensmith Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/counter.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/db_disasm.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * from: NetBSD: db_disasm.c,v 1.9 2000/08/16 11:29:42 pk Exp - * $FreeBSD: src/sys/sparc64/sparc64/db_disasm.c,v 1.8 2005/01/07 02:29:23 imp Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/db_disasm.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/db_hwwatch.c#3 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/sparc64/sparc64/db_hwwatch.c,v 1.6 2005/09/10 03:01:25 marcel Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/db_hwwatch.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/db_interface.c#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/sparc64/sparc64/db_interface.c,v 1.10 2004/07/10 23:47:20 marcel Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/db_interface.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ #include @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/db_trace.c#4 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/sparc64/sparc64/db_trace.c,v 1.24 2005/08/03 04:27:39 jeff Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/db_trace.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ #include @@ -243,6 +243,7 @@ db_addr_t pc; int trap; int user; + int quit; if (count == -1) count = 1024; @@ -250,6 +251,7 @@ trap = 0; user = 0; npc = 0; + quit = 0; while (count-- && !user && !db_pager_quit) { pc = (db_addr_t)db_get_value((db_addr_t)&fp->fr_pc, sizeof(fp->fr_pc), FALSE); ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/dump_machdep.c#3 (text+ko) ==== @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/sparc64/sparc64/dump_machdep.c,v 1.8 2005/01/07 02:29:23 imp Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/dump_machdep.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/eeprom.c#3 (text+ko) ==== @@ -49,7 +49,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/eeprom.c,v 1.10 2005/11/30 16:13:49 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/eeprom.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); /* * clock (eeprom) attaches at EBus, FireHose or SBus ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/elf_machdep.c#3 (text+ko) ==== @@ -36,7 +36,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * from: NetBSD: mdreloc.c,v 1.5 2001/04/25 12:24:51 kleink Exp - * $FreeBSD: src/sys/sparc64/sparc64/elf_machdep.c,v 1.21 2005/12/26 21:23:55 sobomax Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/elf_machdep.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/exception.S#4 (text+ko) ==== @@ -23,14 +23,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - - - * $ Exp $ */ #include -__FBSDID("$$") +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/exception.S,v 1.1 2006/10/05 06:14:28 kmacy Exp $") #include "opt_compat.h" #include "opt_ddb.h" @@ -1379,6 +1376,23 @@ wrpr %g0, %g5, %cleanwin ldx [%g6 + PCB_KSTACK], %g6 sub %g6, TF_SIZEOF, %g6 +#ifdef DEBUG_KSTACK + mov %o0, %g5 + mov %o3, %l0 + mov %o4, %l1 + mov %o5, %l2 + mov %o6, %l3 + mov %o7, %l4 + mov 0x10, %o0 + mov %g6, %o1 + ta TTRACE_ADDENTRY + mov %g5, %o0 + mov %l0, %o3 + mov %l1, %o4 + mov %l2, %o5 + mov %l3, %o6 + mov %l4, %o7 +#endif save %g6, 0, %sp rdpr %canrestore, %l0 @@ -1433,19 +1447,16 @@ bge,pt %xcc, 0f nop call panic -! MAGIC_EXIT 0: #endif wrpr %g0, %g4, %pil 1: wrpr %g0, %g6, %tnpc - wrpr %g0, 0, %gl stx %g7, [%l7 + TF_G7] ! save g7 before it can be overwritten by PCPU when returning from an interrupt wrpr %g0, 1, %gl - - rdpr %cwp, %l0 + rdpr %cwp, %l0 set TSTATE_KERNEL, %l1 wrpr %l1, %l0, %tstate done @@ -1475,6 +1486,7 @@ mov 1, lock_bit ; \ add addr, 8, addr ; \ sllx lock_bit, 56, lock_bit ; \ + stxa %o7, [PCPU(CALLER)]%asi ; /* XXX DEBUG */\ label1: ; \ ldxa [addr]%asi, oldval; \ or oldval, lock_bit, newval; \ @@ -1515,7 +1527,7 @@ label2: ENTRY(hash_bucket_lock) - wr %g0, ASI_N, %asi + wr %g0, ASI_N, %asi rdpr %pstate, %o1 and %o1, PSTATE_INTR_DISABLE, %o2 wrpr %o2, %pstate @@ -1588,7 +1600,6 @@ add PCPU_REG, %g1, %g1 SAVE_LOCALS_ASI(%g1) mov 0, %g1 ! cansave is 0 - ! %g1 == %cansave ! %g2 == hash scratch value ! %g3 == TWDW ASI @@ -1907,4 +1918,4 @@ sllx %g7, TRAP_CTX_SHIFT, %g7 or %g7, %g5, %g5 done -END(tl1_trap) +END(tl1_trap) ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/gdb_machdep.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/gdb_machdep.c,v 1.3 2005/01/07 02:29:23 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/gdb_machdep.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); #include #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/hcall.S#4 (text+ko) ==== @@ -30,8 +30,10 @@ * Hypervisor calls */ #define _ASM - + #include +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/hcall.S,v 1.1 2006/10/05 06:14:28 kmacy Exp $") + #include #include #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/hv_pci.c#3 (text+ko) ==== @@ -23,10 +23,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ * */ +#include +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/hv_pci.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); + /* * Support for the Hypervisor PCI bus. */ @@ -36,8 +38,6 @@ #include #include #include -#include -#include #include #include #include @@ -50,6 +50,7 @@ #include #include +#include #include #include @@ -73,8 +74,6 @@ static device_attach_t hvpci_attach; static bus_read_ivar_t hvpci_read_ivar; static bus_write_ivar_t hvpci_write_ivar; -static bus_setup_intr_t hvpci_setup_intr; -static bus_teardown_intr_t hvpci_teardown_intr; static bus_alloc_resource_t hvpci_alloc_resource; static bus_activate_resource_t hvpci_activate_resource; static bus_deactivate_resource_t hvpci_deactivate_resource; @@ -100,8 +99,8 @@ DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, hvpci_read_ivar), DEVMETHOD(bus_write_ivar, hvpci_write_ivar), - DEVMETHOD(bus_setup_intr, hvpci_setup_intr), - DEVMETHOD(bus_teardown_intr, hvpci_teardown_intr), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_alloc_resource, hvpci_alloc_resource), DEVMETHOD(bus_activate_resource, hvpci_activate_resource), DEVMETHOD(bus_deactivate_resource, hvpci_deactivate_resource), @@ -178,14 +177,6 @@ /* Setup the HyperVisor devhandle for this bus */ sc->hs_devhandle = nexus_get_devhandle(dev); - /* initalize intr resources */ - sc->hs_pci_intr_rman.rm_type = RMAN_ARRAY; - sc->hs_pci_intr_rman.rm_descr = "HyperVisor PCI Interrupts"; - if (rman_init(&sc->hs_pci_intr_rman) != 0 || - /* We use 1 (INTA) through 4 (INTD) */ - rman_manage_region(&sc->hs_pci_intr_rman, 1, 4) != 0) - panic("%s: failed to set up intr rman", __func__); - /* Pull in the ra addresses out of OFW */ nrange = OF_getprop_alloc(node, "ranges", sizeof *range, (void **)&range); @@ -250,6 +241,9 @@ free(dvma, M_OFWPROP); + /* Setup ofw imap */ + ofw_bus_setup_iinfo(node, &sc->hs_pci_iinfo, sizeof(ofw_pci_intr_t)); + device_add_child(dev, "pci", -1); return (bus_generic_attach(dev)); @@ -343,8 +337,24 @@ static int hvpci_route_interrupt(device_t bridge, device_t dev, int pin) { + struct hvpci_softc *sc; + struct ofw_pci_register reg; + phandle_t node; + ofw_pci_intr_t pintr, mintr; + int obli; + uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; + + sc = device_get_softc(bridge); + node = ofw_bus_get_node(dev); + pintr = pin; + obli = ofw_bus_lookup_imap(node, &sc->hs_pci_iinfo, ®, sizeof(reg), + &pintr, sizeof(pintr), &mintr, sizeof(mintr), maskbuf); + device_printf(dev, "called hvpci_route_intr: %d, got: mintr: %#x\n", + obli, mintr); + if (obli) + return (mintr); - return (pin); + panic("pin %d not found in imap of %s", pin, device_get_nameunit(bridge)); } static phandle_t @@ -421,74 +431,6 @@ return (ENOENT); } -static int -hvpci_setup_intr(device_t dev, device_t child, struct resource *ires, - int flags, driver_intr_t *intr, void *arg, void **cookiep) -{ - struct hvpci_softc *sc; - int pciintr, rid; - int error; - - - sc = device_get_softc(dev); - - rid = rman_get_start(ires); - KASSERT(rid >= 1 && rid <= 4, ("interrupt out of range")); - - pciintr = rid - 1; - if (sc->hs_intr[pciintr] == NULL) { - if ((sc->hs_intr[pciintr] = bus_alloc_resource_any(dev, - SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { - device_printf(dev, "couldn't alloc interrupt\n"); - return (ENXIO); - } - sc->hs_intrrefcnt[pciintr] = 1; - } else - sc->hs_intrrefcnt[pciintr]++; - - error = bus_setup_intr(dev, sc->hs_intr[pciintr], flags, intr, arg, - cookiep); - if (error) { - sc->hs_intrrefcnt[pciintr]--; - if (sc->hs_intrrefcnt[pciintr] == 0) { - bus_release_resource(dev, SYS_RES_IRQ, - rman_get_rid(sc->hs_intr[pciintr]), - sc->hs_intr[pciintr]); - sc->hs_intr[pciintr] = NULL; - } - device_printf(dev, "bus_setup_intr: %d\n", error); - return (error); - } - return (0); -} - -static int -hvpci_teardown_intr(device_t dev, device_t child, struct resource *vec, - void *cookie) -{ - struct hvpci_softc *sc; - int pciintr; - int error; - - sc = device_get_softc(dev); - pciintr = rman_get_start(vec); - KASSERT(pciintr >= 1 && pciintr <= 4, ("interrupt out of range")); - pciintr--; - - error = bus_teardown_intr(dev, sc->hs_intr[pciintr], cookie); - if (error) - return (error); - - sc->hs_intrrefcnt[pciintr]--; - if (sc->hs_intrrefcnt[pciintr] == 0) { - bus_release_resource(dev, SYS_RES_IRQ, - rman_get_rid(sc->hs_intr[pciintr]), sc->hs_intr[pciintr]); - sc->hs_intr[pciintr] = NULL; - } - - return (0); -} - static struct resource * hvpci_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) @@ -507,11 +449,8 @@ switch (type) { case SYS_RES_IRQ: - if (end - start != 0) - return NULL; - rm = &sc->hs_pci_intr_rman; - bt = NULL; - bh = 0; + return BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, + rid, start, end, count, flags); break; case SYS_RES_MEMORY: @@ -534,12 +473,6 @@ } rv = rman_reserve_resource(rm, start, end, count, flags, child); -#ifdef DEBUG - if (type == SYS_RES_IRQ) { - printf("%s: reserve_resource: start: %ld, end: %ld, flags: %#x, rv: %p\n", - __func__, start, end, flags, rv); - } -#endif if (rv == NULL) return (NULL); ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/hviommu.c#4 (text+ko) ==== @@ -97,7 +97,7 @@ * from: @(#)sbus.c 8.1 (Berkeley) 6/11/93 * from: NetBSD: iommu.c,v 1.42 2001/08/06 22:02:58 eeh Exp * - * $FreeBSD: src/sys/sparc64/sparc64/iommu.c,v 1.43 2005/01/31 07:28:04 scottl Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/hviommu.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/identcpu.c#3 (text+ko) ==== @@ -6,7 +6,7 @@ * As long as the above copyright statement and this notice remain * unchanged, you can do what ever you want with this file. * - * $FreeBSD: src/sys/sparc64/sparc64/identcpu.c,v 1.15 2005/12/31 14:39:19 netchild Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/identcpu.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ #include #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/in_cksum.c#3 (text+ko) ==== @@ -54,7 +54,7 @@ * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91 * from: FreeBSD: src/sys/i386/i386/in_cksum.c,v 1.22 2000/11/25 * - * $FreeBSD: src/sys/sparc64/sparc64/in_cksum.c,v 1.2 2004/04/07 05:00:01 imp Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/in_cksum.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/interrupt.S#7 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/interrupt.S,v 1.8 2005/04/16 15:05:56 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/interrupt.S,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); #include "opt_simulator.h" #include "opt_trap_trace.h" @@ -249,11 +249,12 @@ * %g4 queue size mask * %g6 head ptr */ - mov %o0, %g1 - mov %o5, %g6 +! mov %o0, %g1 +! mov %o5, %g6 +! PUTCHAR(0x2b) ! PUTCHAR(0x2b) - mov %g1, %o0 - mov %g6, %o5 +! mov %g1, %o0 +! mov %g6, %o5 mov DEV_MONDO_QUEUE_HEAD, %g1 ldxa [%g1]ASI_QUEUE, %g6 ! %g6 = head ptr @@ -283,7 +284,7 @@ set IV_MAX, %g4 cmp %g5, %g4 bgeu,a,pn %xcc, 1f - ldx [PCPU(DEV_Q_SIZE)], %g4 ! queue size (delay slot) + ldx [PCPU(DEV_Q_SIZE)], %g4 ! queue size (delay slot) /* * Find the function, argument and desired priority from the @@ -353,12 +354,20 @@ mov 1, %g6 sllx %g6, %g1, %g6 wr %g6, 0, %set_softint - +#if 0 + mov %o0, %g1 + mov %o5, %g6 + PUTCHAR(0x2b) + PUTCHAR(0x2b) + mov %g1, %o0 + mov %g6, %o5 +#endif /* * Done, retry the instruction */ 0: retry + /* NOTREACHED */ END(dev_mondo) #endif /* lint */ @@ -448,18 +457,6 @@ rdpr %tick, %g4 stxa %g4, [PCPU(PAD) + 8]%asi - /* pcpu->pad[3] = %tl */ - rdpr %tl, %g4 - stxa %g4, [PCPU(PAD) + 24]%asi - - /* pcpu->pad[4] = %tpc */ - rdpr %tpc, %g4 - stxa %g4, [PCPU(PAD) + 32]%asi - - /* pcpu->pad[5] = %tnpc */ - rdpr %tnpc, %g4 - stxa %g4, [PCPU(PAD) + 40]%asi - /* * Increment a counter which might help us notice if we're * stuck in a loop. pcpu->pad[2] = count ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/intr_machdep.c#3 (text+ko) ==== @@ -59,7 +59,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/intr_machdep.c,v 1.24 2005/10/25 19:48:48 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/intr_machdep.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); #include #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/iommu.c#3 (text+ko) ==== @@ -97,7 +97,7 @@ * from: @(#)sbus.c 8.1 (Berkeley) 6/11/93 * from: NetBSD: iommu.c,v 1.42 2001/08/06 22:02:58 eeh Exp * - * $FreeBSD: src/sys/sparc64/sparc64/iommu.c,v 1.43 2005/01/31 07:28:04 scottl Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/iommu.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ /* ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/locore.S#4 (text+ko) ==== @@ -24,8 +24,10 @@ * SUCH DAMAGE. */ + + #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/locore.S,v 1.22 2005/11/30 16:09:10 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/locore.S,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); #include #include @@ -40,7 +42,7 @@ .globl nwin_minus_one .set nwin_minus_one,7 - + /* * void _start(caddr_t metadata, u_long o1, u_long o2, u_long o3, * u_long ofw_vec) ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/machdep.c#5 (text+ko) ==== @@ -36,7 +36,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/machdep.c,v 1.126 2005/10/14 12:43:47 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/machdep.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); #include "opt_compat.h" #include "opt_ddb.h" @@ -110,6 +110,9 @@ #include #include +/* XXX move this to a header */ +extern void mdesc_init(void); + typedef int ofw_vec_t(void *); #ifdef DDB @@ -443,6 +446,8 @@ msgbufinit(msgbufp, MSGBUF_SIZE); mutex_init(); + + mdesc_init(); OF_getprop(root, "name", sparc64_model, sizeof(sparc64_model) - 1); ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/mem.c#3 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/mem.c,v 1.16 2005/11/30 16:09:10 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/mem.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); /* * Memory special file ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/mp_exception.S#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/mp_exception.S,v 1.12 2003/06/19 05:27:04 jake Exp $"); +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/mp_exception.S,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); #include #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/mp_locore.S#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/mp_locore.S,v 1.7 2003/04/29 00:37:41 jake Exp $"); +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/mp_locore.S,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); #include #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/mp_machdep.c#5 (text+ko) ==== @@ -55,7 +55,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/mp_machdep.c,v 1.31 2006/02/07 21:22:02 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/mp_machdep.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); #include "opt_trap_trace.h" ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/nexus.c#4 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/nexus.c,v 1.17 2005/05/21 20:19:27 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/nexus.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); #include #include @@ -306,11 +306,17 @@ driver_intr_t *intr, void *arg, void **cookiep) { struct nexus_devinfo *ndi; + device_t ichild; uint64_t ihdl; uint64_t ino; int error, cpuid; - ndi = device_get_ivars(child); + /* we need the devinfo from the immediate child */ + ichild = child; + while (device_get_parent(ichild) != dev) + ichild = device_get_parent(ichild); + + ndi = device_get_ivars(ichild); if (res == NULL) panic("%s: NULL interrupt resource!", __func__); ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/ofw_bus.c#3 (text+ko) ==== @@ -54,7 +54,7 @@ * * from: $NetBSD: ofw_machdep.c,v 1.16 2001/07/20 00:07:14 eeh Exp $ * - * $FreeBSD: src/sys/sparc64/sparc64/ofw_bus.c,v 1.12 2005/01/07 02:29:23 imp Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/ofw_bus.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ /* ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/ofw_machdep.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/ofw_machdep.c,v 1.14 2005/05/21 20:17:01 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/ofw_machdep.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); /* * Some Open Firmware helper functions that are likely machine dependent. ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/pmap.c#14 (text+ko) ==== @@ -23,7 +23,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $ Exp $ */ #include @@ -1531,15 +1530,15 @@ TAILQ_INIT(&m->md.pv_list); m->md.pv_list_count = 0; } - +/* + * Lower the permission for all mappings to a given page. + */ void pmap_remove_write(vm_page_t m) { - DPRINTF("pmap_remove_write(0x%lx)\n", VM_PAGE_TO_PHYS(m)); tte_clear_phys_bit(m, VTD_SW_W); } - /* * Initialize the pmap associated with process 0. */ ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/prof_machdep.c#3 (text+ko) ==== @@ -26,7 +26,7 @@ * * from: src/sys/i386/isa/prof_machdep.c,v 1.16 2000/07/04 11:25:19 * - * $FreeBSD: src/sys/sparc64/sparc64/prof_machdep.c,v 1.1 2002/07/29 00:45:13 jake Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/prof_machdep.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ #ifdef GUPROF ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/rtc.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/rtc.c,v 1.5 2005/11/30 16:13:49 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/rtc.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); /* * The `rtc' device is a MC146818 compatible clock found on the ISA bus ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/rwindow.c#3 (text+ko) ==== @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * from: BSDI: trap.c,v 1.17.2.9 1999/10/19 15:29:52 cp Exp - * $FreeBSD: src/sys/sparc64/sparc64/rwindow.c,v 1.9 2004/11/27 06:51:38 das Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/rwindow.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/simdisk.c#3 (text+ko) ==== @@ -1,4 +1,3 @@ - /*- * Copyright (c) 2006 Kip Macy * Copyright (c) 2001 Benno Rice @@ -25,10 +24,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $ Exp $ */ #include -__FBSDID("$$"); +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/simdisk.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); #include #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/support.S#3 (text+ko) ==== @@ -25,8 +25,8 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/support.S,v 1.29 2003/11/11 06:41:54 jake Exp $"); - +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/support.S,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); + #include #include #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/swtch.S#5 (text+ko) ==== @@ -25,13 +25,12 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/swtch.S,v 1.33 2004/05/26 12:06:52 tmm Exp $"); +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/swtch.S,v 1.1 2006/10/05 06:14:28 kmacy Exp $"); #include #include #include #include -#include #include #include "assym.s" @@ -215,14 +214,15 @@ cmp %g0, %o0 be %xcc, 4f nop - call pmap_set_ctx_panic - mov %i2, %o2 + MAGIC_TRAP_ON + MAGIC_EXIT + 4: /* * install the new secondary context number in the cpu. */ - sethi %hi(FLUSH_ADDR), %l2 + SET_MMU_CONTEXT(%l6, %l5) - flush %l2 + membar #Sync /* * Done. Return and load the new process's window from the stack. */ ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/sys_machdep.c#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/sparc64/sparc64/sys_machdep.c,v 1.14 2005/01/19 18:24:07 jhb Exp $ + * $FreeBSD: src/sys/sun4v/sun4v/sys_machdep.c,v 1.1 2006/10/05 06:14:28 kmacy Exp $ */ #include ==== //depot/projects/dtrace/src/sys/sun4v/sun4v/t1_copy.S#3 (text+ko) ==== @@ -26,6 +26,8 @@ */ #include +__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/t1_copy.S,v 1.1 2006/10/05 06:14:28 kmacy Exp $") >>> TRUNCATED FOR MAIL (1000 lines) <<<