Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bcea1db16ba1c45ccebb3bfb8441642d1342c4d5
Commit:     bcea1db16ba1c45ccebb3bfb8441642d1342c4d5
Parent:     11ee29577cc1637f94d903a6ea322cf1ed8ce1b3
Author:     David S. Miller <[EMAIL PROTECTED]>
AuthorDate: Tue Dec 25 02:20:33 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Dec 26 19:33:46 2007 -0800

    [SPARC64]: Implement pci_resource_to_user()
    
    This makes libpciaccess able to mmap() resources of the
    device properly.
    
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 arch/sparc64/kernel/pci.c |   16 ++++++++++++++++
 include/asm-sparc64/pci.h |    4 ++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index 63b3ebc..a61c38f 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) */
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h
index 1393e57..f59f257 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)
 struct device_node;
 extern struct device_node *pci_device_to_OF_node(struct pci_dev *pdev);
 
+#define HAVE_ARCH_PCI_RESOURCE_TO_USER
+extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
+                                const struct resource *rsrc,
+                                resource_size_t *start, resource_size_t *end);
 #endif /* __KERNEL__ */
 
 #endif /* __SPARC64_PCI_H */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to