aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2007-02-11 13:15:29 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 14:18:07 -0500
commit23db764d3db5a4bb1e104ad9310e5dc18e4ffa1b (patch)
treed8a944f4e0ac27adda477295886cfbe08f0f73cb
parent5ea8176994003483a18c8fed580901e2125f8a83 (diff)
[PATCH] Switch s390 to NO_IOMEM
Martin Schwidefsky wrote: "s390 does not even need (in|out)b(_p|). I wondered what else from io.h do we not need. The answer is: almost nothing. With the devres patch from Al and the dma-mapping patch from Heiko we can get rid of iomem and all associated definitions." So we'll just need to replace NO_IOPORT with NO_IOMEM in Kconfig and kill arch/s390/mm/ioremap.c. BTW, there's an annoying bit of junk in there - IO_SPACE_LIMIT. We only need it for /proc/ioports, which AFAICS shouldn't even be there on s390 (or uml). OTOH, removing that thing would mean a user-visible change - we go from "empty file in /proc" to "no such file in /proc"... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/s390/Kconfig2
-rw-r--r--arch/s390/mm/Makefile2
-rw-r--r--arch/s390/mm/ioremap.c58
-rw-r--r--include/asm-s390/io.h65
4 files changed, 2 insertions, 125 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 0c83d26ef09a..eaaac3788110 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -41,7 +41,7 @@ config GENERIC_HWEIGHT
41config GENERIC_TIME 41config GENERIC_TIME
42 def_bool y 42 def_bool y
43 43
44config NO_IOPORT 44config NO_IOMEM
45 def_bool y 45 def_bool y
46 46
47mainmenu "Linux Kernel Configuration" 47mainmenu "Linux Kernel Configuration"
diff --git a/arch/s390/mm/Makefile b/arch/s390/mm/Makefile
index 8e09db1edbb9..f95449b29fa5 100644
--- a/arch/s390/mm/Makefile
+++ b/arch/s390/mm/Makefile
@@ -2,6 +2,6 @@
2# Makefile for the linux s390-specific parts of the memory manager. 2# Makefile for the linux s390-specific parts of the memory manager.
3# 3#
4 4
5obj-y := init.o fault.o ioremap.o extmem.o mmap.o vmem.o 5obj-y := init.o fault.o extmem.o mmap.o vmem.o
6obj-$(CONFIG_CMM) += cmm.o 6obj-$(CONFIG_CMM) += cmm.o
7 7
diff --git a/arch/s390/mm/ioremap.c b/arch/s390/mm/ioremap.c
deleted file mode 100644
index 3d2100a4e209..000000000000
--- a/arch/s390/mm/ioremap.c
+++ /dev/null
@@ -1,58 +0,0 @@
1/*
2 * arch/s390/mm/ioremap.c
3 *
4 * S390 version
5 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Hartmut Penner (hp@de.ibm.com)
7 *
8 * Derived from "arch/i386/mm/extable.c"
9 * (C) Copyright 1995 1996 Linus Torvalds
10 *
11 * Re-map IO memory to kernel address space so that we can access it.
12 * This is needed for high PCI addresses that aren't mapped in the
13 * 640k-1MB IO memory area on PC's
14 */
15
16#include <linux/vmalloc.h>
17#include <linux/mm.h>
18#include <linux/io.h>
19#include <asm/pgalloc.h>
20
21/*
22 * Generic mapping function (not visible outside):
23 */
24
25/*
26 * Remap an arbitrary physical address space into the kernel virtual
27 * address space. Needed when the kernel wants to access high addresses
28 * directly.
29 */
30void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags)
31{
32 void * addr;
33 struct vm_struct * area;
34
35 if (phys_addr < virt_to_phys(high_memory))
36 return phys_to_virt(phys_addr);
37 if (phys_addr & ~PAGE_MASK)
38 return NULL;
39 size = PAGE_ALIGN(size);
40 if (!size || size > phys_addr + size)
41 return NULL;
42 area = get_vm_area(size, VM_IOREMAP);
43 if (!area)
44 return NULL;
45 addr = area->addr;
46 if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size,
47 phys_addr, __pgprot(flags))) {
48 vfree(addr);
49 return NULL;
50 }
51 return addr;
52}
53
54void iounmap(void *addr)
55{
56 if (addr > high_memory)
57 vfree(addr);
58}
diff --git a/include/asm-s390/io.h b/include/asm-s390/io.h
index a4c2d550dad4..dca6a6cc103f 100644
--- a/include/asm-s390/io.h
+++ b/include/asm-s390/io.h
@@ -13,7 +13,6 @@
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15 15
16#include <linux/vmalloc.h>
17#include <asm/page.h> 16#include <asm/page.h>
18 17
19#define IO_SPACE_LIMIT 0xffffffff 18#define IO_SPACE_LIMIT 0xffffffff
@@ -41,70 +40,6 @@ static inline void * phys_to_virt(unsigned long address)
41 return __io_virt(address); 40 return __io_virt(address);
42} 41}
43 42
44extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
45
46static inline void * ioremap (unsigned long offset, unsigned long size)
47{
48 return __ioremap(offset, size, 0);
49}
50
51/*
52 * This one maps high address device memory and turns off caching for that area.
53 * it's useful if some control registers are in such an area and write combining
54 * or read caching is not desirable:
55 */
56static inline void * ioremap_nocache (unsigned long offset, unsigned long size)
57{
58 return __ioremap(offset, size, 0);
59}
60
61extern void iounmap(void *addr);
62
63/*
64 * IO bus memory addresses are also 1:1 with the physical address
65 */
66#define virt_to_bus virt_to_phys
67#define bus_to_virt phys_to_virt
68
69/*
70 * readX/writeX() are used to access memory mapped devices. On some
71 * architectures the memory mapped IO stuff needs to be accessed
72 * differently.
73 */
74
75#define readb(addr) (*(volatile unsigned char *) __io_virt(addr))
76#define readw(addr) (*(volatile unsigned short *) __io_virt(addr))
77#define readl(addr) (*(volatile unsigned int *) __io_virt(addr))
78#define readq(addr) (*(volatile unsigned long long *) __io_virt(addr))
79
80#define readb_relaxed(addr) readb(addr)
81#define readw_relaxed(addr) readw(addr)
82#define readl_relaxed(addr) readl(addr)
83#define readq_relaxed(addr) readq(addr)
84#define __raw_readb readb
85#define __raw_readw readw
86#define __raw_readl readl
87#define __raw_readq readq
88
89#define writeb(b,addr) (*(volatile unsigned char *) __io_virt(addr) = (b))
90#define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b))
91#define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b))
92#define writeq(b,addr) (*(volatile unsigned long long *) __io_virt(addr) = (b))
93#define __raw_writeb writeb
94#define __raw_writew writew
95#define __raw_writel writel
96#define __raw_writeq writeq
97
98#define memset_io(a,b,c) memset(__io_virt(a),(b),(c))
99#define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c))
100#define memcpy_toio(a,b,c) memcpy(__io_virt(a),(b),(c))
101
102#define inb_p(addr) readb(addr)
103#define inb(addr) readb(addr)
104
105#define outb(x,addr) ((void) writeb(x,addr))
106#define outb_p(x,addr) outb(x,addr)
107
108#define mmiowb() do { } while (0) 43#define mmiowb() do { } while (0)
109 44
110/* 45/*