Skip to content

Commit

Permalink
[PATCH] Switch s390 to NO_IOMEM
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Al Viro authored and Linus Torvalds committed Feb 11, 2007
1 parent 5ea8176 commit 23db764
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 125 deletions.
2 changes: 1 addition & 1 deletion arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ config GENERIC_HWEIGHT
config GENERIC_TIME
def_bool y

config NO_IOPORT
config NO_IOMEM
def_bool y

mainmenu "Linux Kernel Configuration"
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/mm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Makefile for the linux s390-specific parts of the memory manager.
#

obj-y := init.o fault.o ioremap.o extmem.o mmap.o vmem.o
obj-y := init.o fault.o extmem.o mmap.o vmem.o
obj-$(CONFIG_CMM) += cmm.o

58 changes: 0 additions & 58 deletions arch/s390/mm/ioremap.c

This file was deleted.

65 changes: 0 additions & 65 deletions include/asm-s390/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#ifdef __KERNEL__

#include <linux/vmalloc.h>
#include <asm/page.h>

#define IO_SPACE_LIMIT 0xffffffff
Expand Down Expand Up @@ -41,70 +40,6 @@ static inline void * phys_to_virt(unsigned long address)
return __io_virt(address);
}

extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);

static inline void * ioremap (unsigned long offset, unsigned long size)
{
return __ioremap(offset, size, 0);
}

/*
* This one maps high address device memory and turns off caching for that area.
* it's useful if some control registers are in such an area and write combining
* or read caching is not desirable:
*/
static inline void * ioremap_nocache (unsigned long offset, unsigned long size)
{
return __ioremap(offset, size, 0);
}

extern void iounmap(void *addr);

/*
* IO bus memory addresses are also 1:1 with the physical address
*/
#define virt_to_bus virt_to_phys
#define bus_to_virt phys_to_virt

/*
* readX/writeX() are used to access memory mapped devices. On some
* architectures the memory mapped IO stuff needs to be accessed
* differently.
*/

#define readb(addr) (*(volatile unsigned char *) __io_virt(addr))
#define readw(addr) (*(volatile unsigned short *) __io_virt(addr))
#define readl(addr) (*(volatile unsigned int *) __io_virt(addr))
#define readq(addr) (*(volatile unsigned long long *) __io_virt(addr))

#define readb_relaxed(addr) readb(addr)
#define readw_relaxed(addr) readw(addr)
#define readl_relaxed(addr) readl(addr)
#define readq_relaxed(addr) readq(addr)
#define __raw_readb readb
#define __raw_readw readw
#define __raw_readl readl
#define __raw_readq readq

#define writeb(b,addr) (*(volatile unsigned char *) __io_virt(addr) = (b))
#define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b))
#define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b))
#define writeq(b,addr) (*(volatile unsigned long long *) __io_virt(addr) = (b))
#define __raw_writeb writeb
#define __raw_writew writew
#define __raw_writel writel
#define __raw_writeq writeq

#define memset_io(a,b,c) memset(__io_virt(a),(b),(c))
#define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c))
#define memcpy_toio(a,b,c) memcpy(__io_virt(a),(b),(c))

#define inb_p(addr) readb(addr)
#define inb(addr) readb(addr)

#define outb(x,addr) ((void) writeb(x,addr))
#define outb_p(x,addr) outb(x,addr)

#define mmiowb() do { } while (0)

/*
Expand Down

0 comments on commit 23db764

Please sign in to comment.