summaryrefslogtreecommitdiffstats
path: root/util/ectool/ectool.c
diff options
context:
space:
mode:
authorAndrey Korolyov <andrey@xdel.ru>2016-01-05 14:27:59 +0300
committerPatrick Georgi <pgeorgi@google.com>2016-01-27 17:15:56 +0100
commit393d9322ba51feeea33cd08f77945f593cb70e32 (patch)
treedde365c28462b404b923ec5067f6d97e139747bb /util/ectool/ectool.c
parentffc2260d749a1774a79805ec51bcb67021c07c28 (diff)
downloadcoreboot-393d9322ba51feeea33cd08f77945f593cb70e32.tar.gz
coreboot-393d9322ba51feeea33cd08f77945f593cb70e32.tar.bz2
coreboot-393d9322ba51feeea33cd08f77945f593cb70e32.zip
ectool: fix NetBSD compilation
Since NetBSD does not support uname -o, push check for CygWin inside separate non-failing condition in Makefile. Change-Id: Ibd264384f49b33412f0ef8554bd9c9fb8f60a892 Signed-off-by: Andrey Korolyov <andrey@xdel.ru> Reviewed-on: https://review.coreboot.org/12831 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'util/ectool/ectool.c')
-rw-r--r--util/ectool/ectool.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/util/ectool/ectool.c b/util/ectool/ectool.c
index c93eb256e7f3..50ac30b5e53c 100644
--- a/util/ectool/ectool.c
+++ b/util/ectool/ectool.c
@@ -18,10 +18,17 @@
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
+#ifndef __NetBSD__
#include <sys/io.h>
+#endif
#include <ec.h>
#include <stdlib.h>
+#ifdef __NetBSD__
+#include <machine/sysarch.h>
+#endif
+
+
#define ECTOOL_VERSION "0.1"
void print_version(void)
@@ -106,7 +113,15 @@ int main(int argc, char *argv[])
}
}
+#ifdef __NetBSD__
+# ifdef __i386__
+ if (i386_iopl(3)) {
+# else
+ if (x86_64_iopl(3)) {
+# endif
+#else
if (iopl(3)) {
+#endif
printf("You need to be root.\n");
exit(1);
}