From owner-p4-projects@FreeBSD.ORG Sun Apr 9 23:29:07 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 8590516A404; Sun, 9 Apr 2006 23:29:07 +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 5F72D16A400 for ; Sun, 9 Apr 2006 23:29:07 +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 14B1C43D46 for ; Sun, 9 Apr 2006 23:29:07 +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 k39NT636048797 for ; Sun, 9 Apr 2006 23:29:06 GMT (envelope-from jmg@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k39NT67Q048794 for perforce@freebsd.org; Sun, 9 Apr 2006 23:29:06 GMT (envelope-from jmg@freebsd.org) Date: Sun, 9 Apr 2006 23:29:06 GMT Message-Id: <200604092329.k39NT67Q048794@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 94878 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: Sun, 09 Apr 2006 23:29:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=94878 Change 94878 by jmg@jmg_arlene on 2006/04/09 23:28:51 return _INVALID_IRQ when requesting an interrupt, we might want to expand this value to anything outside 1 through 4... in route_interrupt, just return the pin... no more routing to do.. Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/hv_pci.c#35 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/hv_pci.c#35 (text+ko) ==== @@ -81,9 +81,7 @@ static pcib_maxslots_t hvpci_maxslots; static pcib_read_config_t hvpci_read_config; static pcib_write_config_t hvpci_write_config; -#ifdef notyet static pcib_route_interrupt_t hvpci_route_interrupt; -#endif static device_method_t hv_pcib_methods[] = { /* Device interface */ @@ -109,9 +107,7 @@ DEVMETHOD(pcib_maxslots, hvpci_maxslots), DEVMETHOD(pcib_read_config, hvpci_read_config), DEVMETHOD(pcib_write_config, hvpci_write_config), -#if 0 DEVMETHOD(pcib_route_interrupt, hvpci_route_interrupt), -#endif { 0, 0 } }; @@ -273,6 +269,8 @@ switch (width) { case 1: ret = data & 0xff; + if (ret == 0 && reg == PCIR_INTLINE) + ret = PCI_INVALID_IRQ; #if 0 printf("%ld = read_config(%#lx, %#x, %d, %d) = %#x\n", r, sc->hs_devhandle, HVPCI_BDF(bus, slot, func), reg, width, ret); @@ -337,12 +335,12 @@ printf("put failed with: %ld\n", r); } -#ifdef notyet static int hvpci_route_interrupt(device_t bridge, device_t dev, int pin) { + + return (pin); } -#endif static int hvpci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) @@ -385,11 +383,11 @@ sc = device_get_softc(dev); - /* we use 0 through 3 for INTx interrupts, while sun uses 1 through 4 */ + /* sun4v uses 1 through 4 interrupts */ pciintr = rman_get_start(ires); - KASSERT(pciintr >= 0 && pciintr <= 3, + KASSERT(pciintr >= 1 && pciintr <= 4, ("interrupt out of range")); - rid = pciintr + 1; + rid = pciintr; 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) {