summaryrefslogtreecommitdiffstats
path: root/flash.h
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@coresystems.de>2010-01-06 22:14:39 +0000
committerPatrick Georgi <pgeorgi@google.com>2010-01-06 22:14:39 +0000
commite48654cf70f1c9c357b488f9506962c4485c46f5 (patch)
treec19518ff0f49d942db679016feff49a462bc63a3 /flash.h
parent3b6237dbce5149c565a134394c6184118629464d (diff)
downloadast2050-flashrom-e48654cf70f1c9c357b488f9506962c4485c46f5.zip
ast2050-flashrom-e48654cf70f1c9c357b488f9506962c4485c46f5.tar.gz
Buspiratespi support on mingw
Corresponding to flashrom svn r832. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'flash.h')
-rw-r--r--flash.h15
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
+#endif
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;
+#else
+typedef int fdtype;
+#endif
+
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