summaryrefslogtreecommitdiff
path: root/util/flashrom/flash.h
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2009-01-26 01:23:31 +0000
committerPeter Stuge <peter@stuge.se>2009-01-26 01:23:31 +0000
commit713ee92c96c0c92cdd1fe64a58cc1f9abd94d11c (patch)
treeba465bab12911ecb94ab3ea56b466273081543f8 /util/flashrom/flash.h
parentd48091a35c18745527d1e164f82bc774e4bd6b58 (diff)
flashrom: Darwin / Mac OS X
Through DirectIO from coresystems GmbH we now support Darwin/Mac OS X. DirectIO is available at http://www.coresystems.de/en/directio Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3905 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flashrom/flash.h')
-rw-r--r--util/flashrom/flash.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/flashrom/flash.h b/util/flashrom/flash.h
index bad3110e3e..8b8553826d 100644
--- a/util/flashrom/flash.h
+++ b/util/flashrom/flash.h
@@ -30,6 +30,10 @@
#include <stdint.h>
#include <stdio.h>
+#if (defined(__MACH__) && defined(__APPLE__))
+#define __DARWIN__
+#endif
+
#if defined(__FreeBSD__)
#include <machine/cpufunc.h>
#define off64_t off_t
@@ -41,6 +45,11 @@
#define INW(x) __extension__ ({ u_int tmp = (x); inw(tmp); })
#define INL(x) __extension__ ({ u_int tmp = (x); inl(tmp); })
#else
+#if defined(__DARWIN__)
+ #include <DirectIO/darwinio.h>
+ #define off64_t off_t
+ #define lseek64 lseek
+#endif
#define OUTB outb
#define OUTW outw
#define OUTL outl