X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fsh64%2Flib%2Fio.c;h=587baa3dffb90c848911e8271161895fe99331e0;hb=refs%2Fheads%2Fvserver;hp=7e8af3a9e5d71f71971fa53d07094332a5d0c7b1;hpb=5fc42a6ed0ec81088c37caadb45898ae6cd0ad2c;p=linux-2.6.git diff --git a/arch/sh64/lib/io.c b/arch/sh64/lib/io.c index 7e8af3a9e..587baa3df 100644 --- a/arch/sh64/lib/io.c +++ b/arch/sh64/lib/io.c @@ -8,15 +8,12 @@ * */ -#include +#include #include #include #include #include #include -#ifdef CONFIG_SH_CAYMAN -#include -#endif /* * readX/writeX() are used to access memory mapped devices. On some @@ -25,71 +22,6 @@ * memory location directly. */ -#define dprintk(x...) - -static int io_addr(int x) { - if (x < 0x400) { -#ifdef CONFIG_SH_CAYMAN - return (x << 2) | smsc_superio_virt; -#else - panic ("Illegal access to I/O port 0x%04x\n", x); - return 0; -#endif - } else { -#ifdef CONFIG_PCI - return (x + pciio_virt); -#else - panic ("Illegal access to I/O port 0x%04x\n", x); - return 0; -#endif - } -} - -unsigned long inb(unsigned long port) -{ - unsigned long r; - - r = ctrl_inb(io_addr(port)); - dprintk("inb(0x%x)=0x%x (0x%x)\n", port, r, io_addr(port)); - return r; -} - -unsigned long inw(unsigned long port) -{ - unsigned long r; - - r = ctrl_inw(io_addr(port)); - dprintk("inw(0x%x)=0x%x (0x%x)\n", port, r, io_addr(port)); - return r; -} - -unsigned long inl(unsigned long port) -{ - unsigned long r; - - r = ctrl_inl(io_addr(port)); - dprintk("inl(0x%x)=0x%x (0x%x)\n", port, r, io_addr(port)); - return r; -} - -void outb(unsigned long value, unsigned long port) -{ - dprintk("outb(0x%x,0x%x) (0x%x)\n", value, port, io_addr(port)); - ctrl_outb(value, io_addr(port)); -} - -void outw(unsigned long value, unsigned long port) -{ - dprintk("outw(0x%x,0x%x) (0x%x)\n", value, port, io_addr(port)); - ctrl_outw(value, io_addr(port)); -} - -void outl(unsigned long value, unsigned long port) -{ - dprintk("outw(0x%x,0x%x) (0x%x)\n", value, port, io_addr(port)); - ctrl_outl(value, io_addr(port)); -} - /* This is horrible at the moment - needs more work to do something sensible */ #define IO_DELAY() @@ -185,7 +117,7 @@ void insl(unsigned long port, void *addr, unsigned long count) } } -void memcpy_toio(unsigned long to, const void *from, long count) +void memcpy_toio(void __iomem *to, const void *from, long count) { unsigned char *p = (unsigned char *) from; @@ -195,7 +127,7 @@ void memcpy_toio(unsigned long to, const void *from, long count) } } -void memcpy_fromio(void *to, unsigned long from, long count) +void memcpy_fromio(void *to, void __iomem *from, long count) { int i; unsigned char *p = (unsigned char *) to;