diff options
author | Idwer Vollering <vidwer@gmail.com> | 2010-10-24 13:50:13 +0000 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2010-10-24 13:50:13 +0000 |
commit | 3f91d813efe80045e322f7c6a767b403911b8a1c (patch) | |
tree | cbea61250d626d907b2e84951cd16e2dfaa32f82 /util/inteltool/inteltool.c | |
parent | a4d77dc74d6500e651a6d4e477f9d499915cac7f (diff) |
Add inteltool support for FreeBSD.
Signed-off-by: Idwer Vollering <vidwer@gmail.com>
Acked-by Stefan Reinauer <stepan@coreboot.org>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5981 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/inteltool/inteltool.c')
-rw-r--r-- | util/inteltool/inteltool.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/util/inteltool/inteltool.c b/util/inteltool/inteltool.c index c6a835fd7e..bf5efc9924 100644 --- a/util/inteltool/inteltool.c +++ b/util/inteltool/inteltool.c @@ -3,6 +3,7 @@ * * Copyright (C) 2008-2010 by coresystems GmbH * written by Stefan Reinauer <stepan@coresystems.de> + * Copyright (C) 2009 Carl-Daniel Hailfinger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,6 +25,9 @@ #include <fcntl.h> #include <sys/mman.h> #include "inteltool.h" +#if defined(__FreeBSD__) +#include <unistd.h> +#endif static const struct { uint16_t vendor_id, device_id; @@ -213,7 +217,17 @@ int main(int argc, char *argv[]) } } +#if defined(__FreeBSD__) + int io_fd; +#endif + +#if defined(__FreeBSD__) + if ((io_fd = open("/dev/io", O_RDWR)) < 0) { + perror("/dev/io"); +#else if (iopl(3)) { + perror("iopl"); +#endif printf("You need to be root.\n"); exit(1); } |