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/flash.h | |
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/flash.h')
-rw-r--r-- | util/flashrom/flash.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/util/flashrom/flash.h b/util/flashrom/flash.h index a3740ee633..a41c660da2 100644 --- a/util/flashrom/flash.h +++ b/util/flashrom/flash.h @@ -30,6 +30,25 @@ #include <stdint.h> #include <stdio.h> +#ifdef __FreeBSD__ + #include <machine/cpufunc.h> + #define off64_t off_t + #define lseek64 lseek + #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 ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) struct flashchip { |