Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/pci/pci_pci.c
Show First 20 Lines • Show All 2,366 Lines • ▼ Show 20 Lines | #endif | ||||
*/ | */ | ||||
if (sc->flags & PCIB_SUBTRACTIVE && r == NULL) | if (sc->flags & PCIB_SUBTRACTIVE && r == NULL) | ||||
return (bus_generic_alloc_resource(dev, child, type, rid, | return (bus_generic_alloc_resource(dev, child, type, rid, | ||||
start, end, count, flags)); | start, end, count, flags)); | ||||
return (r); | return (r); | ||||
} | } | ||||
static int | static int | ||||
pcib_adjust_resource(device_t bus, device_t child, int type, struct resource *r, | pcib_adjust_resource(device_t bus, device_t child, struct resource *r, | ||||
rman_res_t start, rman_res_t end) | rman_res_t start, rman_res_t end) | ||||
{ | { | ||||
struct pcib_softc *sc; | struct pcib_softc *sc; | ||||
struct pcib_window *w; | struct pcib_window *w; | ||||
rman_res_t wmask; | rman_res_t wmask; | ||||
int error; | int error, type; | ||||
sc = device_get_softc(bus); | sc = device_get_softc(bus); | ||||
type = rman_get_type(r); | |||||
/* | /* | ||||
* If the resource wasn't sub-allocated from one of our region | * If the resource wasn't sub-allocated from one of our region | ||||
* managers then just pass the request up. | * managers then just pass the request up. | ||||
*/ | */ | ||||
if (!pcib_is_resource_managed(sc, r)) | if (!pcib_is_resource_managed(sc, r)) | ||||
return (bus_generic_adjust_resource(bus, child, type, r, | return (bus_generic_adjust_resource(bus, child, r, start, end)); | ||||
start, end)); | |||||
#ifdef PCI_RES_BUS | #ifdef PCI_RES_BUS | ||||
if (type == PCI_RES_BUS) { | if (type == PCI_RES_BUS) { | ||||
/* | /* | ||||
* If our bus range isn't big enough to grow the sub-allocation | * If our bus range isn't big enough to grow the sub-allocation | ||||
* then we need to grow our bus range. Any request that would | * then we need to grow our bus range. Any request that would | ||||
* require us to decrease the start of our own bus range is | * require us to decrease the start of our own bus range is | ||||
* invalid, we can only extend the end; ignore such requests | * invalid, we can only extend the end; ignore such requests | ||||
▲ Show 20 Lines • Show All 763 Lines • Show Last 20 Lines |