aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/include/asm/io_64.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/include/asm/io_64.h')
-rw-r--r--arch/sparc/include/asm/io_64.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h
index 9517d063c79c..9c8965415f0a 100644
--- a/arch/sparc/include/asm/io_64.h
+++ b/arch/sparc/include/asm/io_64.h
@@ -419,6 +419,21 @@ _memset_io(volatile void __iomem *dst, int c, __kernel_size_t n)
419#define memset_io(d,c,sz) _memset_io(d,c,sz) 419#define memset_io(d,c,sz) _memset_io(d,c,sz)
420 420
421static inline void 421static inline void
422_sbus_memcpy_fromio(void *dst, const volatile void __iomem *src,
423 __kernel_size_t n)
424{
425 char *d = dst;
426
427 while (n--) {
428 char tmp = sbus_readb(src);
429 *d++ = tmp;
430 src++;
431 }
432}
433
434#define sbus_memcpy_fromio(d, s, sz) _sbus_memcpy_fromio(d, s, sz)
435
436static inline void
422_memcpy_fromio(void *dst, const volatile void __iomem *src, __kernel_size_t n) 437_memcpy_fromio(void *dst, const volatile void __iomem *src, __kernel_size_t n)
423{ 438{
424 char *d = dst; 439 char *d = dst;
@@ -433,6 +448,22 @@ _memcpy_fromio(void *dst, const volatile void __iomem *src, __kernel_size_t n)
433#define memcpy_fromio(d,s,sz) _memcpy_fromio(d,s,sz) 448#define memcpy_fromio(d,s,sz) _memcpy_fromio(d,s,sz)
434 449
435static inline void 450static inline void
451_sbus_memcpy_toio(volatile void __iomem *dst, const void *src,
452 __kernel_size_t n)
453{
454 const char *s = src;
455 volatile void __iomem *d = dst;
456
457 while (n--) {
458 char tmp = *s++;
459 sbus_writeb(tmp, d);
460 d++;
461 }
462}
463
464#define sbus_memcpy_toio(d, s, sz) _sbus_memcpy_toio(d, s, sz)
465
466static inline void
436_memcpy_toio(volatile void __iomem *dst, const void *src, __kernel_size_t n) 467_memcpy_toio(volatile void __iomem *dst, const void *src, __kernel_size_t n)
437{ 468{
438 const char *s = src; 469 const char *s = src;