[coreboot-gerrit] Change in coreboot[master]: nvramtool: Fix build with OpenBSD
Piotr Kubaj (Code Review)
gerrit at coreboot.org
Wed May 17 20:36:56 CEST 2017
Piotr Kubaj has uploaded a new change for review. ( https://review.coreboot.org/19741 )
Change subject: nvramtool: Fix build with OpenBSD
......................................................................
nvramtool: Fix build with OpenBSD
OpenBSD needs the same includes as NetBSD. It also doesn't have x86_64_iopl function, but amd64_iopl.
Change-Id: I28273d4d87a3a77cf35412a0695325c0535e42e5
---
M util/nvramtool/Makefile
M util/nvramtool/accessors/cmos-hw-unix.c
2 files changed, 8 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/41/19741/1
diff --git a/util/nvramtool/Makefile b/util/nvramtool/Makefile
index b92adda..18b63e9 100644
--- a/util/nvramtool/Makefile
+++ b/util/nvramtool/Makefile
@@ -38,6 +38,9 @@
ifeq ($(OS_ARCH), NetBSD)
LDFLAGS = -l$(shell uname -p)
endif
+ifeq ($(OS_ARCH), OpenBSD)
+LDFLAGS = -l$(shell uname -p)
+endif
ifeq ($(shell uname -o 2>/dev/null), Cygwin)
LDFLAGS = -lioperm
CFLAGS += -D__GLIBC__
diff --git a/util/nvramtool/accessors/cmos-hw-unix.c b/util/nvramtool/accessors/cmos-hw-unix.c
index acefdf7..39b472c 100644
--- a/util/nvramtool/accessors/cmos-hw-unix.c
+++ b/util/nvramtool/accessors/cmos-hw-unix.c
@@ -17,7 +17,7 @@
#if (defined(__MACH__) && defined(__APPLE__))
#include <DirectHW/DirectHW.h>
#endif
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#if defined(__i386__) || defined(__x86_64__)
#include <machine/sysarch.h>
@@ -58,8 +58,12 @@
}
#endif
#ifdef __x86_64__
+#ifdef __OpenBSD__
+#define iopl amd64_iopl
+#else
#define iopl x86_64_iopl
#endif
+#endif
#ifdef __i386__
#define iopl i386_iopl
#endif
--
To view, visit https://review.coreboot.org/19741
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I28273d4d87a3a77cf35412a0695325c0535e42e5
Gerrit-PatchSet: 1
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Piotr Kubaj <pkubaj at anongoth.pl>
More information about the coreboot-gerrit
mailing list