aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-12-27 01:04:34 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-12-27 01:04:34 -0500
commitb50fd73b9d8ee1f999e8d625074872eb8fb88439 (patch)
treeb049c506ed1c1ce89f62aff7187d75cfdcd81903
parent49eaaa1a6c950e7a92c4386c199b8ec950f840b9 (diff)
parentbcea1db16ba1c45ccebb3bfb8441642d1342c4d5 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6: [SPARC64]: Implement pci_resource_to_user()
-rw-r--r--arch/sparc64/kernel/pci.c16
-rw-r--r--include/asm-sparc64/pci.h4
2 files changed, 20 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index 63b3ebc0c3c2..a61c38fe75ea 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -1275,4 +1275,20 @@ int pci_dma_supported(struct pci_dev *pdev, u64 device_mask)
1275 return (device_mask & dma_addr_mask) == dma_addr_mask; 1275 return (device_mask & dma_addr_mask) == dma_addr_mask;
1276} 1276}
1277 1277
1278void pci_resource_to_user(const struct pci_dev *pdev, int bar,
1279 const struct resource *rp, resource_size_t *start,
1280 resource_size_t *end)
1281{
1282 struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller;
1283 unsigned long offset;
1284
1285 if (rp->flags & IORESOURCE_IO)
1286 offset = pbm->io_space.start;
1287 else
1288 offset = pbm->mem_space.start;
1289
1290 *start = rp->start - offset;
1291 *end = rp->end - offset;
1292}
1293
1278#endif /* !(CONFIG_PCI) */ 1294#endif /* !(CONFIG_PCI) */
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h
index 1393e57d50fb..f59f2571295b 100644
--- a/include/asm-sparc64/pci.h
+++ b/include/asm-sparc64/pci.h
@@ -200,6 +200,10 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
200struct device_node; 200struct device_node;
201extern struct device_node *pci_device_to_OF_node(struct pci_dev *pdev); 201extern struct device_node *pci_device_to_OF_node(struct pci_dev *pdev);
202 202
203#define HAVE_ARCH_PCI_RESOURCE_TO_USER
204extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
205 const struct resource *rsrc,
206 resource_size_t *start, resource_size_t *end);
203#endif /* __KERNEL__ */ 207#endif /* __KERNEL__ */
204 208
205#endif /* __SPARC64_PCI_H */ 209#endif /* __SPARC64_PCI_H */