pci_bus_alloc_resource — allocate a resource from a parent bus


int pci_bus_alloc_resource (struct pci_bus * bus,
 struct resource * res,
 resource_size_t size,
 resource_size_t align,
 resource_size_t min,
 unsigned long type_mask,
 resource_size_t (*alignf) (void *, const struct resource *, resource_size_t, resource_size_t),
 void * alignf_data);


struct pci_bus * bus

PCI bus

struct resource * res

resource to allocate

resource_size_t size

size of resource to allocate

resource_size_t align

alignment of resource to allocate

resource_size_t min

minimum /proc/iomem address to allocate

unsigned long type_mask

IORESOURCE_* type flags

resource_size_t (*)(void *, const struct resource *, resource_size_t, resource_size_t) alignf

resource alignment function

void * alignf_data

data argument for resource alignment function


Given the PCI bus a device resides on, the size, minimum address, alignment and type, try to find an acceptable resource allocation for a specific device resource.