patch-2.3.1 linux/include/asm-arm/arch-rpc/io.h
Next file: linux/include/asm-arm/hdreg.h
Previous file: linux/include/asm-arm/arch-rpc/ide.h
Back to the patch index
Back to the overall index
- Lines: 72
- Date:
Tue May 11 16:30:45 1999
- Orig file:
v2.3.0/linux/include/asm-arm/arch-rpc/io.h
- Orig date:
Thu Jan 7 15:51:33 1999
diff -u --recursive --new-file v2.3.0/linux/include/asm-arm/arch-rpc/io.h linux/include/asm-arm/arch-rpc/io.h
@@ -28,18 +28,43 @@
* Dynamic IO functions - let the compiler
* optimize the expressions
*/
-#define DECLARE_DYN_OUT(fnsuffix,instr) \
-extern __inline__ void __out##fnsuffix (unsigned int value, unsigned int port) \
-{ \
- unsigned long temp; \
- __asm__ __volatile__( \
- "tst %2, #0x80000000\n\t" \
- "mov %0, %4\n\t" \
- "addeq %0, %0, %3\n\t" \
- "str" ##instr## " %1, [%0, %2, lsl #2] @ out"###fnsuffix \
- : "=&r" (temp) \
- : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
- : "cc"); \
+extern __inline__ void __outb (unsigned int value, unsigned int port)
+{
+ unsigned long temp;
+ __asm__ __volatile__(
+ "tst %2, #0x80000000\n\t"
+ "mov %0, %4\n\t"
+ "addeq %0, %0, %3\n\t"
+ "strb %1, [%0, %2, lsl #2] @ outb"
+ : "=&r" (temp)
+ : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
+ : "cc");
+}
+
+extern __inline__ void __outw (unsigned int value, unsigned int port)
+{
+ unsigned long temp;
+ __asm__ __volatile__(
+ "tst %2, #0x80000000\n\t"
+ "mov %0, %4\n\t"
+ "addeq %0, %0, %3\n\t"
+ "str %1, [%0, %2, lsl #2] @ outw"
+ : "=&r" (temp)
+ : "r" (value|value<<16), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
+ : "cc");
+}
+
+extern __inline__ void __outl (unsigned int value, unsigned int port)
+{
+ unsigned long temp;
+ __asm__ __volatile__(
+ "tst %2, #0x80000000\n\t"
+ "mov %0, %4\n\t"
+ "addeq %0, %0, %3\n\t"
+ "str %1, [%0, %2, lsl #2] @ outl"
+ : "=&r" (temp)
+ : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
+ : "cc");
}
#define DECLARE_DYN_IN(sz,fnsuffix,instr) \
@@ -66,7 +91,6 @@
}
#define DECLARE_IO(sz,fnsuffix,instr) \
- DECLARE_DYN_OUT(fnsuffix,instr) \
DECLARE_DYN_IN(sz,fnsuffix,instr)
DECLARE_IO(char,b,"b")
@@ -74,7 +98,6 @@
DECLARE_IO(long,l,"")
#undef DECLARE_IO
-#undef DECLARE_DYN_OUT
#undef DECLARE_DYN_IN
/*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)