From b64aa60f1fd5e6c84ec8ff6ad0baa7afee0d810a Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Tue, 28 Oct 2008 22:13:38 +0000 Subject: Allow superiotool to compile and work on FreeBSD. Tested on FreeBSD 7. Signed-off-by: Andriy Gapon Acked-by: Carl-Daniel Hailfinger Acked-by: Uwe Hermann git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3698 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/superiotool/superiotool.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'util/superiotool/superiotool.h') diff --git a/util/superiotool/superiotool.h b/util/superiotool/superiotool.h index 3433cdb4a6..7e0ca0bd9b 100644 --- a/util/superiotool/superiotool.h +++ b/util/superiotool/superiotool.h @@ -28,7 +28,27 @@ #include #include #include +#if defined(__GLIBC__) #include +#endif + +#if defined(__FreeBSD__) +#include +#include +#define OUTB(x, y) do { u_int tmp = (y); outb(tmp, (x)); } while (0) +#define OUTW(x, y) do { u_int tmp = (y); outw(tmp, (x)); } while (0) +#define OUTL(x, y) do { u_int tmp = (y); outl(tmp, (x)); } while (0) +#define INB(x) __extension__ ({ u_int tmp = (x); inb(tmp); }) +#define INW(x) __extension__ ({ u_int tmp = (x); inw(tmp); }) +#define INL(x) __extension__ ({ u_int tmp = (x); inl(tmp); }) +#else +#define OUTB outb +#define OUTW outw +#define OUTL outl +#define INB inb +#define INW inw +#define INL inl +#endif #define USAGE "Usage: superiotool [-d] [-e] [-l] [-V] [-v] [-h]\n\n\ -d | --dump Dump Super I/O register contents\n\ -- cgit v1.2.3