summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-23 14:54:42 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-23 14:54:42 +0000
commit3772e2c14a76aca75c6e1dd6814b50a0224a438f (patch)
treee54b8c1a085492ab7f05637caebaee7bb4b65988 /c/src/lib/libcpu
parentMoved pmacros.h to include not support/include. (diff)
downloadrtems-3772e2c14a76aca75c6e1dd6814b50a0224a438f.tar.bz2
*** empty log message ***
Diffstat (limited to 'c/src/lib/libcpu')
-rw-r--r--c/src/lib/libcpu/i386/cpu.h48
1 files changed, 21 insertions, 27 deletions
diff --git a/c/src/lib/libcpu/i386/cpu.h b/c/src/lib/libcpu/i386/cpu.h
index cb638ebe97..27e5f1cb88 100644
--- a/c/src/lib/libcpu/i386/cpu.h
+++ b/c/src/lib/libcpu/i386/cpu.h
@@ -178,61 +178,55 @@ static inline void i386_set_cr3(unsigned int segment)
*/
#define i386_outport_byte( _port, _value ) \
- { register unsigned short __port = _port; \
+do { register unsigned short __port = _port; \
register unsigned char __value = _value; \
\
- asm volatile ( "outb %0,%1" : "=a" (__value), "=d" (__port) \
- : "0" (__value), "1" (__port) \
- ); \
- }
+ asm volatile ( "outb %0,%1" : : "a" (__value), "d" (__port) ); \
+ } while (0)
#define i386_outport_word( _port, _value ) \
- { register unsigned short __port = _port; \
+do { register unsigned short __port = _port; \
register unsigned short __value = _value; \
\
- asm volatile ( "outw %0,%1" : "=a" (__value), "=d" (__port) \
- : "0" (__value), "1" (__port) \
- ); \
- }
+ asm volatile ( "outw %0,%1" : : "a" (__value), "d" (__port) ); \
+ } while (0)
#define i386_outport_long( _port, _value ) \
- { register unsigned short __port = _port; \
+do { register unsigned short __port = _port; \
register unsigned int __value = _value; \
\
- asm volatile ( "outl %0,%1" : "=a" (__value), "=d" (__port) \
- : "0" (__value), "1" (__port) \
- ); \
- }
+ asm volatile ( "outl %0,%1" : : "a" (__value), "d" (__port) ); \
+ } while (0)
#define i386_inport_byte( _port, _value ) \
- { register unsigned short __port = _port; \
+do { register unsigned short __port = _port; \
register unsigned char __value = 0; \
\
- asm volatile ( "inb %1,%0" : "=a" (__value), "=d" (__port) \
- : "0" (__value), "1" (__port) \
+ asm volatile ( "inb %1,%0" : "=a" (__value) \
+ : "d" (__port) \
); \
_value = __value; \
- }
+ } while (0)
#define i386_inport_word( _port, _value ) \
- { register unsigned short __port = _port; \
+do { register unsigned short __port = _port; \
register unsigned short __value = 0; \
\
- asm volatile ( "inw %1,%0" : "=a" (__value), "=d" (__port) \
- : "0" (__value), "1" (__port) \
+ asm volatile ( "inw %1,%0" : "=a" (__value) \
+ : "d" (__port) \
); \
_value = __value; \
- }
+ } while (0)
#define i386_inport_long( _port, _value ) \
- { register unsigned short __port = _port; \
+do { register unsigned short __port = _port; \
register unsigned int __value = 0; \
\
- asm volatile ( "inl %1,%0" : "=a" (__value), "=d" (__port) \
- : "0" (__value), "1" (__port) \
+ asm volatile ( "inl %1,%0" : "=a" (__value) \
+ : "d" (__port) \
); \
_value = __value; \
- }
+ } while (0)
/*
* Type definition for raw interrupts.