diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-06-22 10:05:36 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-06-28 12:59:48 -0400 |
commit | 5924486dc0f205ebc2bbf4c262eec902ff38e802 (patch) | |
tree | acde32ec730762ed2d0a742990cfe2dc7f6e5cf0 /arch/arm/mm/iomap.c | |
parent | f9c21a6ee7e040be0f623a6b8dcfb5ec4f7532f5 (diff) |
[ARM] nommu: add stubs for ioremap and friends
nommu doesn't have any form of remapping support, so ioremap, etc
become stubs which just return the casted address, doing nothing
else.
Move ioport_map(), ioport_unmap(), pci_iomap(), pci_iounmap()
into a separate file which is always built.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/iomap.c')
-rw-r--r-- | arch/arm/mm/iomap.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c new file mode 100644 index 000000000000..62066f3020c8 --- /dev/null +++ b/arch/arm/mm/iomap.c | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mm/iomap.c | ||
3 | * | ||
4 | * Map IO port and PCI memory spaces so that {read,write}[bwl] can | ||
5 | * be used to access this memory. | ||
6 | */ | ||
7 | #include <linux/module.h> | ||
8 | #include <linux/pci.h> | ||
9 | #include <linux/ioport.h> | ||
10 | |||
11 | #include <asm/io.h> | ||
12 | |||
13 | #ifdef __io | ||
14 | void __iomem *ioport_map(unsigned long port, unsigned int nr) | ||
15 | { | ||
16 | return __io(port); | ||
17 | } | ||
18 | EXPORT_SYMBOL(ioport_map); | ||
19 | |||
20 | void ioport_unmap(void __iomem *addr) | ||
21 | { | ||
22 | } | ||
23 | EXPORT_SYMBOL(ioport_unmap); | ||
24 | #endif | ||
25 | |||
26 | #ifdef CONFIG_PCI | ||
27 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | ||
28 | { | ||
29 | unsigned long start = pci_resource_start(dev, bar); | ||
30 | unsigned long len = pci_resource_len(dev, bar); | ||
31 | unsigned long flags = pci_resource_flags(dev, bar); | ||
32 | |||
33 | if (!len || !start) | ||
34 | return NULL; | ||
35 | if (maxlen && len > maxlen) | ||
36 | len = maxlen; | ||
37 | if (flags & IORESOURCE_IO) | ||
38 | return ioport_map(start, len); | ||
39 | if (flags & IORESOURCE_MEM) { | ||
40 | if (flags & IORESOURCE_CACHEABLE) | ||
41 | return ioremap(start, len); | ||
42 | return ioremap_nocache(start, len); | ||
43 | } | ||
44 | return NULL; | ||
45 | } | ||
46 | EXPORT_SYMBOL(pci_iomap); | ||
47 | |||
48 | void pci_iounmap(struct pci_dev *dev, void __iomem *addr) | ||
49 | { | ||
50 | if ((unsigned long)addr >= VMALLOC_START && | ||
51 | (unsigned long)addr < VMALLOC_END) | ||
52 | iounmap(addr); | ||
53 | } | ||
54 | EXPORT_SYMBOL(pci_iounmap); | ||
55 | #endif | ||