Lines Matching refs:res
674 struct resource *res; in pci_process_bridge_OF_ranges() local
696 res = NULL; in pci_process_bridge_OF_ranges()
731 res = &hose->io_resource; in pci_process_bridge_OF_ranges()
759 res = &hose->mem_resources[memno++]; in pci_process_bridge_OF_ranges()
762 if (res != NULL) { in pci_process_bridge_OF_ranges()
763 res->name = dev->full_name; in pci_process_bridge_OF_ranges()
764 res->flags = range.flags; in pci_process_bridge_OF_ranges()
765 res->start = range.cpu_addr; in pci_process_bridge_OF_ranges()
766 res->end = range.cpu_addr + range.size - 1; in pci_process_bridge_OF_ranges()
767 res->parent = res->child = res->sibling = NULL; in pci_process_bridge_OF_ranges()
810 struct resource *res = dev->resource + i; in pcibios_fixup_resources() local
812 if (!res->flags) in pcibios_fixup_resources()
820 pcibios_resource_to_bus(dev->bus, ®, res); in pcibios_fixup_resources()
828 (unsigned long long)res->start, in pcibios_fixup_resources()
829 (unsigned long long)res->end, in pcibios_fixup_resources()
830 (unsigned int)res->flags); in pcibios_fixup_resources()
831 res->end -= res->start; in pcibios_fixup_resources()
832 res->start = 0; in pcibios_fixup_resources()
833 res->flags |= IORESOURCE_UNSET; in pcibios_fixup_resources()
839 (unsigned long long)res->start,\ in pcibios_fixup_resources()
840 (unsigned long long)res->end, in pcibios_fixup_resources()
841 (unsigned int)res->flags); in pcibios_fixup_resources()
856 struct resource *res) in pcibios_uninitialized_bridge_resource() argument
870 if (res->flags & IORESOURCE_MEM) { in pcibios_uninitialized_bridge_resource()
871 pcibios_resource_to_bus(dev->bus, ®ion, res); in pcibios_uninitialized_bridge_resource()
901 if (((res->start - offset) & 0xfffffffful) != 0) in pcibios_uninitialized_bridge_resource()
923 struct resource *res; in pcibios_fixup_bridge() local
928 pci_bus_for_each_resource(bus, res, i) { in pcibios_fixup_bridge()
929 if (!res || !res->flags) in pcibios_fixup_bridge()
939 res->flags |= IORESOURCE_UNSET; in pcibios_fixup_bridge()
940 res->start = 0; in pcibios_fixup_bridge()
941 res->end = -1; in pcibios_fixup_bridge()
947 (unsigned long long)res->start,\ in pcibios_fixup_bridge()
948 (unsigned long long)res->end, in pcibios_fixup_bridge()
949 (unsigned int)res->flags); in pcibios_fixup_bridge()
954 if (pcibios_uninitialized_bridge_resource(bus, res)) { in pcibios_fixup_bridge()
955 res->flags = 0; in pcibios_fixup_bridge()
1088 resource_size_t pcibios_align_resource(void *data, const struct resource *res, in pcibios_align_resource() argument
1092 resource_size_t start = res->start; in pcibios_align_resource()
1094 if (res->flags & IORESOURCE_IO) { in pcibios_align_resource()
1110 struct resource *res) in reparent_resources() argument
1116 if (p->end < res->start) in reparent_resources()
1118 if (res->end < p->start) in reparent_resources()
1120 if (p->start < res->start || p->end > res->end) in reparent_resources()
1127 res->parent = parent; in reparent_resources()
1128 res->child = *firstpp; in reparent_resources()
1129 res->sibling = *pp; in reparent_resources()
1130 *firstpp = res; in reparent_resources()
1132 for (p = res->child; p != NULL; p = p->sibling) { in reparent_resources()
1133 p->parent = res; in reparent_resources()
1137 (unsigned long long)p->end, res->name); in reparent_resources()
1179 struct resource *res, *pr; in pcibios_allocate_bus_resources() local
1184 pci_bus_for_each_resource(bus, res, i) { in pcibios_allocate_bus_resources()
1185 if (!res || !res->flags || res->start > res->end || res->parent) in pcibios_allocate_bus_resources()
1189 if (res->flags & IORESOURCE_UNSET) in pcibios_allocate_bus_resources()
1193 pr = (res->flags & IORESOURCE_IO) ? in pcibios_allocate_bus_resources()
1196 pr = pci_find_parent_resource(bus->self, res); in pcibios_allocate_bus_resources()
1197 if (pr == res) { in pcibios_allocate_bus_resources()
1210 (unsigned long long)res->start, in pcibios_allocate_bus_resources()
1211 (unsigned long long)res->end, in pcibios_allocate_bus_resources()
1212 (unsigned int)res->flags, in pcibios_allocate_bus_resources()
1218 if (request_resource(pr, res) == 0) in pcibios_allocate_bus_resources()
1225 if (reparent_resources(pr, res) == 0) in pcibios_allocate_bus_resources()
1242 res->start = 0; in pcibios_allocate_bus_resources()
1243 res->end = -1; in pcibios_allocate_bus_resources()
1244 res->flags = 0; in pcibios_allocate_bus_resources()
1330 struct resource *res, *pres; in pcibios_reserve_legacy_regions() local
1339 res = kzalloc(sizeof(struct resource), GFP_KERNEL); in pcibios_reserve_legacy_regions()
1340 BUG_ON(res == NULL); in pcibios_reserve_legacy_regions()
1341 res->name = "Legacy IO"; in pcibios_reserve_legacy_regions()
1342 res->flags = IORESOURCE_IO; in pcibios_reserve_legacy_regions()
1343 res->start = offset; in pcibios_reserve_legacy_regions()
1344 res->end = (offset + 0xfff) & 0xfffffffful; in pcibios_reserve_legacy_regions()
1345 pr_debug("Candidate legacy IO: %pR\n", res); in pcibios_reserve_legacy_regions()
1346 if (request_resource(&hose->io_resource, res)) { in pcibios_reserve_legacy_regions()
1349 pci_domain_nr(bus), bus->number, res); in pcibios_reserve_legacy_regions()
1350 kfree(res); in pcibios_reserve_legacy_regions()
1367 res = kzalloc(sizeof(struct resource), GFP_KERNEL); in pcibios_reserve_legacy_regions()
1368 BUG_ON(res == NULL); in pcibios_reserve_legacy_regions()
1369 res->name = "Legacy VGA memory"; in pcibios_reserve_legacy_regions()
1370 res->flags = IORESOURCE_MEM; in pcibios_reserve_legacy_regions()
1371 res->start = 0xa0000 + offset; in pcibios_reserve_legacy_regions()
1372 res->end = 0xbffff + offset; in pcibios_reserve_legacy_regions()
1373 pr_debug("Candidate VGA memory: %pR\n", res); in pcibios_reserve_legacy_regions()
1374 if (request_resource(pres, res)) { in pcibios_reserve_legacy_regions()
1377 pci_domain_nr(bus), bus->number, res); in pcibios_reserve_legacy_regions()
1378 kfree(res); in pcibios_reserve_legacy_regions()
1499 struct resource *res; in pcibios_setup_phb_resources() local
1504 res = &hose->io_resource; in pcibios_setup_phb_resources()
1506 if (!res->flags) { in pcibios_setup_phb_resources()
1514 (unsigned long long)res->start, in pcibios_setup_phb_resources()
1515 (unsigned long long)res->end, in pcibios_setup_phb_resources()
1516 (unsigned long)res->flags, in pcibios_setup_phb_resources()
1518 pci_add_resource_offset(resources, res, offset); in pcibios_setup_phb_resources()
1523 res = &hose->mem_resources[i]; in pcibios_setup_phb_resources()
1524 if (!res->flags) { in pcibios_setup_phb_resources()
1535 (unsigned long long)res->start, in pcibios_setup_phb_resources()
1536 (unsigned long long)res->end, in pcibios_setup_phb_resources()
1537 (unsigned long)res->flags, in pcibios_setup_phb_resources()
1540 pci_add_resource_offset(resources, res, offset); in pcibios_setup_phb_resources()