diff -upr sys.org/dev/acpica/acpi_pci.c sys/dev/acpica/acpi_pci.c --- sys.org/dev/acpica/acpi_pci.c Tue Feb 18 06:20:34 2003 +++ sys/dev/acpica/acpi_pci.c Wed Jun 25 17:49:28 2003 @@ -79,7 +79,7 @@ static device_method_t acpi_pci_methods[ DEVMETHOD(device_attach, acpi_pci_attach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_resume, pci_resume), /* Bus interface */ DEVMETHOD(bus_print_child, pci_print_child), diff -upr sys.org/dev/pci/pci.c sys/dev/pci/pci.c --- sys.org/dev/pci/pci.c Sun Jun 22 15:09:14 2003 +++ sys/dev/pci/pci.c Wed Jun 25 18:13:44 2003 @@ -88,7 +88,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(device_attach, pci_attach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_resume, pci_resume), /* Bus interface */ DEVMETHOD(bus_print_child, pci_print_child), @@ -1374,6 +1374,18 @@ pci_alloc_resource(device_t dev, device_ return (NULL); break; } + if ((type == SYS_RES_IOPORT || type == SYS_RES_MEMORY) && + resource_list_find(rl, type, *rid) == NULL) { + struct resource *res; + res = BUS_ALLOC_RESOURCE(device_get_parent(dev), + child, type, rid, start, end, count, flags); + if (res == NULL) + return (NULL); + printf("%s: %lx:%lx\n", __func__, rman_get_start(res), + rman_get_end(res)); + BUS_RELEASE_RESOURCE(device_get_parent(dev), child, + type, *rid, res); + } } return (resource_list_alloc(rl, dev, child, type, rid, @@ -1498,3 +1510,36 @@ pci_modevent(module_t mod, int what, voi return (0); } + +int +pci_resume(device_t dev) +{ + int numdevs; + int i; + device_t *children; + device_t child; + struct pci_devinfo *dinfo; + pcicfgregs *cfg; + + device_get_children(dev, &children, &numdevs); + + for (i = 0; i < numdevs; i++) { + child = children[i]; + + dinfo = device_get_ivars(child); + cfg = &dinfo->cfg; + if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) { + cfg->intline = PCIB_ROUTE_INTERRUPT(device_get_parent(dev), + child, cfg->intpin); + if (PCI_INTERRUPT_VALID(cfg->intline)) { + pci_write_config(child, PCIR_INTLINE, + cfg->intline, 1); + } + } + } + + free(children, M_TEMP); + + return (bus_generic_resume(dev)); +} + diff -upr sys.org/dev/pci/pci_private.h sys/dev/pci/pci_private.h --- sys.org/dev/pci/pci_private.h Wed Apr 16 12:15:08 2003 +++ sys/dev/pci/pci_private.h Wed Jun 25 17:49:29 2003 @@ -68,6 +68,7 @@ struct pci_devinfo *pci_read_device(devi size_t size); void pci_print_verbose(struct pci_devinfo *dinfo); int pci_freecfg(struct pci_devinfo *dinfo); +int pci_resume(device_t dev); int pci_child_location_str_method(device_t cbdev, device_t child, char *buf, size_t buflen); int pci_child_pnpinfo_str_method(device_t cbdev, device_t child,