--- libfreeipmi/src/driver/ipmi-kcs-driver.c 2011-04-21 16:02:41.000000000 -0500 +++ libfreeipmi/src/driver/ipmi-kcs-driver.c.netbsd 2011-08-13 22:08:46.000000000 -0500 @@ -158,7 +158,21 @@ # include #endif -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +/* Code for asm_inb() and asm_outb() taken from: + http://cvsweb.se.netbsd.org/cgi-bin/bsdweb.cgi/pkgsrc/sysutils/vbetool/patches/patch-ab?rev=1.4;content-type=text/plain +*/ +#if defined(__NetBSD__) +static uint8_t asm_inb(unsigned port) { + uint8_t data; + __asm volatile("inb %w1,%0" : "=a" (data) : "d" (port)); + return data; +} +static __inline void asm_outb(uint8_t data, unsigned port) { + __asm volatile("outb %0,%w1" : : "a" (data), "d" (port)); +} +# define _INB(port) asm_inb (port) +# define _OUTB(data, port) asm_outb (data, port) +#elif defined(__FreeBSD__) || defined(__OpenBSD__) # define _INB(port) inb (port) # define _OUTB(data, port) outb (port, data) #elif defined(HAVE_IOPL)