aboutsummaryrefslogtreecommitdiff
path: root/include/asm-v850
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2005-07-27 11:44:54 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-27 16:26:03 -0700
commit21ea9f63297497df3040c70a67a207d229368a4c (patch)
tree446b057d504cc207a054f6529937b7227ae82a25 /include/asm-v850
parentf307d365ea4db4848a0b43bbbdf3c96f4d2e0933 (diff)
[PATCH] v850: Update ioremap return type and add ioread/iowrite functions
Signed-off-by: Miles Bader <miles@gnu.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-v850')
-rw-r--r--include/asm-v850/io.h37
1 files changed, 24 insertions, 13 deletions
diff --git a/include/asm-v850/io.h b/include/asm-v850/io.h
index bb5efd1b4b7..cc364fcbec1 100644
--- a/include/asm-v850/io.h
+++ b/include/asm-v850/io.h
@@ -1,8 +1,8 @@
/*
* include/asm-v850/io.h -- Misc I/O operations
*
- * Copyright (C) 2001,02,03,04 NEC Electronics Corporation
- * Copyright (C) 2001,02,03,04 Miles Bader <miles@gnu.org>
+ * Copyright (C) 2001,02,03,04,05 NEC Electronics Corporation
+ * Copyright (C) 2001,02,03,04,05 Miles Bader <miles@gnu.org>
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file COPYING in the main directory of this
@@ -27,12 +27,12 @@
#define readw_relaxed(a) readw(a)
#define readl_relaxed(a) readl(a)
-#define writeb(b, addr) \
- (void)((*(volatile unsigned char *) (addr)) = (b))
-#define writew(b, addr) \
- (void)((*(volatile unsigned short *) (addr)) = (b))
-#define writel(b, addr) \
- (void)((*(volatile unsigned int *) (addr)) = (b))
+#define writeb(val, addr) \
+ (void)((*(volatile unsigned char *) (addr)) = (val))
+#define writew(val, addr) \
+ (void)((*(volatile unsigned short *) (addr)) = (val))
+#define writel(val, addr) \
+ (void)((*(volatile unsigned int *) (addr)) = (val))
#define __raw_readb readb
#define __raw_readw readw
@@ -96,11 +96,22 @@ outsl (unsigned long port, const void *src, unsigned long count)
outl (*p++, port);
}
-#define iounmap(addr) ((void)0)
-#define ioremap(physaddr, size) (physaddr)
-#define ioremap_nocache(physaddr, size) (physaddr)
-#define ioremap_writethrough(physaddr, size) (physaddr)
-#define ioremap_fullcache(physaddr, size) (physaddr)
+
+/* Some places try to pass in an loff_t for PHYSADDR (?!), so we cast it to
+ long before casting it to a pointer to avoid compiler warnings. */
+#define ioremap(physaddr, size) ((void __iomem *)(unsigned long)(physaddr))
+#define iounmap(addr) ((void)0)
+
+#define ioremap_nocache(physaddr, size) ioremap (physaddr, size)
+#define ioremap_writethrough(physaddr, size) ioremap (physaddr, size)
+#define ioremap_fullcache(physaddr, size) ioremap (physaddr, size)
+
+#define ioread8(addr) readb (addr)
+#define ioread16(addr) readw (addr)
+#define ioread32(addr) readl (addr)
+#define iowrite8(val, addr) writeb (val, addr)
+#define iowrite16(val, addr) writew (val, addr)
+#define iowrite32(val, addr) writel (val, addr)
#define mmiowb()