diff --git a/qemu/include/qemu-common.h b/qemu/include/qemu-common.h index 4bb13fbd..57bbdf25 100644 --- a/qemu/include/qemu-common.h +++ b/qemu/include/qemu-common.h @@ -12,8 +12,7 @@ #ifndef QEMU_COMMON_H #define QEMU_COMMON_H -#include "qemu/compiler.h" -#include "config-host.h" +#include "qemu/osdep.h" #include "qemu/typedefs.h" #include "qemu/fprintf-fn.h" #include "exec/cpu-common.h" @@ -24,50 +23,9 @@ #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR) -/* we put basic includes here to avoid repeating them in device drivers */ -#include -#include -#include #include "unicorn/platform.h" -#include -#include -#include -#include -#include -#include -#include -#include #include "glib_compat.h" -#ifdef _WIN32 -#include "sysemu/os-win32.h" -#endif - -#ifndef O_LARGEFILE -#define O_LARGEFILE 0 -#endif -#ifndef O_BINARY -#define O_BINARY 0 -#endif -#ifndef MAP_ANONYMOUS -#define MAP_ANONYMOUS MAP_ANON -#endif -#ifndef ENOMEDIUM -#define ENOMEDIUM ENODEV -#endif -#if !defined(ENOTSUP) -#define ENOTSUP 4096 -#endif -#if !defined(ECANCELED) -#define ECANCELED 4097 -#endif -#if !defined(EMEDIUMTYPE) -#define EMEDIUMTYPE 4098 -#endif -#ifndef TIME_MAX -#define TIME_MAX LONG_MAX -#endif - /* HOST_LONG_BITS is the size of a native pointer in bits. */ #if UINTPTR_MAX == UINT32_MAX # define HOST_LONG_BITS 32 @@ -77,7 +35,6 @@ # error Unknown pointer size #endif -#include "qemu/osdep.h" #include "qemu/bswap.h" /* FIXME: Remove NEED_CPU_H. */ diff --git a/qemu/include/qemu/osdep.h b/qemu/include/qemu/osdep.h index 280e0e5f..2ffa822f 100644 --- a/qemu/include/qemu/osdep.h +++ b/qemu/include/qemu/osdep.h @@ -6,6 +6,22 @@ #include #include "unicorn/platform.h" #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #ifdef __OpenBSD__ #include #endif @@ -17,6 +33,10 @@ #define WEXITSTATUS(x) (x) #endif +#ifdef _WIN32 +#include "sysemu/os-win32.h" +#endif + #if defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10 /* [u]int_fast*_t not in */ typedef unsigned char uint_fast8_t; @@ -24,6 +44,31 @@ typedef unsigned int uint_fast16_t; typedef signed int int_fast16_t; #endif +#ifndef O_LARGEFILE +#define O_LARGEFILE 0 +#endif +#ifndef O_BINARY +#define O_BINARY 0 +#endif +#ifndef MAP_ANONYMOUS +#define MAP_ANONYMOUS MAP_ANON +#endif +#ifndef ENOMEDIUM +#define ENOMEDIUM ENODEV +#endif +#if !defined(ENOTSUP) +#define ENOTSUP 4096 +#endif +#if !defined(ECANCELED) +#define ECANCELED 4097 +#endif +#if !defined(EMEDIUMTYPE) +#define EMEDIUMTYPE 4098 +#endif +#ifndef TIME_MAX +#define TIME_MAX LONG_MAX +#endif + #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif