[coreboot] [PATCH] flashrom portability fixes and docs
Carl-Daniel Hailfinger
c-d.hailfinger.devel.2006 at gmx.net
Fri May 1 14:49:51 CEST 2009
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.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
Index: flashrom-portability/flash.h
===================================================================
--- flashrom-portability/flash.h (Revision 449)
+++ flashrom-portability/flash.h (Arbeitskopie)
@@ -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)
{
Index: flashrom-portability/flashrom.c
===================================================================
--- flashrom-portability/flashrom.c (Revision 449)
+++ flashrom-portability/flashrom.c (Arbeitskopie)
@@ -30,13 +30,6 @@
#include <stdlib.h>
#include <getopt.h>
#include <pci/pci.h>
-/* for iopl */
-#if defined (__sun) && (defined(__i386) || defined(__amd64))
-#include <strings.h>
-#include <sys/sysi86.h>
-#include <sys/psw.h>
-#include <asm/sunddi.h>
-#endif
#include "flash.h"
char *chip_to_probe = NULL;
Index: flashrom-portability/README
===================================================================
--- flashrom-portability/README (Revision 449)
+++ flashrom-portability/README (Arbeitskopie)
@@ -21,7 +21,18 @@
* pciutils-devel / pciutils-dev / libpci-dev
* zlib-devel / zlib1g-dev
+To compile on Solaris, use the commands below:
+gmake LDFLAGS="-L$pathtolibpci -lpci -lz" CC="gcc -I$pathtopciheaders" CFLAGS=-O2
+To compile on DragonFly BSD, use the commands below:
+ln -s /usr/pkg/include/pciutils pci
+gmake CFLAGS=-I. LDFLAGS="-L/usr/pkg/lib -lpci -lz"
+
+To compile and run on Darwin/Mac OS X:
+Install DirectIO from coresystems GmbH.
+DirectIO is available at http://www.coresystems.de/en/directio
+
+
Usage / Options
---------------
--
http://www.hailfinger.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flashrom_portability.diff
Type: text/x-patch
Size: 2371 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20090501/81bfcf44/attachment.diff>
More information about the coreboot
mailing list