aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-ppc/pci.h6
-rw-r--r--include/asm-ppc64/pci.h7
-rw-r--r--include/linux/pci.h14
3 files changed, 27 insertions, 0 deletions
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h
index ce5ae6d048f5..002e7b305777 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,
103 unsigned long size, 103 unsigned long size,
104 pgprot_t prot); 104 pgprot_t prot);
105 105
106#define HAVE_ARCH_PCI_RESOURCE_TO_USER
107extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
108 const struct resource *rsrc,
109 u64 *start, u64 *end);
110
111
106#endif /* __KERNEL__ */ 112#endif /* __KERNEL__ */
107 113
108#endif /* __PPC_PCI_H */ 114#endif /* __PPC_PCI_H */
diff --git a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h
index 6cd593f660a0..411bf5dee394 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,
136 unsigned long size, 136 unsigned long size,
137 pgprot_t prot); 137 pgprot_t prot);
138 138
139#ifdef CONFIG_PPC_MULTIPLATFORM
140#define HAVE_ARCH_PCI_RESOURCE_TO_USER
141extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
142 const struct resource *rsrc,
143 u64 *start, u64 *end);
144#endif /* CONFIG_PPC_MULTIPLATFORM */
145
139 146
140#endif /* __KERNEL__ */ 147#endif /* __KERNEL__ */
141 148
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 0e9844929fe3..cfa1455848f4 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1020,6 +1020,20 @@ static inline char *pci_name(struct pci_dev *pdev)
1020#define pci_pretty_name(dev) "" 1020#define pci_pretty_name(dev) ""
1021#endif 1021#endif
1022 1022
1023
1024/* Some archs don't want to expose struct resource to userland as-is
1025 * in sysfs and /proc
1026 */
1027#ifndef HAVE_ARCH_PCI_RESOURCE_TO_USER
1028static inline void pci_resource_to_user(const struct pci_dev *dev, int bar,
1029 const struct resource *rsrc, u64 *start, u64 *end)
1030{
1031 *start = rsrc->start;
1032 *end = rsrc->end;
1033}
1034#endif /* HAVE_ARCH_PCI_RESOURCE_TO_USER */
1035
1036
1023/* 1037/*
1024 * The world is not perfect and supplies us with broken PCI devices. 1038 * The world is not perfect and supplies us with broken PCI devices.
1025 * For at least a part of these bugs we need a work-around, so both 1039 * For at least a part of these bugs we need a work-around, so both