Date: Sun, 9 Apr 2006 23:29:06 GMT From: John-Mark Gurney <jmg@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 94878 for review Message-ID: <200604092329.k39NT67Q048794@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604092329.k39NT67Q048794>