summaryrefslogtreecommitdiff
path: root/util/nvramtool/accessors/cmos-hw-unix.c
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@anongoth.pl>2017-05-17 20:33:47 +0200
committerPhilipp Deppenwiese <zaolin.daisuki@gmail.com>2018-04-16 22:18:26 +0000
commit1b36c9de66eb91981983df21e7f3c05c19a15709 (patch)
treeb8ea23f7336e2e493d018c0377d0a3dcd9550902 /util/nvramtool/accessors/cmos-hw-unix.c
parenta4bf0b7cd18595d1ff37ccaa53112cb3b94dc512 (diff)
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 Signed-off-by: Piotr Kubaj <pkubaj@anongoth.pl> Reviewed-on: https://review.coreboot.org/19741 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Diffstat (limited to 'util/nvramtool/accessors/cmos-hw-unix.c')
-rw-r--r--util/nvramtool/accessors/cmos-hw-unix.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/nvramtool/accessors/cmos-hw-unix.c b/util/nvramtool/accessors/cmos-hw-unix.c
index 33d699415f..c66fa3e365 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 @@ static inline uint32_t inl(uint16_t port)
}
#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