diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-10 21:04:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-10 21:04:27 -0500 |
commit | e343a895a9f342f239c5e3c5ffc6c0b1707e6244 (patch) | |
tree | 46c81c6ae375b1f14e209b13c8ac020842807ece /include | |
parent | 06792c4dde2ad143928cc95c1ba218c6269c494b (diff) | |
parent | 193a667fba76b3df482cbf865228e26ee246e889 (diff) |
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
lib: use generic pci_iomap on all architectures
Many architectures don't want to pull in iomap.c,
so they ended up duplicating pci_iomap from that file.
That function isn't trivial, and we are going to modify it
https://lkml.org/lkml/2011/11/14/183
so the duplication hurts.
This reduces the scope of the problem significantly,
by moving pci_iomap to a separate file and
referencing that from all architectures.
* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
alpha: drop pci_iomap/pci_iounmap from pci-noop.c
mn10300: switch to GENERIC_PCI_IOMAP
mn10300: add missing __iomap markers
frv: switch to GENERIC_PCI_IOMAP
tile: switch to GENERIC_PCI_IOMAP
tile: don't panic on iomap
sparc: switch to GENERIC_PCI_IOMAP
sh: switch to GENERIC_PCI_IOMAP
powerpc: switch to GENERIC_PCI_IOMAP
parisc: switch to GENERIC_PCI_IOMAP
mips: switch to GENERIC_PCI_IOMAP
microblaze: switch to GENERIC_PCI_IOMAP
arm: switch to GENERIC_PCI_IOMAP
alpha: switch to GENERIC_PCI_IOMAP
lib: add GENERIC_PCI_IOMAP
lib: move GENERIC_IOMAP to lib/Kconfig
Fix up trivial conflicts due to changes nearby in arch/{m68k,score}/Kconfig
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/io.h | 4 | ||||
-rw-r--r-- | include/asm-generic/iomap.h | 9 | ||||
-rw-r--r-- | include/asm-generic/pci_iomap.h | 25 |
3 files changed, 30 insertions, 8 deletions
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index c2cf2eda0626..448303bdb85f 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h | |||
@@ -19,6 +19,8 @@ | |||
19 | #include <asm-generic/iomap.h> | 19 | #include <asm-generic/iomap.h> |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #include <asm-generic/pci_iomap.h> | ||
23 | |||
22 | #ifndef mmiowb | 24 | #ifndef mmiowb |
23 | #define mmiowb() do {} while (0) | 25 | #define mmiowb() do {} while (0) |
24 | #endif | 26 | #endif |
@@ -283,9 +285,7 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) | |||
283 | #define __io_virt(x) ((void __force *) (x)) | 285 | #define __io_virt(x) ((void __force *) (x)) |
284 | 286 | ||
285 | #ifndef CONFIG_GENERIC_IOMAP | 287 | #ifndef CONFIG_GENERIC_IOMAP |
286 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ | ||
287 | struct pci_dev; | 288 | struct pci_dev; |
288 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | ||
289 | static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) | 289 | static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) |
290 | { | 290 | { |
291 | } | 291 | } |
diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h index 98dcd76ce836..8a3d4fde2604 100644 --- a/include/asm-generic/iomap.h +++ b/include/asm-generic/iomap.h | |||
@@ -67,18 +67,15 @@ extern void ioport_unmap(void __iomem *); | |||
67 | #endif | 67 | #endif |
68 | 68 | ||
69 | #ifdef CONFIG_PCI | 69 | #ifdef CONFIG_PCI |
70 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ | 70 | /* Destroy a virtual mapping cookie for a PCI BAR (memory or IO) */ |
71 | struct pci_dev; | 71 | struct pci_dev; |
72 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | ||
73 | extern void pci_iounmap(struct pci_dev *dev, void __iomem *); | 72 | extern void pci_iounmap(struct pci_dev *dev, void __iomem *); |
74 | #else | 73 | #else |
75 | struct pci_dev; | 74 | struct pci_dev; |
76 | static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) | ||
77 | { | ||
78 | return NULL; | ||
79 | } | ||
80 | static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) | 75 | static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) |
81 | { } | 76 | { } |
82 | #endif | 77 | #endif |
83 | 78 | ||
79 | #include <asm-generic/pci_iomap.h> | ||
80 | |||
84 | #endif | 81 | #endif |
diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h new file mode 100644 index 000000000000..8de4b73e19e2 --- /dev/null +++ b/include/asm-generic/pci_iomap.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* Generic I/O port emulation, based on MN10300 code | ||
2 | * | ||
3 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public Licence | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the Licence, or (at your option) any later version. | ||
10 | */ | ||
11 | #ifndef __ASM_GENERIC_PCI_IOMAP_H | ||
12 | #define __ASM_GENERIC_PCI_IOMAP_H | ||
13 | |||
14 | struct pci_dev; | ||
15 | #ifdef CONFIG_PCI | ||
16 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ | ||
17 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | ||
18 | #else | ||
19 | static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) | ||
20 | { | ||
21 | return NULL; | ||
22 | } | ||
23 | #endif | ||
24 | |||
25 | #endif /* __ASM_GENERIC_IO_H */ | ||