diff options
author | Magnus Damm <damm@igel.co.jp> | 2007-09-09 23:08:42 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2007-09-20 22:57:52 -0400 |
commit | da6b003adc73011fd441a89c30d4f896667e24ba (patch) | |
tree | 8e31224884e3b01bb6d479329090f5e2e7758e0a | |
parent | 9d4c82625914c31fd21e341765d476784cc74f14 (diff) |
sh: add writesb(), readsb(), writesw() and readsw() to io.h
This patch adds inline versions of writesb(), readsb(), writesw() and
readsw() to include/asm-sh/io.h. Stolen from include/asm-avr32/io.h.
These functions are needed to compile certain device drivers such as
ax88796.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | include/asm-sh/io.h | 26 |
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 | \ | ||
140 | static 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 | \ | ||
151 | static 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 | ||