Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/x86/mptable_pci.c
Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static struct resource * | static struct resource * | ||||
mptable_hostb_alloc_resource(device_t dev, device_t child, int type, int *rid, | mptable_hostb_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) | rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) | ||||
{ | { | ||||
struct mptable_hostb_softc *sc; | struct mptable_hostb_softc *sc; | ||||
#ifdef PCI_RES_BUS | |||||
if (type == PCI_RES_BUS) | if (type == PCI_RES_BUS) | ||||
return (pci_domain_alloc_bus(0, child, rid, start, end, count, | return (pci_domain_alloc_bus(0, child, rid, start, end, count, | ||||
flags)); | flags)); | ||||
#endif | |||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
if (type == SYS_RES_IOPORT && start + count - 1 == end) { | if (type == SYS_RES_IOPORT && start + count - 1 == end) { | ||||
if (mptable_is_isa_range(start, end)) { | if (mptable_is_isa_range(start, end)) { | ||||
switch (sc->sc_decodes_isa_io) { | switch (sc->sc_decodes_isa_io) { | ||||
case -1: | case -1: | ||||
return (NULL); | return (NULL); | ||||
case 1: | case 1: | ||||
return (bus_generic_alloc_resource(dev, child, | return (bus_generic_alloc_resource(dev, child, | ||||
Show All 20 Lines | |||||
} | } | ||||
static int | static int | ||||
mptable_hostb_adjust_resource(device_t dev, device_t child, int type, | mptable_hostb_adjust_resource(device_t dev, device_t child, int type, | ||||
struct resource *r, rman_res_t start, rman_res_t end) | struct resource *r, rman_res_t start, rman_res_t end) | ||||
{ | { | ||||
struct mptable_hostb_softc *sc; | struct mptable_hostb_softc *sc; | ||||
#ifdef PCI_RES_BUS | |||||
if (type == PCI_RES_BUS) | if (type == PCI_RES_BUS) | ||||
return (pci_domain_adjust_bus(0, child, r, start, end)); | return (pci_domain_adjust_bus(0, child, r, start, end)); | ||||
#endif | |||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
return (pcib_host_res_adjust(&sc->sc_host_res, child, type, r, start, | return (pcib_host_res_adjust(&sc->sc_host_res, child, type, r, start, | ||||
end)); | end)); | ||||
} | } | ||||
static device_method_t mptable_hostb_methods[] = { | static device_method_t mptable_hostb_methods[] = { | ||||
/* Device interface */ | /* Device interface */ | ||||
DEVMETHOD(device_probe, mptable_hostb_probe), | DEVMETHOD(device_probe, mptable_hostb_probe), | ||||
DEVMETHOD(device_attach, mptable_hostb_attach), | DEVMETHOD(device_attach, mptable_hostb_attach), | ||||
DEVMETHOD(device_shutdown, bus_generic_shutdown), | DEVMETHOD(device_shutdown, bus_generic_shutdown), | ||||
DEVMETHOD(device_suspend, bus_generic_suspend), | DEVMETHOD(device_suspend, bus_generic_suspend), | ||||
DEVMETHOD(device_resume, bus_generic_resume), | DEVMETHOD(device_resume, bus_generic_resume), | ||||
/* Bus interface */ | /* Bus interface */ | ||||
DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar), | DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar), | ||||
DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar), | DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar), | ||||
DEVMETHOD(bus_alloc_resource, mptable_hostb_alloc_resource), | DEVMETHOD(bus_alloc_resource, mptable_hostb_alloc_resource), | ||||
DEVMETHOD(bus_adjust_resource, mptable_hostb_adjust_resource), | DEVMETHOD(bus_adjust_resource, mptable_hostb_adjust_resource), | ||||
#if defined(PCI_RES_BUS) | |||||
DEVMETHOD(bus_release_resource, legacy_pcib_release_resource), | 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_activate_resource, bus_generic_activate_resource), | ||||
DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), | DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), | ||||
DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), | DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), | ||||
DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), | DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), | ||||
/* pcib interface */ | /* pcib interface */ | ||||
DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots), | DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots), | ||||
DEVMETHOD(pcib_read_config, legacy_pcib_read_config), | DEVMETHOD(pcib_read_config, legacy_pcib_read_config), | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |