]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sparc64/kernel/pci.c
Merge branches 'release' and 'autoload' into release
[linux-2.6-omap-h63xx.git] / arch / sparc64 / kernel / pci.c
index 9b808640a193d5c941cbb2dd16e4ec5bbffb465a..a61c38fe75ead3db51c7b0ae0eb4a01ef7b912ee 100644 (file)
@@ -207,8 +207,7 @@ static struct {
        { "SUNW,sun4v-pci", sun4v_pci_init },
        { "pciex108e,80f0", fire_pci_init },
 };
-#define PCI_NUM_CONTROLLER_TYPES (sizeof(pci_controller_table) / \
-                                 sizeof(pci_controller_table[0]))
+#define PCI_NUM_CONTROLLER_TYPES       ARRAY_SIZE(pci_controller_table)
 
 static int __init pci_controller_init(const char *model_name, int namelen, struct device_node *dp)
 {
@@ -1276,4 +1275,20 @@ int pci_dma_supported(struct pci_dev *pdev, u64 device_mask)
        return (device_mask & dma_addr_mask) == dma_addr_mask;
 }
 
+void pci_resource_to_user(const struct pci_dev *pdev, int bar,
+                         const struct resource *rp, resource_size_t *start,
+                         resource_size_t *end)
+{
+       struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller;
+       unsigned long offset;
+
+       if (rp->flags & IORESOURCE_IO)
+               offset = pbm->io_space.start;
+       else
+               offset = pbm->mem_space.start;
+
+       *start = rp->start - offset;
+       *end = rp->end - offset;
+}
+
 #endif /* !(CONFIG_PCI) */