diff options
author | markm <markm@FreeBSD.org> | 2002-07-19 13:38:43 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2002-07-19 13:38:43 +0000 |
commit | 32ac7e29651c2543786141de3a016d2256077d8f (patch) | |
tree | 8ff8a1fb45d285ad3b8b8fe9a28e8c34c78a4982 /usr.bin/doscmd/port.c | |
parent | dca07368059ad545512278870e07e4e36a7e95cd (diff) | |
download | FreeBSD-src-32ac7e29651c2543786141de3a016d2256077d8f.zip FreeBSD-src-32ac7e29651c2543786141de3a016d2256077d8f.tar.gz |
"inline" fixing. Replace "inline" with "__inline" to make more BSD
standard (and easier to define away with support in cdefs.h).
Also convert two function-like macros to static inline functions
for lint and the debugger.
Diffstat (limited to 'usr.bin/doscmd/port.c')
-rw-r--r-- | usr.bin/doscmd/port.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/usr.bin/doscmd/port.c b/usr.bin/doscmd/port.c index a65b1be..22e995f 100644 --- a/usr.bin/doscmd/port.c +++ b/usr.bin/doscmd/port.c @@ -42,17 +42,25 @@ __FBSDID("$FreeBSD$"); #define MINPORT 0x000 #define MAXPORT_MASK (MAXPORT - 1) -#define in(port) \ -({ \ - register int _inb_result; \ -\ - asm volatile ("xorl %%eax,%%eax; inb %%dx,%%al" : \ - "=a" (_inb_result) : "d" (port)); \ - _inb_result; \ -}) - -#define out(port, data) \ - asm volatile ("outb %%al,%%dx" : : "a" (data), "d" (port)) +static __inline int +in(u_int port) +{ + int _inb_result; + +#ifdef __GNUC__ + __asm __volatile ("xorl %%eax,%%eax; inb %%dx,%%al" : + "=a" (_inb_result) : "d" (port)); +#endif + return _inb_result; +} + +static __inline void +out(u_int port, int data) +{ +#ifdef __GNUC__ + __asm __volatile ("outb %%al,%%dx" : : "a" (data), "d" (port)); +#endif +} FILE *iolog = 0; u_long ioports[MAXPORT/32]; |