aboutsummaryrefslogtreecommitdiff
path: root/vl.h
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-03-31 23:37:16 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-03-31 23:37:16 +0000
commit67b915a5dd52a05f8030cd9edc005effd9c8eea5 (patch)
tree247689b53ca52d7d9cb4fc9f7ff65f293b61e01a /vl.h
parentbb27c19087ff0847484c111cbaf56a3fa7103684 (diff)
win32 port (initial patch by kazu)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@692 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.h')
-rw-r--r--vl.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/vl.h b/vl.h
index 2805853a7e..afec99f88b 100644
--- a/vl.h
+++ b/vl.h
@@ -24,10 +24,79 @@
#ifndef VL_H
#define VL_H
+/* we put basic includes here to avoid repeating them in device drivers */
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <inttypes.h>
#include <time.h>
+#include <ctype.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#ifndef O_LARGEFILE
+#define O_LARGEFILE 0
+#endif
+
+#ifdef _WIN32
+#define lseek64 lseek
+#endif
#include "cpu.h"
+#ifndef glue
+#define xglue(x, y) x ## y
+#define glue(x, y) xglue(x, y)
+#define stringify(s) tostring(s)
+#define tostring(s) #s
+#endif
+
+#if defined(WORDS_BIGENDIAN)
+static inline uint32_t be32_to_cpu(uint32_t v)
+{
+ return v;
+}
+
+static inline uint16_t be16_to_cpu(uint16_t v)
+{
+ return v;
+}
+
+static inline uint32_t le32_to_cpu(uint32_t v)
+{
+ return bswap32(v);
+}
+
+static inline uint16_t le16_to_cpu(uint16_t v)
+{
+ return bswap16(v);
+}
+
+#else
+static inline uint32_t be32_to_cpu(uint32_t v)
+{
+ return bswap32(v);
+}
+
+static inline uint16_t be16_to_cpu(uint16_t v)
+{
+ return bswap16(v);
+}
+
+static inline uint32_t le32_to_cpu(uint32_t v)
+{
+ return v;
+}
+
+static inline uint16_t le16_to_cpu(uint16_t v)
+{
+ return v;
+}
+#endif
+
+
/* vl.c */
extern int reset_requested;