summaryrefslogtreecommitdiffstats
path: root/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
commitf79edb9a11a74a2a1e7652badce5356f2ce38c1a (patch)
tree8c343406448761849134777cf4a7c81b089a7d58 /flash.h
parenta69c447b908c2e4b31df78eba830a88ab8547662 (diff)
downloadast2050-flashrom-f79edb9a11a74a2a1e7652badce5356f2ce38c1a.zip
ast2050-flashrom-f79edb9a11a74a2a1e7652badce5356f2ce38c1a.tar.gz
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 Corresponding to flashrom svn r399 and coreboot v2 svn r3905. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
Diffstat (limited to 'flash.h')
-rw-r--r--flash.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/flash.h b/flash.h
index bad3110..8b85538 100644
--- a/flash.h
+++ b/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
OpenPOWER on IntegriCloud