OSDN Git Service

m68k: io: implement dummy relaxed accessor macros for writes
authorWill Deacon <will.deacon@arm.com>
Tue, 3 Sep 2013 18:15:42 +0000 (19:15 +0100)
committerWill Deacon <will.deacon@arm.com>
Mon, 20 Oct 2014 17:49:18 +0000 (18:49 +0100)
write{b,w,l}_relaxed are implemented by some architectures in order to
permit memory-mapped I/O accesses with weaker barrier semantics than the
non-relaxed variants.

This patch adds dummy macros for the write accessors to m68k, in the
same vein as the dummy definitions for the relaxed read accessors.
Additionally, the existing relaxed read accessors are moved into
asm/io.h, so that they can be used by m68k targets with an MMU.

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/m68k/include/asm/io.h
arch/m68k/include/asm/io_no.h

index c70cc91..bccd5a9 100644 (file)
@@ -3,3 +3,11 @@
 #else
 #include <asm/io_mm.h>
 #endif
+
+#define readb_relaxed(addr)    readb(addr)
+#define readw_relaxed(addr)    readw(addr)
+#define readl_relaxed(addr)    readl(addr)
+
+#define writeb_relaxed(b, addr)        writeb(b, addr)
+#define writew_relaxed(b, addr)        writew(b, addr)
+#define writel_relaxed(b, addr)        writel(b, addr)
index be4b5a8..a93c8cd 100644 (file)
@@ -40,10 +40,6 @@ static inline unsigned int _swapl(volatile unsigned long v)
 #define readl(addr) \
     ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; })
 
-#define readb_relaxed(addr) readb(addr)
-#define readw_relaxed(addr) readw(addr)
-#define readl_relaxed(addr) readl(addr)
-
 #define writeb(b,addr) (void)((*(volatile unsigned char *) (addr)) = (b))
 #define writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b))
 #define writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b))