summaryrefslogtreecommitdiffstats
path: root/flash.h
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-05-01 16:34:32 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-05-01 16:34:32 +0000
commit9abf529387ad68171d76f7bb9a6e665a68d0e891 (patch)
treecce78e1aac631f6f83a0eb155ead46f32878ac31 /flash.h
parent261cafab863e5ac37c7a6f3df24a5db18eb31556 (diff)
downloadast2050-flashrom-9abf529387ad68171d76f7bb9a6e665a68d0e891.zip
ast2050-flashrom-9abf529387ad68171d76f7bb9a6e665a68d0e891.tar.gz
Allow compilation on Solaris
Fix compilation on Solaris and tell people how to compile flashrom on Solaris, Darwin/Mac OS X and DragonFly BSD. Thanks to Joerg Schilling and Patrick Georgi for the Solaris part. Corresponding to flashrom svn r452. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Peter Stuge <peter@stuge.se>
Diffstat (limited to 'flash.h')
-rw-r--r--flash.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/flash.h b/flash.h
index c50ba30..f49b808 100644
--- a/flash.h
+++ b/flash.h
@@ -30,6 +30,14 @@
#include <stdint.h>
#include <stdio.h>
+/* for iopl and outb under Solaris */
+#if defined (__sun) && (defined(__i386) || defined(__amd64))
+#include <strings.h>
+#include <sys/sysi86.h>
+#include <sys/psw.h>
+#include <asm/sunddi.h>
+#endif
+
#if (defined(__MACH__) && defined(__APPLE__))
#define __DARWIN__
#endif
@@ -50,6 +58,15 @@
#define off64_t off_t
#define lseek64 lseek
#endif
+#if defined (__sun) && (defined(__i386) || defined(__amd64))
+ /* Note different order for outb */
+ #define OUTB(x,y) outb(y, x)
+ #define OUTW(x,y) outw(y, x)
+ #define OUTL(x,y) outl(y, x)
+ #define INB inb
+ #define INW inw
+ #define INL inl
+#else
#define OUTB outb
#define OUTW outw
#define OUTL outl
@@ -57,6 +74,7 @@
#define INW inw
#define INL inl
#endif
+#endif
static inline void chip_writeb(uint8_t b, volatile void *addr)
{
OpenPOWER on IntegriCloud