summaryrefslogtreecommitdiff
path: root/util/viatool/viatool.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/viatool/viatool.c')
-rw-r--r--util/viatool/viatool.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/util/viatool/viatool.c b/util/viatool/viatool.c
index 0fde455c87..c19647fd0c 100644
--- a/util/viatool/viatool.c
+++ b/util/viatool/viatool.c
@@ -25,6 +25,10 @@
#include <unistd.h>
#include "viatool.h"
+#ifdef __NetBSD__
+#include <machine/sysarch.h>
+#endif
+
/*
* http://pci-ids.ucw.cz/read/PC/8086
* http://en.wikipedia.org/wiki/Intel_Tick-Tock
@@ -146,6 +150,14 @@ int main(int argc, char *argv[])
#if defined(__FreeBSD__)
if (open("/dev/io", O_RDWR) < 0) {
perror("/dev/io");
+#elif defined(__NetBSD__)
+# ifdef __i386__
+ if (i386_iopl(3)) {
+ perror("iopl");
+# else
+ if (x86_64_iopl(3)) {
+ perror("iopl");
+# endif
#else
if (iopl(3)) {
perror("iopl");