Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/mv/mv_pci.c
Show First 20 Lines • Show All 890 Lines • ▼ Show 20 Lines | mv_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, | ||||
switch (type) { | switch (type) { | ||||
case SYS_RES_IOPORT: | case SYS_RES_IOPORT: | ||||
rm = &sc->sc_io_rman; | rm = &sc->sc_io_rman; | ||||
break; | break; | ||||
case SYS_RES_MEMORY: | case SYS_RES_MEMORY: | ||||
rm = &sc->sc_mem_rman; | rm = &sc->sc_mem_rman; | ||||
break; | break; | ||||
#ifdef PCI_RES_BUS | |||||
case PCI_RES_BUS: | case PCI_RES_BUS: | ||||
return (pci_domain_alloc_bus(sc->ap_segment, child, rid, start, | return (pci_domain_alloc_bus(sc->ap_segment, child, rid, start, | ||||
end, count, flags)); | end, count, flags)); | ||||
#endif | |||||
default: | default: | ||||
return (BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, | return (BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, | ||||
type, rid, start, end, count, flags)); | type, rid, start, end, count, flags)); | ||||
} | } | ||||
if (RMAN_IS_DEFAULT_RANGE(start, end)) { | if (RMAN_IS_DEFAULT_RANGE(start, end)) { | ||||
start = sc->sc_mem_base; | start = sc->sc_mem_base; | ||||
end = sc->sc_mem_base + sc->sc_mem_size - 1; | end = sc->sc_mem_base + sc->sc_mem_size - 1; | ||||
Show All 20 Lines | mv_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, | ||||
return (res); | return (res); | ||||
} | } | ||||
static int | static int | ||||
mv_pcib_release_resource(device_t dev, device_t child, int type, int rid, | mv_pcib_release_resource(device_t dev, device_t child, int type, int rid, | ||||
struct resource *res) | struct resource *res) | ||||
{ | { | ||||
#ifdef PCI_RES_BUS | |||||
struct mv_pcib_softc *sc = device_get_softc(dev); | struct mv_pcib_softc *sc = device_get_softc(dev); | ||||
if (type == PCI_RES_BUS) | if (type == PCI_RES_BUS) | ||||
return (pci_domain_release_bus(sc->ap_segment, child, rid, res)); | return (pci_domain_release_bus(sc->ap_segment, child, rid, res)); | ||||
#endif | |||||
if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY) | if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY) | ||||
return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, | return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, | ||||
type, rid, res)); | type, rid, res)); | ||||
return (rman_release_resource(res)); | return (rman_release_resource(res)); | ||||
} | } | ||||
static int | static int | ||||
▲ Show 20 Lines • Show All 331 Lines • Show Last 20 Lines |