patch-2.2.8 linux/include/asm-arm/io.h
Next file: linux/include/asm-arm/ioc.h
Previous file: linux/include/asm-arm/init.h
Back to the patch index
Back to the overall index
- Lines: 95
- Date:
Sat May 8 11:06:57 1999
- Orig file:
v2.2.7/linux/include/asm-arm/io.h
- Orig date:
Fri Jan 8 22:36:22 1999
diff -u --recursive --new-file v2.2.7/linux/include/asm-arm/io.h linux/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 @@
#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")
-/*
- * String version of IO memory access ops:
- */
-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);
+#endif
-#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))
+/*
+ * This isn't especially architecture dependent so it seems like it
+ * might as well go here as anywhere.
+ */
+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;
+}
-#endif
+#undef ARCH_READWRITE
+#undef ARCH_IO_DELAY
+#undef ARCH_IO_CONSTANT
#endif
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)