diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-ppc/pci.h | 6 | ||||
-rw-r--r-- | include/asm-ppc64/pci.h | 7 | ||||
-rw-r--r-- | include/linux/pci.h | 14 |
3 files changed, 27 insertions, 0 deletions
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index ce5ae6d048f..002e7b30577 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h @@ -103,6 +103,12 @@ extern pgprot_t pci_phys_mem_access_prot(struct file *file, unsigned long size, pgprot_t prot); +#define HAVE_ARCH_PCI_RESOURCE_TO_USER +extern void pci_resource_to_user(const struct pci_dev *dev, int bar, + const struct resource *rsrc, + u64 *start, u64 *end); + + #endif /* __KERNEL__ */ #endif /* __PPC_PCI_H */ diff --git a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h index 6cd593f660a..411bf5dee39 100644 --- a/include/asm-ppc64/pci.h +++ b/include/asm-ppc64/pci.h @@ -136,6 +136,13 @@ extern pgprot_t pci_phys_mem_access_prot(struct file *file, unsigned long size, pgprot_t prot); +#ifdef CONFIG_PPC_MULTIPLATFORM +#define HAVE_ARCH_PCI_RESOURCE_TO_USER +extern void pci_resource_to_user(const struct pci_dev *dev, int bar, + const struct resource *rsrc, + u64 *start, u64 *end); +#endif /* CONFIG_PPC_MULTIPLATFORM */ + #endif /* __KERNEL__ */ diff --git a/include/linux/pci.h b/include/linux/pci.h index 0e9844929fe..cfa1455848f 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1020,6 +1020,20 @@ static inline char *pci_name(struct pci_dev *pdev) #define pci_pretty_name(dev) "" #endif + +/* Some archs don't want to expose struct resource to userland as-is + * in sysfs and /proc + */ +#ifndef HAVE_ARCH_PCI_RESOURCE_TO_USER +static inline void pci_resource_to_user(const struct pci_dev *dev, int bar, + const struct resource *rsrc, u64 *start, u64 *end) +{ + *start = rsrc->start; + *end = rsrc->end; +} +#endif /* HAVE_ARCH_PCI_RESOURCE_TO_USER */ + + /* * The world is not perfect and supplies us with broken PCI devices. * For at least a part of these bugs we need a work-around, so both |