]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/ppc/kernel/pci.c
[PATCH] pci and yenta: pcibios_bus_to_resource
[linux-2.6-omap-h63xx.git] / arch / ppc / kernel / pci.c
index 70cfb6ffd877d8a9007abc859d0f4e87d40dd3f5..7b3586a3bf302f22289ab5cf6cbe2e874edeed09 100644 (file)
@@ -160,6 +160,21 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
 }
 EXPORT_SYMBOL(pcibios_resource_to_bus);
 
+void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
+                            struct pci_bus_region *region)
+{
+       unsigned long offset = 0;
+       struct pci_controller *hose = dev->sysdata;
+
+       if (hose && res->flags & IORESOURCE_IO)
+               offset = (unsigned long)hose->io_base_virt - isa_io_base;
+       else if (hose && res->flags & IORESOURCE_MEM)
+               offset = hose->pci_mem_offset;
+       res->start = region->start + offset;
+       res->end = region->end + offset;
+}
+EXPORT_SYMBOL(pcibios_bus_to_resource);
+
 /*
  * We need to avoid collisions with `mirrored' VGA ports
  * and other strange ISA hardware, so we always want the