summaryrefslogtreecommitdiffstats
path: root/include/asm-arm/io.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-06-13 16:29:25 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-06-13 16:29:25 +0000
commitdb7d4daea91e105e3859cf461d7e53b9b77454b2 (patch)
tree9bb65b95440af09e8aca63abe56970dd3360cc57 /include/asm-arm/io.h
parent9c1c01ead627bdda9211c9abd5b758d6c687d8ac (diff)
Merge with Linux 2.2.8.
Diffstat (limited to 'include/asm-arm/io.h')
-rw-r--r--include/asm-arm/io.h71
1 files changed, 56 insertions, 15 deletions
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index e87744b71..35db8e667 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -8,12 +8,35 @@
* constant addresses and variable addresses.
* 04-Dec-1997 RMK Moved a lot of this stuff to the new architecture
* specific IO header files.
+ * 27-Mar-1999 PJB Second parameter of memcpy_toio is const..
+ * 04-Apr-1999 PJB Added check_signature.
*/
#ifndef __ASM_ARM_IO_H
#define __ASM_ARM_IO_H
+#ifdef __KERNEL__
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif
+
+extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
+
+/*
+ * String version of IO memory access ops:
+ */
+extern void _memcpy_fromio(void *, unsigned long, unsigned long);
+extern void _memcpy_toio(unsigned long, const void *, unsigned long);
+extern void _memset_io(unsigned long, int, unsigned long);
+
+#define memcpy_fromio(to,from,len) _memcpy_fromio((to),(unsigned long)(from),(len))
+#define memcpy_toio(to,from,len) _memcpy_toio((unsigned long)(to),(from),(len))
+#define memset_io(addr,c,len) _memset_io((unsigned long)(addr),(c),(len))
+
+#endif
+
#include <asm/hardware.h>
-#include <asm/arch/mmu.h>
+#include <asm/arch/memory.h>
#include <asm/arch/io.h>
#include <asm/proc/io.h>
@@ -168,25 +191,43 @@ __IO(l,"",long)
#endif
-#undef ARCH_IO_DELAY
-#undef ARCH_IO_CONSTANT
+#ifndef ARCH_READWRITE
-#ifdef __KERNEL__
+/* for panic */
+#include <linux/kernel.h>
-extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
+#define readb(p) (panic("readb called, but not implemented"),0)
+#define readw(p) (panic("readw called, but not implemented"),0)
+#define readl(p) (panic("readl called, but not implemented"),0)
+#define writeb(v,p) panic("writeb called, but not implemented")
+#define writew(v,p) panic("writew called, but not implemented")
+#define writel(v,p) panic("writel called, but not implemented")
+
+#endif
/*
- * String version of IO memory access ops:
+ * This isn't especially architecture dependent so it seems like it
+ * might as well go here as anywhere.
*/
-extern void _memcpy_fromio(void *, unsigned long, unsigned long);
-extern void _memcpy_toio(unsigned long, void *, unsigned long);
-extern void _memset_io(unsigned long, int, unsigned long);
-
-#define memcpy_fromio(to,from,len) _memcpy_fromio((to),(unsigned long)(from),(len))
-#define memcpy_toio(to,from,len) _memcpy_toio((unsigned long)(to),(from),(len))
-#define memset_io(addr,c,len) _memset_io((unsigned long)(addr),(c),(len))
-
-#endif
+static inline int check_signature(unsigned long io_addr,
+ const unsigned char *signature, int length)
+{
+ int retval = 0;
+ do {
+ if (readb(io_addr) != *signature)
+ goto out;
+ io_addr++;
+ signature++;
+ length--;
+ } while (length);
+ retval = 1;
+out:
+ return retval;
+}
+
+#undef ARCH_READWRITE
+#undef ARCH_IO_DELAY
+#undef ARCH_IO_CONSTANT
#endif