aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/io.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sh/io.h')
-rw-r--r--include/asm-sh/io.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/asm-sh/io.h b/include/asm-sh/io.h
index e6a1877dcb20..1a336cdc75fe 100644
--- a/include/asm-sh/io.h
+++ b/include/asm-sh/io.h
@@ -135,6 +135,32 @@ void __raw_readsl(unsigned long addr, void *data, int longlen);
135# define writel(v,a) ({ __raw_writel((v),(a)); mb(); }) 135# define writel(v,a) ({ __raw_writel((v),(a)); mb(); })
136#endif 136#endif
137 137
138#define __BUILD_MEMORY_STRING(bwlq, type) \
139 \
140static inline void writes##bwlq(volatile void __iomem *mem, \
141 const void *addr, unsigned int count) \
142{ \
143 const volatile type *__addr = addr; \
144 \
145 while (count--) { \
146 __raw_write##bwlq(*__addr, mem); \
147 __addr++; \
148 } \
149} \
150 \
151static inline void reads##bwlq(volatile void __iomem *mem, void *addr, \
152 unsigned int count) \
153{ \
154 volatile type *__addr = addr; \
155 \
156 while (count--) { \
157 *__addr = __raw_read##bwlq(mem); \
158 __addr++; \
159 } \
160}
161
162__BUILD_MEMORY_STRING(b, u8)
163__BUILD_MEMORY_STRING(w, u16)
138#define writesl __raw_writesl 164#define writesl __raw_writesl
139#define readsl __raw_readsl 165#define readsl __raw_readsl
140 166