diff options
author | Andriy Gapon <avg@icyb.net.ua> | 2008-05-22 13:22:45 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2008-05-22 13:22:45 +0000 |
commit | 4b1cde877c39cbab29fffa28a5654958c07b723c (patch) | |
tree | 6d4f95cc5d08955cc7b8c53b702a32516bf4573b /util/flashrom/flashrom.c | |
parent | 42319797a68f873b142dc26cd1f4031c9ba52fcf (diff) |
Changes to make flashrom compile (and work) on FreeBSD.
This patch addresses different argument order of outX() calls,
FreeBSD-specific headers, difference in certain type names and system
interface names, and also FreeBSD-specific way of gaining IO port
access.
Signed-off-by: Andriy Gapon <avg@icyb.net.ua>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3344 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flashrom/flashrom.c')
-rw-r--r-- | util/flashrom/flashrom.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/util/flashrom/flashrom.c b/util/flashrom/flashrom.c index 842d473a1e..e366f94e93 100644 --- a/util/flashrom/flashrom.c +++ b/util/flashrom/flashrom.c @@ -252,6 +252,9 @@ int main(int argc, char *argv[]) int option_index = 0; int read_it = 0, write_it = 0, erase_it = 0, verify_it = 0; int ret = 0, i; +#ifdef __FreeBSD__ + int io_fd; +#endif static struct option long_options[] = { {"read", 0, 0, 'r'}, @@ -367,6 +370,8 @@ int main(int argc, char *argv[]) /* First get full io access */ #if defined (__sun) && (defined(__i386) || defined(__amd64)) if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) != 0) { +#elif defined(__FreeBSD__) + if ((io_fd = open("/dev/io", O_RDWR)) < 0) { #else if (iopl(3) != 0) { #endif @@ -559,5 +564,8 @@ int main(int argc, char *argv[]) if (verify_it) ret |= verify_flash(flash, buf); +#ifdef __FreeBSD__ + close(io_fd); +#endif return ret; } |