Comments
Patch
===================================================================
@@ -31,8 +31,12 @@
#endif
#if NEED_PCI == 1
+#if defined (__MINGW32_VERSION) && ( defined (__i386__) || defined (__x86_64__) )
+#include "directio.h"
+#else
#include <pci/pci.h>
#endif
+#endif
#if defined (__i386__) || defined (__x86_64__)
===================================================================
@@ -30,7 +30,25 @@
#include <errno.h>
#include "flash.h"
-#ifdef __DJGPP__
+#if defined (__MINGW32_VERSION)
+
+#define MEM_DEV "DirectIO"
+
+void *sys_physmap(unsigned long phys_addr, size_t len)
+{
+ return map_physical_addr_range(phys_addr, len);
+}
+
+#define sys_physmap_rw_uncached sys_physmap
+#define sys_physmap_ro_cached sys_physmap
+
+void physunmap(void *virt_addr, size_t len)
+{
+ unmap_physical_addr_range(virt_addr, len);
+}
+
+#elif defined (__DJGPP__)
+
#include <dpmi.h>
#include <sys/nearptr.h>
===================================================================
@@ -213,8 +213,11 @@
endif
ifeq ($(NEED_PCI), yes)
+ifeq ($(OS_ARCH), Windows_NT)
+else
CHECK_LIBPCI = yes
endif
+endif
ifeq ($(NEED_PCI), yes)
FEATURE_CFLAGS += -D'NEED_PCI=1'
@@ -227,10 +230,14 @@
# FIXME There needs to be a better way to do this
LIBS += ../libpci/lib/libpci.a ../libgetopt/libgetopt.a
else
+ifeq ($(OS_ARCH), Windows_NT)
+LIBS += -L. -ldirectio
+else
LIBS += -lpci
endif
endif
endif
+endif
ifeq ($(CONFIG_PRINT_WIKI), yes)
FEATURE_CFLAGS += -D'CONFIG_PRINT_WIKI=1'
===================================================================
@@ -101,6 +101,10 @@
To run flashrom.exe, download http://clio.rice.edu/djgpp/csdpmi7b.zip and
make sure CWSDPMI.EXE is in the current directory.
+To compile on Windows:
+ Make sure you use gcc for compilation. This can be specified with
+ make CC=gcc
+
Installation
------------
===================================================================
@@ -226,6 +226,12 @@
start = forward->forward;
start &= ~(getpagesize() - 1);
physunmap(table_area, BYTES_TO_MAP);
+#if defined (__MINGW32_VERSION)
+ /* For some reason MINGW/directio does not like
+ * mapping the high table area yet
+ */
+ lb_table=NULL;
+#else
table_area = physmap_try_ro("high tables", start, BYTES_TO_MAP);
if (!table_area) {
msg_perr("Failed getting access to coreboot "
@@ -233,6 +239,7 @@
return -1;
}
lb_table = find_lb_table(table_area, 0x00000, 0x1000);
+#endif
}
}