asm-generic: io: don't perform swab during {in,out} string functions
authorWill Deacon <will.deacon@arm.com>
Mon, 17 Dec 2012 23:59:42 +0000 (15:59 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 18 Dec 2012 01:15:13 +0000 (17:15 -0800)
The {in,out}s{b,w,l} functions are designed to operate on a stream of
bytes and therefore should not perform any byte-swapping, regardless of
the CPU byte order.

This patch fixes the generic IO header so that {in,out}s{b,w,l} call the
__raw_{read,write} functions directly rather than going via the
endian-correcting accessors.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ben Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/asm-generic/io.h

index 9e0ebe0512435f5ca8045f9f42f47460b8b95ac0..d1e93284d72a6ebdc4e246732a11e398e6ba5d7f 100644 (file)
@@ -154,7 +154,7 @@ static inline void insb(unsigned long addr, void *buffer, int count)
        if (count) {
                u8 *buf = buffer;
                do {
-                       u8 x = inb(addr);
+                       u8 x = __raw_readb(addr + PCI_IOBASE);
                        *buf++ = x;
                } while (--count);
        }
@@ -167,7 +167,7 @@ static inline void insw(unsigned long addr, void *buffer, int count)
        if (count) {
                u16 *buf = buffer;
                do {
-                       u16 x = inw(addr);
+                       u16 x = __raw_readw(addr + PCI_IOBASE);
                        *buf++ = x;
                } while (--count);
        }
@@ -180,7 +180,7 @@ static inline void insl(unsigned long addr, void *buffer, int count)
        if (count) {
                u32 *buf = buffer;
                do {
-                       u32 x = inl(addr);
+                       u32 x = __raw_readl(addr + PCI_IOBASE);
                        *buf++ = x;
                } while (--count);
        }
@@ -193,7 +193,7 @@ static inline void outsb(unsigned long addr, const void *buffer, int count)
        if (count) {
                const u8 *buf = buffer;
                do {
-                       outb(*buf++, addr);
+                       __raw_writeb(*buf++, addr + PCI_IOBASE);
                } while (--count);
        }
 }
@@ -205,7 +205,7 @@ static inline void outsw(unsigned long addr, const void *buffer, int count)
        if (count) {
                const u16 *buf = buffer;
                do {
-                       outw(*buf++, addr);
+                       __raw_writew(*buf++, addr + PCI_IOBASE);
                } while (--count);
        }
 }
@@ -217,7 +217,7 @@ static inline void outsl(unsigned long addr, const void *buffer, int count)
        if (count) {
                const u32 *buf = buffer;
                do {
-                       outl(*buf++, addr);
+                       __raw_writel(*buf++, addr + PCI_IOBASE);
                } while (--count);
        }
 }