From 0ff8f9048b104b4a01823755406fa79a590ad02f Mon Sep 17 00:00:00 2001 From: Andrey Korolyov Date: Tue, 5 Jan 2016 20:09:02 +0300 Subject: viatool: add NetBSD support Change-Id: I033044e4b781475d6d60a49a61313a720103ce38 Signed-off-by: Andrey Korolyov Reviewed-on: https://review.coreboot.org/12836 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc --- util/viatool/viatool.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'util/viatool/viatool.c') 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 #include "viatool.h" +#ifdef __NetBSD__ +#include +#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"); -- cgit v1.2.3