]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
sparc: io: implement dummy relaxed accessor macros for writes
authorWill Deacon <will.deacon@arm.com>
Wed, 4 Sep 2013 10:34:08 +0000 (11:34 +0100)
committerWill Deacon <will.deacon@arm.com>
Mon, 20 Oct 2014 17:49:18 +0000 (18:49 +0100)
write{b,w,l,q}_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 sparc, in the
same vein as the dummy definitions for the relaxed read accessors. The
existing relaxed read{b,w,l} accessors are moved into asm/io.h, since
they are identical between 32-bit and 64-bit machines.

Acked-by: "David S. Miller" <davem@davemloft.net>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/sparc/include/asm/io.h
arch/sparc/include/asm/io_32.h
arch/sparc/include/asm/io_64.h

index f6902cf3cbe997f5c66ec750e1ebafcfdc2e9f5b..493f22c4684f6db6cd728c1cef08ec394ad934cb 100644 (file)
  * Defines used for both SPARC32 and SPARC64
  */
 
+/* Relaxed accessors for MMIO */
+#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(__w, __addr)    writew(__w, __addr)
+#define writel_relaxed(__l, __addr)    writel(__l, __addr)
+
 /* Big endian versions of memory read/write routines */
 #define readb_be(__addr)       __raw_readb(__addr)
 #define readw_be(__addr)       __raw_readw(__addr)
index 9f532902627c4412b08968645eda5667975b104e..407ac14295f43ec01e93141e1673794d5e3f024c 100644 (file)
@@ -4,10 +4,6 @@
 #include <linux/kernel.h>
 #include <linux/ioport.h>  /* struct resource */
 
-#define readb_relaxed(__addr)  readb(__addr)
-#define readw_relaxed(__addr)  readw(__addr)
-#define readl_relaxed(__addr)  readl(__addr)
-
 #define IO_SPACE_LIMIT 0xffffffff
 
 #define memset_io(d,c,sz)     _memset_io(d,c,sz)
index 80b54b326d4983f5c2ccdd48557276d459c5fb62..d50e6127325d099fab38a583a09c9d666a6350f4 100644 (file)
@@ -136,6 +136,7 @@ static inline u32 readl(const volatile void __iomem *addr)
 }
 
 #define readq readq
+#define readq_relaxed readq
 static inline u64 readq(const volatile void __iomem *addr)
 {      u64 ret;
 
@@ -175,6 +176,7 @@ static inline void writel(u32 l, volatile void __iomem *addr)
 }
 
 #define writeq writeq
+#define writeq_relaxed writeq
 static inline void writeq(u64 q, volatile void __iomem *addr)
 {
        __asm__ __volatile__("stxa\t%r0, [%1] %2\t/* pci_writeq */"
@@ -183,7 +185,6 @@ static inline void writeq(u64 q, volatile void __iomem *addr)
                             : "memory");
 }
 
-
 #define inb inb
 static inline u8 inb(unsigned long addr)
 {
@@ -264,11 +265,6 @@ static inline void iowrite32_rep(void __iomem *port, const void *buf, unsigned l
        outsl((unsigned long __force)port, buf, count);
 }
 
-#define readb_relaxed(__addr)  readb(__addr)
-#define readw_relaxed(__addr)  readw(__addr)
-#define readl_relaxed(__addr)  readl(__addr)
-#define readq_relaxed(__addr)  readq(__addr)
-
 /* Valid I/O Space regions are anywhere, because each PCI bus supported
  * can live in an arbitrary area of the physical address range.
  */