diff options
Diffstat (limited to 'arch/sparc/include/asm/io_32.h')
-rw-r--r-- | arch/sparc/include/asm/io_32.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h index 2889574608db..c2ced21c9dc1 100644 --- a/arch/sparc/include/asm/io_32.h +++ b/arch/sparc/include/asm/io_32.h | |||
@@ -208,6 +208,21 @@ _memset_io(volatile void __iomem *dst, int c, __kernel_size_t n) | |||
208 | #define memset_io(d,c,sz) _memset_io(d,c,sz) | 208 | #define memset_io(d,c,sz) _memset_io(d,c,sz) |
209 | 209 | ||
210 | static inline void | 210 | static inline void |
211 | _sbus_memcpy_fromio(void *dst, const volatile void __iomem *src, | ||
212 | __kernel_size_t n) | ||
213 | { | ||
214 | char *d = dst; | ||
215 | |||
216 | while (n--) { | ||
217 | char tmp = sbus_readb(src); | ||
218 | *d++ = tmp; | ||
219 | src++; | ||
220 | } | ||
221 | } | ||
222 | |||
223 | #define sbus_memcpy_fromio(d, s, sz) _sbus_memcpy_fromio(d, s, sz) | ||
224 | |||
225 | static inline void | ||
211 | _memcpy_fromio(void *dst, const volatile void __iomem *src, __kernel_size_t n) | 226 | _memcpy_fromio(void *dst, const volatile void __iomem *src, __kernel_size_t n) |
212 | { | 227 | { |
213 | char *d = dst; | 228 | char *d = dst; |
@@ -222,6 +237,22 @@ _memcpy_fromio(void *dst, const volatile void __iomem *src, __kernel_size_t n) | |||
222 | #define memcpy_fromio(d,s,sz) _memcpy_fromio(d,s,sz) | 237 | #define memcpy_fromio(d,s,sz) _memcpy_fromio(d,s,sz) |
223 | 238 | ||
224 | static inline void | 239 | static inline void |
240 | _sbus_memcpy_toio(volatile void __iomem *dst, const void *src, | ||
241 | __kernel_size_t n) | ||
242 | { | ||
243 | const char *s = src; | ||
244 | volatile void __iomem *d = dst; | ||
245 | |||
246 | while (n--) { | ||
247 | char tmp = *s++; | ||
248 | sbus_writeb(tmp, d); | ||
249 | d++; | ||
250 | } | ||
251 | } | ||
252 | |||
253 | #define sbus_memcpy_toio(d, s, sz) _sbus_memcpy_toio(d, s, sz) | ||
254 | |||
255 | static inline void | ||
225 | _memcpy_toio(volatile void __iomem *dst, const void *src, __kernel_size_t n) | 256 | _memcpy_toio(volatile void __iomem *dst, const void *src, __kernel_size_t n) |
226 | { | 257 | { |
227 | const char *s = src; | 258 | const char *s = src; |