Index: sys/arm/mv/mv_pci.c =================================================================== --- sys/arm/mv/mv_pci.c +++ sys/arm/mv/mv_pci.c @@ -896,11 +896,9 @@ case SYS_RES_MEMORY: rm = &sc->sc_mem_rman; break; -#ifdef PCI_RES_BUS case PCI_RES_BUS: return (pci_domain_alloc_bus(sc->ap_segment, child, rid, start, end, count, flags)); -#endif default: return (BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, type, rid, start, end, count, flags)); @@ -937,12 +935,10 @@ mv_pcib_release_resource(device_t dev, device_t child, int type, int rid, struct resource *res) { -#ifdef PCI_RES_BUS struct mv_pcib_softc *sc = device_get_softc(dev); if (type == PCI_RES_BUS) return (pci_domain_release_bus(sc->ap_segment, child, rid, res)); -#endif if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY) return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, type, rid, res)); Index: sys/arm64/cavium/thunder_pcie_pem.c =================================================================== --- sys/arm64/cavium/thunder_pcie_pem.c +++ sys/arm64/cavium/thunder_pcie_pem.c @@ -315,10 +315,8 @@ struct rman *rm; sc = device_get_softc(dev); -#if defined(PCI_RES_BUS) if (type == PCI_RES_BUS) return (pci_domain_adjust_bus(sc->id, child, res, start, end)); -#endif rm = thunder_pem_rman(sc, type); if (rm == NULL) @@ -634,11 +632,9 @@ struct resource *res; device_t parent_dev; -#if defined(PCI_RES_BUS) if (type == PCI_RES_BUS) return (pci_domain_alloc_bus(sc->id, child, rid, start, end, count, flags)); -#endif rm = thunder_pem_rman(sc, type); if (rm == NULL) { /* Find parent device. On ThunderX we know an exact path. */ @@ -693,12 +689,10 @@ struct resource *res) { device_t parent_dev; -#if defined(PCI_RES_BUS) struct thunder_pem_softc *sc = device_get_softc(dev); if (type == PCI_RES_BUS) return (pci_domain_release_bus(sc->id, child, rid, res)); -#endif /* Find parent device. On ThunderX we know an exact path. */ parent_dev = device_get_parent(device_get_parent(dev)); Index: sys/dev/acpica/acpi_pcib_acpi.c =================================================================== --- sys/dev/acpica/acpi_pcib_acpi.c +++ sys/dev/acpica/acpi_pcib_acpi.c @@ -98,11 +98,9 @@ static int acpi_pcib_acpi_adjust_resource(device_t dev, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end); -#ifdef PCI_RES_BUS static int acpi_pcib_acpi_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); -#endif static int acpi_pcib_request_feature(device_t pcib, device_t dev, enum pci_feature feature); static bus_dma_tag_t acpi_pcib_get_dma_tag(device_t bus, device_t child); @@ -120,9 +118,7 @@ DEVMETHOD(bus_write_ivar, acpi_pcib_write_ivar), DEVMETHOD(bus_alloc_resource, acpi_pcib_acpi_alloc_resource), DEVMETHOD(bus_adjust_resource, acpi_pcib_acpi_adjust_resource), -#if defined(PCI_RES_BUS) DEVMETHOD(bus_release_resource, acpi_pcib_acpi_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), @@ -240,11 +236,9 @@ case ACPI_IO_RANGE: type = SYS_RES_IOPORT; break; -#ifdef PCI_RES_BUS case ACPI_BUS_NUMBER_RANGE: type = PCI_RES_BUS; break; -#endif default: return (AE_OK); } @@ -279,7 +273,6 @@ return (AE_OK); } -#if defined(PCI_RES_BUS) static int first_decoded_bus(struct acpi_hpcib_softc *sc, rman_res_t *startp) { @@ -291,7 +284,6 @@ *startp = rle->start; return (0); } -#endif static int acpi_pcib_osc(struct acpi_hpcib_softc *sc, uint32_t osc_ctl) @@ -356,11 +348,9 @@ ACPI_STATUS status; static int bus0_seen = 0; u_int slot, func, busok; -#if defined(PCI_RES_BUS) struct resource *bus_res; rman_res_t start; int rid; -#endif int error, domain; uint8_t busno; @@ -473,7 +463,6 @@ } } -#if defined(PCI_RES_BUS) /* * If nothing else worked, hope that ACPI at least lays out the * Host-PCI bridges in order and that as a result the next free @@ -512,18 +501,6 @@ return (ENXIO); } } -#else - /* - * If nothing else worked, hope that ACPI at least lays out the - * host-PCI bridges in order and that as a result our unit number - * is actually our bus number. There are several reasons this - * might not be true. - */ - if (busok == 0) { - sc->ap_bus = device_get_unit(dev); - device_printf(dev, "trying bus number %d\n", sc->ap_bus); - } -#endif /* If this is bus 0 on segment 0, note that it has been seen already. */ if (sc->ap_segment == 0 && sc->ap_bus == 0) @@ -554,9 +531,7 @@ errout: device_printf(device_get_parent(dev), "couldn't attach pci bus\n"); -#if defined(PCI_RES_BUS) pcib_host_res_free(dev, &sc->ap_host_res); -#endif return (error); } @@ -684,11 +659,9 @@ #endif sc = device_get_softc(dev); -#ifdef PCI_RES_BUS if (type == PCI_RES_BUS) return (pci_domain_alloc_bus(sc->ap_segment, child, rid, start, end, count, flags)); -#endif res = pcib_host_res_alloc(&sc->ap_host_res, child, type, rid, start, end, count, flags); @@ -712,16 +685,13 @@ struct acpi_hpcib_softc *sc; sc = device_get_softc(dev); -#ifdef PCI_RES_BUS if (type == PCI_RES_BUS) return (pci_domain_adjust_bus(sc->ap_segment, child, r, start, end)); -#endif return (pcib_host_res_adjust(&sc->ap_host_res, child, type, r, start, end)); } -#ifdef PCI_RES_BUS int acpi_pcib_acpi_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r) @@ -733,7 +703,6 @@ return (pci_domain_release_bus(sc->ap_segment, child, rid, r)); return (bus_generic_release_resource(dev, child, type, rid, r)); } -#endif static int acpi_pcib_request_feature(device_t pcib, device_t dev, enum pci_feature feature) Index: sys/dev/cardbus/cardbus.c =================================================================== --- sys/dev/cardbus/cardbus.c +++ sys/dev/cardbus/cardbus.c @@ -96,13 +96,10 @@ cardbus_attach(device_t cbdev) { struct cardbus_softc *sc; -#ifdef PCI_RES_BUS int rid; -#endif sc = device_get_softc(cbdev); sc->sc_dev = cbdev; -#ifdef PCI_RES_BUS rid = 0; sc->sc_bus = bus_alloc_resource(cbdev, PCI_RES_BUS, &rid, pcib_get_bus(cbdev), pcib_get_bus(cbdev), 1, 0); @@ -110,25 +107,18 @@ device_printf(cbdev, "failed to allocate bus number\n"); return (ENXIO); } -#else - device_printf(cbdev, "Your bus numbers may be AFU\n"); -#endif return (0); } static int cardbus_detach(device_t cbdev) { -#ifdef PCI_RES_BUS struct cardbus_softc *sc; -#endif cardbus_detach_card(cbdev); -#ifdef PCI_RES_BUS sc = device_get_softc(cbdev); device_printf(cbdev, "Freeing up the allocatd bus\n"); (void)bus_release_resource(cbdev, PCI_RES_BUS, 0, sc->sc_bus); -#endif return (0); } Index: sys/dev/cardbus/cardbusvar.h =================================================================== --- sys/dev/cardbus/cardbusvar.h +++ sys/dev/cardbus/cardbusvar.h @@ -70,9 +70,7 @@ struct cardbus_softc { device_t sc_dev; -#ifdef PCI_RES_BUS struct resource *sc_bus; -#endif }; /* Index: sys/dev/ofw/ofw_pcib.c =================================================================== --- sys/dev/ofw/ofw_pcib.c +++ sys/dev/ofw/ofw_pcib.c @@ -413,12 +413,10 @@ sc = device_get_softc(bus); -#if defined(PCI_RES_BUS) if (type == PCI_RES_BUS) { return (pci_domain_alloc_bus(sc->sc_pci_domain, child, rid, start, end, count, flags | needactivate)); } -#endif rm = ofw_pcib_get_rman(sc, type, flags); if (rm == NULL) { @@ -458,11 +456,9 @@ sc = device_get_softc(bus); -#if defined(PCI_RES_BUS) if (type == PCI_RES_BUS) return (pci_domain_release_bus(sc->sc_pci_domain, child, rid, res)); -#endif rm = ofw_pcib_get_rman(sc, type, rman_get_flags(res)); if (rm == NULL) { @@ -619,11 +615,9 @@ struct ofw_pci_softc *sc; sc = device_get_softc(bus); -#if defined(PCI_RES_BUS) if (type == PCI_RES_BUS) return (pci_domain_adjust_bus(sc->sc_pci_domain, child, res, start, end)); -#endif rm = ofw_pcib_get_rman(sc, type, rman_get_flags(res)); if (rm == NULL) { Index: sys/dev/pccbb/pccbb_pci.c =================================================================== --- sys/dev/pccbb/pccbb_pci.c +++ sys/dev/pccbb/pccbb_pci.c @@ -279,10 +279,6 @@ static int cbb_pci_attach(device_t brdev) { -#if !defined(PCI_RES_BUS) - static int curr_bus_number = 2; /* XXX EVILE BAD (see below) */ - uint32_t pribus; -#endif struct cbb_softc *sc = (struct cbb_softc *)device_get_softc(brdev); struct sysctl_ctx_list *sctx; struct sysctl_oid *soid; @@ -296,13 +292,8 @@ sc->cbdev = NULL; sc->domain = pci_get_domain(brdev); sc->pribus = pcib_get_bus(parent); -#if defined(PCI_RES_BUS) pci_write_config(brdev, PCIR_PRIBUS_2, sc->pribus, 1); pcib_setup_secbus(brdev, &sc->bus, 1); -#else - sc->bus.sec = pci_read_config(brdev, PCIR_SECBUS_2, 1); - sc->bus.sub = pci_read_config(brdev, PCIR_SUBBUS_2, 1); -#endif SLIST_INIT(&sc->rl); rid = CBBR_SOCKBASE; @@ -354,32 +345,6 @@ CTLFLAG_RD, &sc->subbus, 0, "io range 2 open"); #endif -#if !defined(PCI_RES_BUS) - /* - * This is a gross hack. We should be scanning the entire pci - * tree, assigning bus numbers in a way such that we (1) can - * reserve 1 extra bus just in case and (2) all sub buses - * are in an appropriate range. - */ - DEVPRINTF((brdev, "Secondary bus is %d\n", sc->bus.sec)); - pribus = pci_read_config(brdev, PCIR_PRIBUS_2, 1); - if (sc->bus.sec == 0 || sc->pribus != pribus) { - if (curr_bus_number <= sc->pribus) - curr_bus_number = sc->pribus + 1; - if (pribus != sc->pribus) { - DEVPRINTF((brdev, "Setting primary bus to %d\n", - sc->pribus)); - pci_write_config(brdev, PCIR_PRIBUS_2, sc->pribus, 1); - } - sc->bus.sec = curr_bus_number++; - sc->bus.sub = curr_bus_number++; - DEVPRINTF((brdev, "Secondary bus set to %d subbus %d\n", - sc->bus.sec, sc->bus.sub)); - pci_write_config(brdev, PCIR_SECBUS_2, sc->bus.sec, 1); - pci_write_config(brdev, PCIR_SUBBUS_2, sc->bus.sub, 1); - } -#endif - /* Map and establish the interrupt. */ rid = 0; sc->irq_res = bus_alloc_resource_any(brdev, SYS_RES_IRQ, &rid, @@ -432,16 +397,12 @@ static int cbb_pci_detach(device_t brdev) { -#if defined(PCI_RES_BUS) struct cbb_softc *sc = device_get_softc(brdev); -#endif int error; error = cbb_detach(brdev); -#if defined(PCI_RES_BUS) if (error == 0) pcib_free_secbus(brdev, &sc->bus); -#endif return (error); } @@ -790,7 +751,6 @@ return retval; } -#if defined(PCI_RES_BUS) static struct resource * cbb_pci_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) @@ -840,7 +800,6 @@ } return (cbb_release_resource(bus, child, type, rid, r)); } -#endif /************************************************************************/ /* PCI compat methods */ @@ -935,14 +894,9 @@ /* bus methods */ DEVMETHOD(bus_read_ivar, cbb_read_ivar), DEVMETHOD(bus_write_ivar, cbb_write_ivar), -#if defined(PCI_RES_BUS) DEVMETHOD(bus_alloc_resource, cbb_pci_alloc_resource), DEVMETHOD(bus_adjust_resource, cbb_pci_adjust_resource), DEVMETHOD(bus_release_resource, cbb_pci_release_resource), -#else - DEVMETHOD(bus_alloc_resource, cbb_alloc_resource), - DEVMETHOD(bus_release_resource, cbb_release_resource), -#endif DEVMETHOD(bus_activate_resource, cbb_activate_resource), DEVMETHOD(bus_deactivate_resource, cbb_deactivate_resource), DEVMETHOD(bus_driver_added, cbb_driver_added), Index: sys/dev/pci/pci.c =================================================================== --- sys/dev/pci/pci.c +++ sys/dev/pci/pci.c @@ -403,11 +403,9 @@ SYSCTL_INT(_hw_pci, OID_AUTO, clear_bars, CTLFLAG_RDTUN, &pci_clear_bars, 0, "Ignore firmware-assigned resources for BARs."); -#if defined(PCI_RES_BUS) static int pci_clear_buses; SYSCTL_INT(_hw_pci, OID_AUTO, clear_buses, CTLFLAG_RDTUN, &pci_clear_buses, 0, "Ignore firmware-assigned bus numbers."); -#endif static int pci_enable_ari = 1; SYSCTL_INT(_hw_pci, OID_AUTO, enable_ari, CTLFLAG_RDTUN, &pci_enable_ari, @@ -3675,7 +3673,6 @@ bus_release_resource(self, SYS_RES_MEMORY, rid, res); } -#if defined(PCI_RES_BUS) static void pci_reserve_secbus(device_t bus, device_t dev, pcicfgregs *cfg, struct resource_list *rl) @@ -3831,7 +3828,6 @@ return (resource_list_alloc(rl, dev, child, PCI_RES_BUS, rid, start, end, count, flags)); } -#endif static int pci_ea_bei_to_rid(device_t dev, int bei) @@ -4087,13 +4083,11 @@ uhci_early_takeover(dev); } -#if defined(PCI_RES_BUS) /* * Reserve resources for secondary bus ranges behind bridge * devices. */ pci_reserve_secbus(bus, dev, cfg, rl); -#endif } static struct pci_devinfo * @@ -4434,14 +4428,11 @@ { struct pci_softc *sc; int busno, domain; -#ifdef PCI_RES_BUS int rid; -#endif sc = device_get_softc(dev); domain = pcib_get_domain(dev); busno = pcib_get_bus(dev); -#ifdef PCI_RES_BUS rid = 0; sc->sc_bus = bus_alloc_resource(dev, PCI_RES_BUS, &rid, busno, busno, 1, 0); @@ -4449,7 +4440,6 @@ device_printf(dev, "failed to allocate bus number\n"); return (ENXIO); } -#endif if (bootverbose) device_printf(dev, "domain=%d, physical bus=%d\n", domain, busno); @@ -4481,20 +4471,16 @@ int pci_detach(device_t dev) { -#ifdef PCI_RES_BUS struct pci_softc *sc; -#endif int error; error = bus_generic_detach(dev); if (error) return (error); -#ifdef PCI_RES_BUS sc = device_get_softc(dev); error = bus_release_resource(dev, PCI_RES_BUS, 0, sc->sc_bus); if (error) return (error); -#endif return (device_delete_children(dev)); } @@ -5067,10 +5053,8 @@ pci_printf(&dinfo->cfg, "Device leaked memory resources\n"); if (resource_list_release_active(rl, dev, child, SYS_RES_IOPORT) != 0) pci_printf(&dinfo->cfg, "Device leaked I/O resources\n"); -#ifdef PCI_RES_BUS if (resource_list_release_active(rl, dev, child, PCI_RES_BUS) != 0) pci_printf(&dinfo->cfg, "Device leaked PCI bus numbers\n"); -#endif pci_cfg_save(child, dinfo, 1); } @@ -5507,11 +5491,9 @@ rl = &dinfo->resources; cfg = &dinfo->cfg; switch (type) { -#if defined(PCI_RES_BUS) case PCI_RES_BUS: return (pci_alloc_secbus(dev, child, rid, start, end, count, flags)); -#endif case SYS_RES_IRQ: /* * Can't alloc legacy interrupt once MSI messages have Index: sys/dev/pci/pci_host_generic.c =================================================================== --- sys/dev/pci/pci_host_generic.c +++ sys/dev/pci/pci_host_generic.c @@ -311,11 +311,9 @@ sc = device_get_softc(dev); -#if defined(PCI_RES_BUS) if (type == PCI_RES_BUS) { return (pci_domain_release_bus(sc->ecam, child, rid, res)); } -#endif rm = generic_pcie_rman(sc, type, rman_get_flags(res)); if (rm != NULL) { @@ -409,12 +407,10 @@ sc = device_get_softc(dev); -#if defined(PCI_RES_BUS) if (type == PCI_RES_BUS) { return (pci_domain_alloc_bus(sc->ecam, child, rid, start, end, count, flags)); } -#endif rm = generic_pcie_rman(sc, type, flags); if (rm == NULL) @@ -515,11 +511,9 @@ struct rman *rm; sc = device_get_softc(dev); -#if defined(PCI_RES_BUS) if (type == PCI_RES_BUS) return (pci_domain_adjust_bus(sc->ecam, child, res, start, end)); -#endif rm = generic_pcie_rman(sc, type, rman_get_flags(res)); if (rm != NULL) Index: sys/dev/pci/pci_pci.c =================================================================== --- sys/dev/pci/pci_pci.c +++ sys/dev/pci/pci_pci.c @@ -171,10 +171,8 @@ pcib_is_resource_managed(struct pcib_softc *sc, int type, struct resource *r) { -#ifdef PCI_RES_BUS if (type == PCI_RES_BUS) return (rman_is_region_manager(r, &sc->bus.rman)); -#endif return (pcib_get_resource_window(sc, type, r) != NULL); } @@ -598,7 +596,6 @@ pcib_release_window(sc, &sc->io, SYS_RES_IOPORT); } -#ifdef PCI_RES_BUS /* * Allocate a suitable secondary bus for this bridge if needed and * initialize the resource manager for the secondary bus range. Note @@ -785,7 +782,6 @@ flags)); return (NULL); } -#endif #ifdef PCI_HP /* @@ -1373,10 +1369,6 @@ * Get current bridge configuration. */ sc->domain = pci_get_domain(dev); -#if !defined(PCI_RES_BUS) - sc->bus.sec = pci_read_config(dev, PCIR_SECBUS_1, 1); - sc->bus.sub = pci_read_config(dev, PCIR_SUBBUS_1, 1); -#endif sc->bridgectl = pci_read_config(dev, PCIR_BRIDGECTL_1, 2); /* @@ -1404,20 +1396,6 @@ * Quirk handling. */ switch (pci_get_devid(dev)) { -#if !defined(PCI_RES_BUS) - case 0x12258086: /* Intel 82454KX/GX (Orion) */ - { - uint8_t supbus; - - supbus = pci_read_config(dev, 0x41, 1); - if (supbus != 0xff) { - sc->bus.sec = supbus + 1; - sc->bus.sub = supbus + 1; - } - break; - } -#endif - /* * The i82380FB mobile docking controller is a PCI-PCI bridge, * and it is a subtractive bridge. However, the ProgIf is wrong @@ -1430,34 +1408,6 @@ case 0x060513d7: /* Toshiba ???? */ sc->flags |= PCIB_SUBTRACTIVE; break; - -#if !defined(PCI_RES_BUS) - /* Compaq R3000 BIOS sets wrong subordinate bus number. */ - case 0x00dd10de: - { - char *cp; - - if ((cp = kern_getenv("smbios.planar.maker")) == NULL) - break; - if (strncmp(cp, "Compal", 6) != 0) { - freeenv(cp); - break; - } - freeenv(cp); - if ((cp = kern_getenv("smbios.planar.product")) == NULL) - break; - if (strncmp(cp, "08A0", 4) != 0) { - freeenv(cp); - break; - } - freeenv(cp); - if (sc->bus.sub < 0xa) { - pci_write_config(dev, PCIR_SUBBUS_1, 0xa, 1); - sc->bus.sub = pci_read_config(dev, PCIR_SUBBUS_1, 1); - } - break; - } -#endif } if (pci_msi_device_blacklisted(dev)) @@ -1481,9 +1431,7 @@ #ifdef PCI_HP pcib_probe_hotplug(sc); #endif -#ifdef PCI_RES_BUS pcib_setup_secbus(dev, &sc->bus, 1); -#endif pcib_probe_windows(sc); #ifdef PCI_HP if (sc->flags & PCIB_HOTPLUG) @@ -1590,9 +1538,7 @@ if (error) return (error); pcib_free_windows(sc); -#ifdef PCI_RES_BUS pcib_free_secbus(dev, &sc->bus); -#endif return (0); } @@ -2074,11 +2020,9 @@ } switch (type) { -#ifdef PCI_RES_BUS case PCI_RES_BUS: return (pcib_alloc_subbus(&sc->bus, child, rid, start, end, count, flags)); -#endif case SYS_RES_IOPORT: if (pcib_is_isa_range(sc, start, end, count)) return (NULL); @@ -2158,7 +2102,6 @@ return (bus_generic_adjust_resource(bus, child, type, r, start, end)); -#ifdef PCI_RES_BUS if (type == PCI_RES_BUS) { /* * If our bus range isn't big enough to grow the sub-allocation @@ -2172,9 +2115,7 @@ if (error != 0) return (error); } - } else -#endif - { + } else { /* * Resource is managed and not a secondary bus number, must * be from one of our windows. Index: sys/dev/pci/pci_private.h =================================================================== --- sys/dev/pci/pci_private.h +++ sys/dev/pci/pci_private.h @@ -42,9 +42,7 @@ struct pci_softc { bus_dma_tag_t sc_dma_tag; -#ifdef PCI_RES_BUS struct resource *sc_bus; -#endif }; extern int pci_do_power_resume; Index: sys/dev/pci/pci_subr.c =================================================================== --- sys/dev/pci/pci_subr.c +++ sys/dev/pci/pci_subr.c @@ -285,7 +285,6 @@ return (ERANGE); } -#ifdef PCI_RES_BUS struct pci_domain { int pd_domain; struct rman pd_bus_rman; @@ -380,4 +379,3 @@ #endif return (rman_release_resource(r)); } -#endif /* PCI_RES_BUS */ Index: sys/dev/pci/pcib_private.h =================================================================== --- sys/dev/pci/pcib_private.h +++ sys/dev/pci/pcib_private.h @@ -86,13 +86,11 @@ struct pcib_secbus { u_int sec; u_int sub; -#if defined(PCI_RES_BUS) device_t dev; struct rman rman; struct resource *res; const char *name; int sub_reg; -#endif }; /* @@ -140,7 +138,6 @@ int host_pcib_get_busno(pci_read_config_fn read_config, int bus, int slot, int func, uint8_t *busnum); -#if defined(PCI_RES_BUS) struct resource *pci_domain_alloc_bus(int domain, device_t dev, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); int pci_domain_adjust_bus(int domain, device_t dev, @@ -153,7 +150,6 @@ void pcib_free_secbus(device_t dev, struct pcib_secbus *bus); void pcib_setup_secbus(device_t dev, struct pcib_secbus *bus, int min_count); -#endif int pcib_attach(device_t dev); int pcib_attach_child(device_t dev); void pcib_attach_common(device_t dev); Index: sys/x86/pci/pci_bus.c =================================================================== --- sys/x86/pci/pci_bus.c +++ sys/x86/pci/pci_bus.c @@ -597,17 +597,14 @@ rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { -#if defined(PCI_RES_BUS) if (type == PCI_RES_BUS) return (pci_domain_alloc_bus(0, child, rid, start, end, count, flags)); -#endif start = hostb_alloc_start(type, start, end, count); return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); } -#if defined(PCI_RES_BUS) int legacy_pcib_adjust_resource(device_t dev, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end) @@ -627,7 +624,6 @@ return (pci_domain_release_bus(0, child, rid, r)); return (bus_generic_release_resource(dev, child, type, rid, r)); } -#endif static device_method_t legacy_pcib_methods[] = { /* Device interface */ @@ -642,13 +638,8 @@ DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar), DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar), DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource), -#if defined(PCI_RES_BUS) DEVMETHOD(bus_adjust_resource, legacy_pcib_adjust_resource), DEVMETHOD(bus_release_resource, legacy_pcib_release_resource), -#else - DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), Index: sys/x86/pci/qpi.c =================================================================== --- sys/x86/pci/qpi.c +++ sys/x86/pci/qpi.c @@ -251,7 +251,6 @@ } } -#if defined(PCI_RES_BUS) static struct resource * qpi_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) @@ -263,7 +262,6 @@ return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); } -#endif static int qpi_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, @@ -285,14 +283,9 @@ /* Bus interface */ DEVMETHOD(bus_read_ivar, qpi_pcib_read_ivar), -#if defined(PCI_RES_BUS) DEVMETHOD(bus_alloc_resource, qpi_pcib_alloc_resource), DEVMETHOD(bus_adjust_resource, legacy_pcib_adjust_resource), DEVMETHOD(bus_release_resource, legacy_pcib_release_resource), -#else - DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), Index: sys/x86/x86/mptable_pci.c =================================================================== --- sys/x86/x86/mptable_pci.c +++ sys/x86/x86/mptable_pci.c @@ -103,11 +103,9 @@ { struct mptable_hostb_softc *sc; -#ifdef PCI_RES_BUS if (type == PCI_RES_BUS) return (pci_domain_alloc_bus(0, child, rid, start, end, count, flags)); -#endif sc = device_get_softc(dev); if (type == SYS_RES_IOPORT && start + count - 1 == end) { if (mptable_is_isa_range(start, end)) { @@ -144,10 +142,8 @@ { struct mptable_hostb_softc *sc; -#ifdef PCI_RES_BUS if (type == PCI_RES_BUS) return (pci_domain_adjust_bus(0, child, r, start, end)); -#endif sc = device_get_softc(dev); return (pcib_host_res_adjust(&sc->sc_host_res, child, type, r, start, end)); @@ -166,11 +162,7 @@ DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar), DEVMETHOD(bus_alloc_resource, mptable_hostb_alloc_resource), DEVMETHOD(bus_adjust_resource, mptable_hostb_adjust_resource), -#if defined(PCI_RES_BUS) DEVMETHOD(bus_release_resource, legacy_pcib_release_resource), -#else - DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),