patch-2.4.19 linux-2.4.19/include/asm-arm/arch-ebsa110/io.h

Next file: linux-2.4.19/include/asm-arm/arch-ebsa110/uncompress.h
Previous file: linux-2.4.19/include/asm-arm/arch-clps711x/vmalloc.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/include/asm-arm/arch-ebsa110/io.h linux-2.4.19/include/asm-arm/arch-ebsa110/io.h
@@ -21,34 +21,48 @@
 #define __arch_getw(a)		(*(volatile unsigned short *)(a))
 #define __arch_putw(v,a)	(*(volatile unsigned short *)(a) = (v))
 
-u8  __inb(int port);
-u16 __inw(int port);
-u32 __inl(int port);
+u8 __inb8(unsigned int port);
+void __outb8(u8  val, unsigned int port);
 
-#define inb(p)			__inb(p)
-#define inw(p)			__inw(p)
-#define inl(p)			__inl(p)
+u8 __inb16(unsigned int port);
+void __outb16(u8  val, unsigned int port);
 
-void __outb(u8  val, int port);
-void __outw(u16 val, int port);
-void __outl(u32 val, int port);
+u16 __inw(unsigned int port);
+void __outw(u16 val, unsigned int port);
 
-#define outb(v,p)		__outb(v,p)
-#define outw(v,p)		__outw(v,p)
-#define outl(v,p)		__outl(v,p)
+u32 __inl(unsigned int port);
+void __outl(u32 val, unsigned int port);
 
 u8  __readb(void *addr);
 u16 __readw(void *addr);
 u32 __readl(void *addr);
 
-#define readb(b)		__readb(b)
-#define readw(b)		__readw(b)
-#define readl(b)		__readl(b)
-
 void __writeb(u8  val, void *addr);
 void __writew(u16 val, void *addr);
 void __writel(u32 val, void *addr);
 
+/*
+ * Argh, someone forgot the IOCS16 line.  We therefore have to handle
+ * the byte stearing by selecting the correct byte IO functions here.
+ */
+#ifdef ISA_SIXTEEN_BIT_PERIPHERAL
+#define inb(p)			__inb16(p)
+#define outb(v,p)		__outb16(v,p)
+#else
+#define inb(p)			__inb8(p)
+#define outb(v,p)		__outb8(v,p)
+#endif
+
+#define inw(p)			__inw(p)
+#define outw(v,p)		__outw(v,p)
+
+#define inl(p)			__inl(p)
+#define outl(v,p)		__outl(v,p)
+
+#define readb(b)		__readb(b)
+#define readw(b)		__readw(b)
+#define readl(b)		__readl(b)
+
 #define writeb(v,b)		__writeb(v,b)
 #define writew(v,b)		__writew(v,b)
 #define writel(v,b)		__writel(v,b)
@@ -56,4 +70,12 @@
 #define __arch_ioremap(off,sz,c)	((void *)(off))
 #define __arch_iounmap(virt)		do { } while (0)
 
+extern void insb(unsigned int port, void *buf, int sz);
+extern void insw(unsigned int port, void *buf, int sz);
+extern void insl(unsigned int port, void *buf, int sz);
+
+extern void outsb(unsigned int port, const void *buf, int sz);
+extern void outsw(unsigned int port, const void *buf, int sz);
+extern void outsl(unsigned int port, const void *buf, int sz);
+
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)