Update of /cvsroot/linux-mips/linux/include/asm-mips
In directory usw-pr-cvs1:/tmp/cvs-serv17488/include/asm-mips
Modified Files:
io.h
Log Message:
Changed some of the macros to inline functions. The macros were
causing compile errors in many drivers because of the do-while syntax
used.
Index: io.h
===================================================================
RCS file: /cvsroot/linux-mips/linux/include/asm-mips/io.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- io.h 18 Mar 2002 22:53:34 -0000 1.19
+++ io.h 24 Mar 2002 00:01:51 -0000 1.20
@@ -226,38 +226,38 @@
#define isa_check_signature(io, s, l) check_signature(i,s,l)
-#define outb(val,port) \
-do { \
- *(volatile u8 *)(mips_io_port_base + (port)) = __ioswab8(val); \
-} while(0)
+static inline void outb(unsigned char val, unsigned long port)
+{
+ *(volatile u8 *)(mips_io_port_base + (port)) = __ioswab8(val);
+}
-#define outw(val,port) \
-do { \
- *(volatile u16 *)(mips_io_port_base + (port)) = __ioswab16(val); \
-} while(0)
+static inline void outw(unsigned short val, unsigned long port)
+{
+ *(volatile u16 *)(mips_io_port_base + (port)) = __ioswab16(val);
+}
-#define outl(val,port) \
-do { \
- *(volatile u32 *)(mips_io_port_base + (port)) = __ioswab32(val);\
-} while(0)
+static inline void outl(unsigned long val, unsigned long port)
+{
+ *(volatile u32 *)(mips_io_port_base + (port)) = __ioswab32(val);
+}
-#define outb_p(val,port) \
-do { \
- *(volatile u8 *)(mips_io_port_base + (port)) = __ioswab8(val); \
- SLOW_DOWN_IO; \
-} while(0)
+static inline void outb_p(unsigned char val, unsigned long port)
+{
+ *(volatile u8 *)(mips_io_port_base + (port)) = __ioswab8(val);
+ SLOW_DOWN_IO;
+}
-#define outw_p(val,port) \
-do { \
- *(volatile u16 *)(mips_io_port_base + (port)) = __ioswab16(val);\
- SLOW_DOWN_IO; \
-} while(0)
+static inline void outw_p(unsigned short val, unsigned long port)
+{
+ *(volatile u16 *)(mips_io_port_base + (port)) = __ioswab16(val);
+ SLOW_DOWN_IO;
+}
-#define outl_p(val,port) \
-do { \
- *(volatile u32 *)(mips_io_port_base + (port)) = __ioswab32(val);\
- SLOW_DOWN_IO; \
-} while(0)
+static inline void outl_p(unsigned long val, unsigned long port)
+{
+ *(volatile u32 *)(mips_io_port_base + (port)) = __ioswab32(val);
+ SLOW_DOWN_IO;
+}
static inline unsigned char inb(unsigned long port)
{
|