summaryrefslogtreecommitdiffstats
path: root/usr.bin/doscmd/port.c
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2002-07-19 13:38:43 +0000
committermarkm <markm@FreeBSD.org>2002-07-19 13:38:43 +0000
commit32ac7e29651c2543786141de3a016d2256077d8f (patch)
tree8ff8a1fb45d285ad3b8b8fe9a28e8c34c78a4982 /usr.bin/doscmd/port.c
parentdca07368059ad545512278870e07e4e36a7e95cd (diff)
downloadFreeBSD-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.c30
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];
OpenPOWER on IntegriCloud