path: root/flash.h
diff options
authorPatrick Georgi <>2010-01-06 22:14:39 +0000
committerPatrick Georgi <>2010-01-06 22:14:39 +0000
commite48654cf70f1c9c357b488f9506962c4485c46f5 (patch)
treec19518ff0f49d942db679016feff49a462bc63a3 /flash.h
parent3b6237dbce5149c565a134394c6184118629464d (diff)
Buspiratespi support on mingw
Corresponding to flashrom svn r832. Signed-off-by: Patrick Georgi <> Acked-by: Carl-Daniel Hailfinger <>
Diffstat (limited to 'flash.h')
1 files changed, 13 insertions, 2 deletions
diff --git a/flash.h b/flash.h
index b47dcbc..b7b9aed 100644
--- a/flash.h
+++ b/flash.h
@@ -28,6 +28,11 @@
#include <stdint.h>
#include <stdio.h>
#include "hwaccess.h"
+#ifdef _WIN32
+#include <windows.h>
+#undef min
+#undef max
typedef unsigned long chipaddr;
@@ -591,10 +596,16 @@ void serprog_chip_readn(uint8_t *buf, const chipaddr addr, size_t len);
void serprog_delay(int delay);
/* serial.c */
+#if _WIN32
+typedef HANDLE fdtype;
+typedef int fdtype;
void sp_flush_incoming(void);
-int sp_openserport(char *dev, unsigned int baud);
+fdtype sp_openserport(char *dev, unsigned int baud);
void __attribute__((noreturn)) sp_die(char *msg);
-extern int sp_fd;
+extern fdtype sp_fd;
int serialport_shutdown(void);
int serialport_write(unsigned char *buf, unsigned int writecnt);
int serialport_read(unsigned char *buf, unsigned int readcnt);
OpenPOWER on IntegriCloud