Lines Matching refs:res

676 	struct resource *res;  in pci_process_bridge_OF_ranges()  local
698 res = NULL; in pci_process_bridge_OF_ranges()
733 res = &hose->io_resource; in pci_process_bridge_OF_ranges()
761 res = &hose->mem_resources[memno++]; in pci_process_bridge_OF_ranges()
764 if (res != NULL) { in pci_process_bridge_OF_ranges()
765 res->name = dev->full_name; in pci_process_bridge_OF_ranges()
766 res->flags = range.flags; in pci_process_bridge_OF_ranges()
767 res->start = range.cpu_addr; in pci_process_bridge_OF_ranges()
768 res->end = range.cpu_addr + range.size - 1; in pci_process_bridge_OF_ranges()
769 res->parent = res->child = res->sibling = NULL; in pci_process_bridge_OF_ranges()
812 struct resource *res = dev->resource + i; in pcibios_fixup_resources() local
814 if (!res->flags) in pcibios_fixup_resources()
822 pcibios_resource_to_bus(dev->bus, &reg, res); in pcibios_fixup_resources()
828 pci_name(dev), i, res); in pcibios_fixup_resources()
829 res->end -= res->start; in pcibios_fixup_resources()
830 res->start = 0; in pcibios_fixup_resources()
831 res->flags |= IORESOURCE_UNSET; in pcibios_fixup_resources()
835 pr_debug("PCI:%s Resource %d %pR\n", pci_name(dev), i, res); in pcibios_fixup_resources()
850 struct resource *res) in pcibios_uninitialized_bridge_resource() argument
864 if (res->flags & IORESOURCE_MEM) { in pcibios_uninitialized_bridge_resource()
865 pcibios_resource_to_bus(dev->bus, &region, res); in pcibios_uninitialized_bridge_resource()
895 if (((res->start - offset) & 0xfffffffful) != 0) in pcibios_uninitialized_bridge_resource()
917 struct resource *res; in pcibios_fixup_bridge() local
922 pci_bus_for_each_resource(bus, res, i) { in pcibios_fixup_bridge()
923 if (!res || !res->flags) in pcibios_fixup_bridge()
933 res->flags |= IORESOURCE_UNSET; in pcibios_fixup_bridge()
934 res->start = 0; in pcibios_fixup_bridge()
935 res->end = -1; in pcibios_fixup_bridge()
939 pr_debug("PCI:%s Bus rsrc %d %pR\n", pci_name(dev), i, res); in pcibios_fixup_bridge()
944 if (pcibios_uninitialized_bridge_resource(bus, res)) { in pcibios_fixup_bridge()
945 res->flags = 0; in pcibios_fixup_bridge()
1078 resource_size_t pcibios_align_resource(void *data, const struct resource *res, in pcibios_align_resource() argument
1082 resource_size_t start = res->start; in pcibios_align_resource()
1084 if (res->flags & IORESOURCE_IO) { in pcibios_align_resource()
1100 struct resource *res) in reparent_resources() argument
1106 if (p->end < res->start) in reparent_resources()
1108 if (res->end < p->start) in reparent_resources()
1110 if (p->start < res->start || p->end > res->end) in reparent_resources()
1117 res->parent = parent; in reparent_resources()
1118 res->child = *firstpp; in reparent_resources()
1119 res->sibling = *pp; in reparent_resources()
1120 *firstpp = res; in reparent_resources()
1122 for (p = res->child; p != NULL; p = p->sibling) { in reparent_resources()
1123 p->parent = res; in reparent_resources()
1125 p->name, p, res->name); in reparent_resources()
1167 struct resource *res, *pr; in pcibios_allocate_bus_resources() local
1172 pci_bus_for_each_resource(bus, res, i) { in pcibios_allocate_bus_resources()
1173 if (!res || !res->flags || res->start > res->end || res->parent) in pcibios_allocate_bus_resources()
1177 if (res->flags & IORESOURCE_UNSET) in pcibios_allocate_bus_resources()
1181 pr = (res->flags & IORESOURCE_IO) ? in pcibios_allocate_bus_resources()
1184 pr = pci_find_parent_resource(bus->self, res); in pcibios_allocate_bus_resources()
1185 if (pr == res) { in pcibios_allocate_bus_resources()
1196 i, res, pr, (pr && pr->name) ? pr->name : "nil"); in pcibios_allocate_bus_resources()
1201 if (request_resource(pr, res) == 0) in pcibios_allocate_bus_resources()
1208 if (reparent_resources(pr, res) == 0) in pcibios_allocate_bus_resources()
1225 res->start = 0; in pcibios_allocate_bus_resources()
1226 res->end = -1; in pcibios_allocate_bus_resources()
1227 res->flags = 0; in pcibios_allocate_bus_resources()
1306 struct resource *res, *pres; in pcibios_reserve_legacy_regions() local
1315 res = kzalloc(sizeof(struct resource), GFP_KERNEL); in pcibios_reserve_legacy_regions()
1316 BUG_ON(res == NULL); in pcibios_reserve_legacy_regions()
1317 res->name = "Legacy IO"; in pcibios_reserve_legacy_regions()
1318 res->flags = IORESOURCE_IO; in pcibios_reserve_legacy_regions()
1319 res->start = offset; in pcibios_reserve_legacy_regions()
1320 res->end = (offset + 0xfff) & 0xfffffffful; in pcibios_reserve_legacy_regions()
1321 pr_debug("Candidate legacy IO: %pR\n", res); in pcibios_reserve_legacy_regions()
1322 if (request_resource(&hose->io_resource, res)) { in pcibios_reserve_legacy_regions()
1325 pci_domain_nr(bus), bus->number, res); in pcibios_reserve_legacy_regions()
1326 kfree(res); in pcibios_reserve_legacy_regions()
1343 res = kzalloc(sizeof(struct resource), GFP_KERNEL); in pcibios_reserve_legacy_regions()
1344 BUG_ON(res == NULL); in pcibios_reserve_legacy_regions()
1345 res->name = "Legacy VGA memory"; in pcibios_reserve_legacy_regions()
1346 res->flags = IORESOURCE_MEM; in pcibios_reserve_legacy_regions()
1347 res->start = 0xa0000 + offset; in pcibios_reserve_legacy_regions()
1348 res->end = 0xbffff + offset; in pcibios_reserve_legacy_regions()
1349 pr_debug("Candidate VGA memory: %pR\n", res); in pcibios_reserve_legacy_regions()
1350 if (request_resource(pres, res)) { in pcibios_reserve_legacy_regions()
1353 pci_domain_nr(bus), bus->number, res); in pcibios_reserve_legacy_regions()
1354 kfree(res); in pcibios_reserve_legacy_regions()
1480 struct resource *res; in pcibios_setup_phb_resources() local
1485 res = &hose->io_resource; in pcibios_setup_phb_resources()
1487 if (!res->flags) { in pcibios_setup_phb_resources()
1495 res, (unsigned long long)offset); in pcibios_setup_phb_resources()
1496 pci_add_resource_offset(resources, res, offset); in pcibios_setup_phb_resources()
1501 res = &hose->mem_resources[i]; in pcibios_setup_phb_resources()
1502 if (!res->flags) { in pcibios_setup_phb_resources()
1513 res, (unsigned long long)offset); in pcibios_setup_phb_resources()
1515 pci_add_resource_offset(resources, res, offset); in pcibios_setup_phb_resources()