diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-12-26 22:04:34 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-12-26 22:04:34 -0800 |
commit | b50fd73b9d8ee1f999e8d625074872eb8fb88439 (patch) | |
tree | b049c506ed1c1ce89f62aff7187d75cfdcd81903 /arch | |
parent | 49eaaa1a6c950e7a92c4386c199b8ec950f840b9 (diff) | |
parent | bcea1db16ba1c45ccebb3bfb8441642d1342c4d5 (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()
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc64/kernel/pci.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index 63b3ebc0c3c..a61c38fe75e 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) 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) */ |