Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/acpica/acpi_pcib_acpi.c
| Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | static struct resource *acpi_pcib_acpi_alloc_resource(device_t dev, | ||||
| rman_res_t start, rman_res_t end, rman_res_t count, | rman_res_t start, rman_res_t end, rman_res_t count, | ||||
| u_int flags); | u_int flags); | ||||
| #ifdef NEW_PCIB | #ifdef NEW_PCIB | ||||
| static int acpi_pcib_acpi_adjust_resource(device_t dev, | static int acpi_pcib_acpi_adjust_resource(device_t dev, | ||||
| device_t child, struct resource *r, | device_t child, struct resource *r, | ||||
| rman_res_t start, rman_res_t end); | rman_res_t start, rman_res_t end); | ||||
| #ifdef PCI_RES_BUS | #ifdef PCI_RES_BUS | ||||
| static int acpi_pcib_acpi_release_resource(device_t dev, | static int acpi_pcib_acpi_release_resource(device_t dev, | ||||
| device_t child, int type, int rid, | device_t child, struct resource *r); | ||||
| struct resource *r); | |||||
| static int acpi_pcib_acpi_activate_resource(device_t dev, | static int acpi_pcib_acpi_activate_resource(device_t dev, | ||||
| device_t child, struct resource *r); | device_t child, struct resource *r); | ||||
| static int acpi_pcib_acpi_deactivate_resource(device_t dev, | static int acpi_pcib_acpi_deactivate_resource(device_t dev, | ||||
| device_t child, struct resource *r); | device_t child, struct resource *r); | ||||
| #endif | #endif | ||||
| #endif | #endif | ||||
| static int acpi_pcib_request_feature(device_t pcib, device_t dev, | static int acpi_pcib_request_feature(device_t pcib, device_t dev, | ||||
| enum pci_feature feature); | enum pci_feature feature); | ||||
| ▲ Show 20 Lines • Show All 397 Lines • ▼ Show 20 Lines | if (busok == 0) { | ||||
| PCI_BUSMAX, 1, 0); | PCI_BUSMAX, 1, 0); | ||||
| if (bus_res == NULL) { | if (bus_res == NULL) { | ||||
| device_printf(dev, | device_printf(dev, | ||||
| "could not allocate bus number\n"); | "could not allocate bus number\n"); | ||||
| pcib_host_res_free(dev, &sc->ap_host_res); | pcib_host_res_free(dev, &sc->ap_host_res); | ||||
| return (ENXIO); | return (ENXIO); | ||||
| } | } | ||||
| sc->ap_bus = rman_get_start(bus_res); | sc->ap_bus = rman_get_start(bus_res); | ||||
| pci_domain_release_bus(sc->ap_segment, dev, rid, bus_res); | pci_domain_release_bus(sc->ap_segment, dev, bus_res); | ||||
| } | } | ||||
| } else { | } else { | ||||
| /* | /* | ||||
| * If there is a decoded bus range, assume the bus number is | * If there is a decoded bus range, assume the bus number is | ||||
| * the first value in the range. Warn if _BBN doesn't match. | * the first value in the range. Warn if _BBN doesn't match. | ||||
| */ | */ | ||||
| if (get_decoded_bus_range(sc, &start, &end)) { | if (get_decoded_bus_range(sc, &start, &end)) { | ||||
| if (sc->ap_bus != start) { | if (sc->ap_bus != start) { | ||||
| ▲ Show 20 Lines • Show All 226 Lines • ▼ Show 20 Lines | if (rman_get_type(r) == PCI_RES_BUS) | ||||
| return (pci_domain_adjust_bus(sc->ap_segment, child, r, start, | return (pci_domain_adjust_bus(sc->ap_segment, child, r, start, | ||||
| end)); | end)); | ||||
| #endif | #endif | ||||
| return (pcib_host_res_adjust(&sc->ap_host_res, child, r, start, end)); | return (pcib_host_res_adjust(&sc->ap_host_res, child, r, start, end)); | ||||
| } | } | ||||
| #ifdef PCI_RES_BUS | #ifdef PCI_RES_BUS | ||||
| int | int | ||||
| acpi_pcib_acpi_release_resource(device_t dev, device_t child, int type, int rid, | acpi_pcib_acpi_release_resource(device_t dev, device_t child, | ||||
| struct resource *r) | struct resource *r) | ||||
| { | { | ||||
| struct acpi_hpcib_softc *sc; | struct acpi_hpcib_softc *sc; | ||||
| sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
| if (type == PCI_RES_BUS) | if (rman_get_type(r) == PCI_RES_BUS) | ||||
| return (pci_domain_release_bus(sc->ap_segment, child, rid, r)); | return (pci_domain_release_bus(sc->ap_segment, child, r)); | ||||
| return (bus_generic_release_resource(dev, child, type, rid, r)); | return (bus_generic_release_resource(dev, child, r)); | ||||
| } | } | ||||
| int | int | ||||
| acpi_pcib_acpi_activate_resource(device_t dev, device_t child, | acpi_pcib_acpi_activate_resource(device_t dev, device_t child, | ||||
| struct resource *r) | struct resource *r) | ||||
| { | { | ||||
| struct acpi_hpcib_softc *sc; | struct acpi_hpcib_softc *sc; | ||||
| ▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines | |||||