diff options
Diffstat (limited to 'include/asm-mips/io.h')
-rw-r--r-- | include/asm-mips/io.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h index e03cb77b131c..cee0562a7851 100644 --- a/include/asm-mips/io.h +++ b/include/asm-mips/io.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <asm/page.h> | 25 | #include <asm/page.h> |
26 | #include <asm/pgtable-bits.h> | 26 | #include <asm/pgtable-bits.h> |
27 | #include <asm/processor.h> | 27 | #include <asm/processor.h> |
28 | #include <asm/string.h> | ||
28 | 29 | ||
29 | #include <mangle-port.h> | 30 | #include <mangle-port.h> |
30 | 31 | ||
@@ -217,7 +218,7 @@ static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size, | |||
217 | */ | 218 | */ |
218 | if (flags == _CACHE_UNCACHED) | 219 | if (flags == _CACHE_UNCACHED) |
219 | base = (u64) IO_BASE; | 220 | base = (u64) IO_BASE; |
220 | return (void *) (unsigned long) (base + offset); | 221 | return (void __iomem *) (unsigned long) (base + offset); |
221 | } | 222 | } |
222 | 223 | ||
223 | return __ioremap(offset, size, flags); | 224 | return __ioremap(offset, size, flags); |
@@ -486,9 +487,18 @@ BUILDSTRING(q, u64) | |||
486 | /* Depends on MIPS II instruction set */ | 487 | /* Depends on MIPS II instruction set */ |
487 | #define mmiowb() asm volatile ("sync" ::: "memory") | 488 | #define mmiowb() asm volatile ("sync" ::: "memory") |
488 | 489 | ||
489 | #define memset_io(a,b,c) memset((void *)(a),(b),(c)) | 490 | static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count) |
490 | #define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c)) | 491 | { |
491 | #define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c)) | 492 | memset((void __force *) addr, val, count); |
493 | } | ||
494 | static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, int count) | ||
495 | { | ||
496 | memcpy(dst, (void __force *) src, count); | ||
497 | } | ||
498 | static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int count) | ||
499 | { | ||
500 | memcpy((void __force *) dst, src, count); | ||
501 | } | ||
492 | 502 | ||
493 | /* | 503 | /* |
494 | * Memory Mapped I/O | 504 | * Memory Mapped I/O |