summaryrefslogtreecommitdiffstats
path: root/include/asm-mips/io.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2005-03-01 19:22:29 +0000
committerRalf Baechle <ralf@linux-mips.org>2005-10-29 19:30:50 +0100
commitfe00f943e0ef98b4057abcc2940d631a975b43cd (patch)
treec036ab8269ac86485130a083330229a01d319557 /include/asm-mips/io.h
parent14f18b7f7e58de9a34c4b5fd38d5f73f22fba7ac (diff)
downloadop-kernel-dev-fe00f943e0ef98b4057abcc2940d631a975b43cd.zip
op-kernel-dev-fe00f943e0ef98b4057abcc2940d631a975b43cd.tar.gz
Sparseify MIPS.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/asm-mips/io.h')
-rw-r--r--include/asm-mips/io.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h
index e03cb77..cee0562 100644
--- a/include/asm-mips/io.h
+++ b/include/asm-mips/io.h
@@ -25,6 +25,7 @@
#include <asm/page.h>
#include <asm/pgtable-bits.h>
#include <asm/processor.h>
+#include <asm/string.h>
#include <mangle-port.h>
@@ -217,7 +218,7 @@ static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size,
*/
if (flags == _CACHE_UNCACHED)
base = (u64) IO_BASE;
- return (void *) (unsigned long) (base + offset);
+ return (void __iomem *) (unsigned long) (base + offset);
}
return __ioremap(offset, size, flags);
@@ -486,9 +487,18 @@ BUILDSTRING(q, u64)
/* Depends on MIPS II instruction set */
#define mmiowb() asm volatile ("sync" ::: "memory")
-#define memset_io(a,b,c) memset((void *)(a),(b),(c))
-#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
-#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
+static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count)
+{
+ memset((void __force *) addr, val, count);
+}
+static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, int count)
+{
+ memcpy(dst, (void __force *) src, count);
+}
+static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int count)
+{
+ memcpy((void __force *) dst, src, count);
+}
/*
* Memory Mapped I/O
OpenPOWER on IntegriCloud