]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/asm-ppc/io.h
[POWERPC] remove unused io accessors
[karo-tx-linux.git] / include / asm-ppc / io.h
index b919d8fb7d98b8771a6037c346630e0c86be7191..fb0a8fcc51cf0c657f164ca4bd42ab0f1c1cc77c 100644 (file)
@@ -2,7 +2,6 @@
 #ifndef _PPC_IO_H
 #define _PPC_IO_H
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/types.h>
 
@@ -64,7 +63,7 @@ extern inline int in_8(const volatile unsigned char __iomem *addr)
        int ret;
 
        __asm__ __volatile__(
-               "lbz%U1%X1 %0,%1;\n"
+               "sync; lbz%U1%X1 %0,%1;\n"
                "twi 0,%0,0;\n"
                "isync" : "=r" (ret) : "m" (*addr));
        return ret;
@@ -79,7 +78,7 @@ extern inline int in_le16(const volatile unsigned short __iomem *addr)
 {
        int ret;
 
-       __asm__ __volatile__("lhbrx %0,0,%1;\n"
+       __asm__ __volatile__("sync; lhbrx %0,0,%1;\n"
                             "twi 0,%0,0;\n"
                             "isync" : "=r" (ret) :
                              "r" (addr), "m" (*addr));
@@ -90,7 +89,7 @@ extern inline int in_be16(const volatile unsigned short __iomem *addr)
 {
        int ret;
 
-       __asm__ __volatile__("lhz%U1%X1 %0,%1;\n"
+       __asm__ __volatile__("sync; lhz%U1%X1 %0,%1;\n"
                             "twi 0,%0,0;\n"
                             "isync" : "=r" (ret) : "m" (*addr));
        return ret;
@@ -98,20 +97,20 @@ extern inline int in_be16(const volatile unsigned short __iomem *addr)
 
 extern inline void out_le16(volatile unsigned short __iomem *addr, int val)
 {
-       __asm__ __volatile__("sthbrx %1,0,%2; eieio" : "=m" (*addr) :
+       __asm__ __volatile__("sync; sthbrx %1,0,%2" : "=m" (*addr) :
                              "r" (val), "r" (addr));
 }
 
 extern inline void out_be16(volatile unsigned short __iomem *addr, int val)
 {
-       __asm__ __volatile__("sth%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val));
+       __asm__ __volatile__("sync; sth%U0%X0 %1,%0" : "=m" (*addr) : "r" (val));
 }
 
 extern inline unsigned in_le32(const volatile unsigned __iomem *addr)
 {
        unsigned ret;
 
-       __asm__ __volatile__("lwbrx %0,0,%1;\n"
+       __asm__ __volatile__("sync; lwbrx %0,0,%1;\n"
                             "twi 0,%0,0;\n"
                             "isync" : "=r" (ret) :
                             "r" (addr), "m" (*addr));
@@ -122,7 +121,7 @@ extern inline unsigned in_be32(const volatile unsigned __iomem *addr)
 {
        unsigned ret;
 
-       __asm__ __volatile__("lwz%U1%X1 %0,%1;\n"
+       __asm__ __volatile__("sync; lwz%U1%X1 %0,%1;\n"
                             "twi 0,%0,0;\n"
                             "isync" : "=r" (ret) : "m" (*addr));
        return ret;
@@ -130,13 +129,13 @@ extern inline unsigned in_be32(const volatile unsigned __iomem *addr)
 
 extern inline void out_le32(volatile unsigned __iomem *addr, int val)
 {
-       __asm__ __volatile__("stwbrx %1,0,%2; eieio" : "=m" (*addr) :
+       __asm__ __volatile__("sync; stwbrx %1,0,%2" : "=m" (*addr) :
                             "r" (val), "r" (addr));
 }
 
 extern inline void out_be32(volatile unsigned __iomem *addr, int val)
 {
-       __asm__ __volatile__("stw%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val));
+       __asm__ __volatile__("sync; stw%U0%X0 %1,%0" : "=m" (*addr) : "r" (val));
 }
 #if defined (CONFIG_8260_PCI9)
 #define readb(addr) in_8((volatile u8 *)(addr))
@@ -260,6 +259,7 @@ extern __inline__ unsigned int name(unsigned int port)      \
 {                                                      \
        unsigned int x;                                 \
        __asm__ __volatile__(                           \
+               "sync\n"                                \
                "0:"    op "    %0,0,%1\n"              \
                "1:     twi     0,%0,0\n"               \
                "2:     isync\n"                        \
@@ -285,6 +285,7 @@ extern __inline__ unsigned int name(unsigned int port)      \
 extern __inline__ void name(unsigned int val, unsigned int port) \
 {                                                      \
        __asm__ __volatile__(                           \
+               "sync\n"                                \
                "0:" op " %0,0,%1\n"                    \
                "1:     sync\n"                         \
                "2:\n"                                  \
@@ -337,16 +338,6 @@ extern void _outsw_ns(volatile u16 __iomem *port, const void *buf, int ns);
 extern void _insl_ns(volatile u32 __iomem *port, void *buf, int nl);
 extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, int nl);
 
-/*
- * The *_ns versions below don't do byte-swapping.
- * Neither do the standard versions now, these are just here
- * for older code.
- */
-#define insw_ns(port, buf, ns) _insw_ns((port)+___IO_BASE, (buf), (ns))
-#define outsw_ns(port, buf, ns)        _outsw_ns((port)+___IO_BASE, (buf), (ns))
-#define insl_ns(port, buf, nl) _insl_ns((port)+___IO_BASE, (buf), (nl))
-#define outsl_ns(port, buf, nl)        _outsl_ns((port)+___IO_BASE, (buf), (nl))
-
 
 #define IO_SPACE_LIMIT ~0