aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-07-29 10:44:41 +0300
committerAvi Kivity <avi@redhat.com>2009-07-29 10:44:41 +0300
commite8a1bd02da183143c796d7cae59a481f14edf0b6 (patch)
treef3b71b56a8681bd659861de31bd421b6b72140f7
parentMerge commit '8fde6546fbe5a63df584819b1279086030e410a9' into upstream-merge (diff)
parentchange HOST_SOLARIS to CONFIG_SOLARIS{_VERSION} (diff)
downloadqemu-kvm-e8a1bd02da183143c796d7cae59a481f14edf0b6.tar.gz
qemu-kvm-e8a1bd02da183143c796d7cae59a481f14edf0b6.tar.bz2
qemu-kvm-e8a1bd02da183143c796d7cae59a481f14edf0b6.zip
Merge commit 'dfe5fff3eaab1285cd1565fa0a33e5acd13b279c' into upstream-merge
* commit 'dfe5fff3eaab1285cd1565fa0a33e5acd13b279c': change HOST_SOLARIS to CONFIG_SOLARIS{_VERSION} Enable USE_DIRECT_JUMP on Win32. Remove special Win32 code in vl.c that's no longer needed. Remove setvbuf(<handle>, NULL, _IOLBF, 0) calls for Win32 Conflicts: cpu-exec.c Signed-off-by: Avi Kivity <avi@redhat.com>
-rwxr-xr-xconfigure3
-rw-r--r--cpu-exec.c10
-rw-r--r--dyngen-exec.h2
-rw-r--r--exec-all.h5
-rw-r--r--exec.c3
-rw-r--r--fpu/softfloat-native.c13
-rw-r--r--fpu/softfloat-native.h9
-rw-r--r--fpu/softfloat.h2
-rw-r--r--kqemu.c2
-rw-r--r--osdep.c6
-rw-r--r--target-mips/cpu.h2
-rw-r--r--tcg/sparc/tcg-target.h2
-rw-r--r--vl.c7
13 files changed, 34 insertions, 32 deletions
diff --git a/configure b/configure
index 951069c9c..158b2ba5d 100755
--- a/configure
+++ b/configure
@@ -1727,7 +1727,8 @@ fi
if test "$solaris" = "yes" ; then
echo "CONFIG_SOLARIS=y" >> $config_host_mak
- echo "#define HOST_SOLARIS $solarisrev" >> $config_host_h
+ echo "#define CONFIG_SOLARIS 1" >> $config_host_h
+ echo "#define CONFIG_SOLARIS_VERSION $solarisrev" >> $config_host_h
if test "$needs_libsunmath" = "yes" ; then
echo "NEEDS_LIBSUNMATH=yes" >> $config_host_mak
echo "#define NEEDS_LIBSUNMATH 1" >> $config_host_h
diff --git a/cpu-exec.c b/cpu-exec.c
index e6709dc3a..1bc367396 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -42,7 +42,7 @@
#include "qemu-kvm.h"
-#if defined(__sparc__) && !defined(HOST_SOLARIS)
+#if defined(__sparc__) && !defined(CONFIG_SOLARIS)
// Work around ugly bugs in glibc that mangle global register contents
#undef env
#define env cpu_single_env
@@ -263,7 +263,7 @@ int cpu_exec(CPUState *env1)
/* prepare setjmp context for exception handling */
for(;;) {
if (setjmp(env->jmp_env) == 0) {
-#if defined(__sparc__) && !defined(HOST_SOLARIS)
+#if defined(__sparc__) && !defined(CONFIG_SOLARIS)
#undef env
env = cpu_single_env;
#define env cpu_single_env
@@ -421,7 +421,7 @@ int cpu_exec(CPUState *env1)
env->interrupt_request &= ~(CPU_INTERRUPT_HARD | CPU_INTERRUPT_VIRQ);
intno = cpu_get_pic_interrupt(env);
qemu_log_mask(CPU_LOG_TB_IN_ASM, "Servicing hardware INT=0x%02x\n", intno);
-#if defined(__sparc__) && !defined(HOST_SOLARIS)
+#if defined(__sparc__) && !defined(CONFIG_SOLARIS)
#undef env
env = cpu_single_env;
#define env cpu_single_env
@@ -651,7 +651,7 @@ int cpu_exec(CPUState *env1)
while (env->current_tb) {
tc_ptr = tb->tc_ptr;
/* execute the generated code */
-#if defined(__sparc__) && !defined(HOST_SOLARIS)
+#if defined(__sparc__) && !defined(CONFIG_SOLARIS)
#undef env
env = cpu_single_env;
#define env cpu_single_env
@@ -1443,7 +1443,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
siginfo_t *info = pinfo;
int is_write;
uint32_t insn;
-#if !defined(__arch64__) || defined(HOST_SOLARIS)
+#if !defined(__arch64__) || defined(CONFIG_SOLARIS)
uint32_t *regs = (uint32_t *)(info + 1);
void *sigmask = (regs + 20);
/* XXX: is there a standard glibc define ? */
diff --git a/dyngen-exec.h b/dyngen-exec.h
index c0077634e..c1072cdcc 100644
--- a/dyngen-exec.h
+++ b/dyngen-exec.h
@@ -75,7 +75,7 @@ extern int printf(const char *, ...);
#define AREG1 "s0"
#define AREG2 "s1"
#elif defined(__sparc__)
-#ifdef HOST_SOLARIS
+#ifdef CONFIG_SOLARIS
#define AREG0 "g2"
#define AREG1 "g3"
#define AREG2 "g4"
diff --git a/exec-all.h b/exec-all.h
index 31ab7ad93..c7a1e70b2 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -114,10 +114,7 @@ static inline int tlb_set_page(CPUState *env1, target_ulong vaddr,
#define CODE_GEN_AVG_BLOCK_SIZE 64
#endif
-#if defined(_ARCH_PPC) || defined(__x86_64__) || defined(__arm__)
-#define USE_DIRECT_JUMP
-#endif
-#if defined(__i386__) && !defined(_WIN32)
+#if defined(_ARCH_PPC) || defined(__x86_64__) || defined(__arm__) || defined(__i386__)
#define USE_DIRECT_JUMP
#endif
diff --git a/exec.c b/exec.c
index 2134697ba..fb4efb89c 100644
--- a/exec.c
+++ b/exec.c
@@ -1508,7 +1508,8 @@ void cpu_set_log(int log_flags)
static char logfile_buf[4096];
setvbuf(logfile, logfile_buf, _IOLBF, sizeof(logfile_buf));
}
-#else
+#elif !defined(_WIN32)
+ /* Win32 doesn't support line-buffering and requires size >= 2 */
setvbuf(logfile, NULL, _IOLBF, 0);
#endif
log_append = 1;
diff --git a/fpu/softfloat-native.c b/fpu/softfloat-native.c
index 2af07a3f8..957698483 100644
--- a/fpu/softfloat-native.c
+++ b/fpu/softfloat-native.c
@@ -2,7 +2,7 @@
context is supported */
#include "softfloat.h"
#include <math.h>
-#if defined(HOST_SOLARIS)
+#if defined(CONFIG_SOLARIS)
#include <fenv.h>
#endif
@@ -10,7 +10,7 @@ void set_float_rounding_mode(int val STATUS_PARAM)
{
STATUS(float_rounding_mode) = val;
#if defined(HOST_BSD) && !defined(__APPLE__) || \
- (defined(HOST_SOLARIS) && HOST_SOLARIS < 10)
+ (defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10)
fpsetround(val);
#elif defined(__arm__)
/* nothing to do */
@@ -26,7 +26,8 @@ void set_floatx80_rounding_precision(int val STATUS_PARAM)
}
#endif
-#if defined(HOST_BSD) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10)
+#if defined(HOST_BSD) || \
+ (defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10)
#define lrint(d) ((int32_t)rint(d))
#define llrint(d) ((int64_t)rint(d))
#define lrintf(f) ((int32_t)rint(f))
@@ -34,7 +35,8 @@ void set_floatx80_rounding_precision(int val STATUS_PARAM)
#define sqrtf(f) ((float)sqrt(f))
#define remainderf(fa, fb) ((float)remainder(fa, fb))
#define rintf(f) ((float)rint(f))
-#if !defined(__sparc__) && defined(HOST_SOLARIS) && HOST_SOLARIS < 10
+#if !defined(__sparc__) && \
+ (defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10)
extern long double rintl(long double);
extern long double scalbnl(long double, int);
@@ -349,7 +351,8 @@ uint64_t float64_to_uint64_round_to_zero (float64 a STATUS_PARAM)
/*----------------------------------------------------------------------------
| Software IEC/IEEE double-precision operations.
*----------------------------------------------------------------------------*/
-#if defined(__sun__) && defined(HOST_SOLARIS) && HOST_SOLARIS < 10
+#if defined(__sun__) && \
+ (defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10)
static inline float64 trunc(float64 x)
{
return x < 0 ? -floor(-x) : floor(x);
diff --git a/fpu/softfloat-native.h b/fpu/softfloat-native.h
index a28c76947..839e5b156 100644
--- a/fpu/softfloat-native.h
+++ b/fpu/softfloat-native.h
@@ -1,7 +1,7 @@
/* Native implementation of soft float functions */
#include <math.h>
-#if (defined(HOST_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS)
+#if (defined(HOST_BSD) && !defined(__APPLE__)) || defined(CONFIG_SOLARIS)
#include <ieeefp.h>
#define fabsf(f) ((float)fabs(f))
#else
@@ -19,8 +19,9 @@
* Solaris 10 with GCC4 does not need these macros as they
* are defined in <iso/math_c99.h> with a compiler directive
*/
-#if defined(HOST_SOLARIS) && (( HOST_SOLARIS <= 9 ) || ((HOST_SOLARIS >= 10) \
- && (__GNUC__ < 4))) \
+#if defined(CONFIG_SOLARIS) && \
+ ((CONFIG_SOLARIS_VERSION <= 9 ) || \
+ ((CONFIG_SOLARIS_VERSION >= 10) && (__GNUC__ < 4))) \
|| (defined(__OpenBSD__) && (OpenBSD < 200811))
/*
* C99 7.12.3 classification macros
@@ -111,7 +112,7 @@ typedef union {
/*----------------------------------------------------------------------------
| Software IEC/IEEE floating-point rounding mode.
*----------------------------------------------------------------------------*/
-#if (defined(HOST_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS)
+#if (defined(HOST_BSD) && !defined(__APPLE__)) || defined(CONFIG_SOLARIS)
#if defined(__OpenBSD__)
#define FE_RM FP_RM
#define FE_RP FP_RP
diff --git a/fpu/softfloat.h b/fpu/softfloat.h
index 850a01f08..b9537c144 100644
--- a/fpu/softfloat.h
+++ b/fpu/softfloat.h
@@ -32,7 +32,7 @@ these four paragraphs for those parts of this code that are retained.
#ifndef SOFTFLOAT_H
#define SOFTFLOAT_H
-#if defined(HOST_SOLARIS) && defined(NEEDS_LIBSUNMATH)
+#if defined(CONFIG_SOLARIS) && defined(NEEDS_LIBSUNMATH)
#include <sunmath.h>
#endif
diff --git a/kqemu.c b/kqemu.c
index 825c0f13f..5611bc894 100644
--- a/kqemu.c
+++ b/kqemu.c
@@ -25,7 +25,7 @@
#include <sys/mman.h>
#include <sys/ioctl.h>
#endif
-#ifdef HOST_SOLARIS
+#ifdef CONFIG_SOLARIS
#include <sys/ioccom.h>
#endif
#include <stdlib.h>
diff --git a/osdep.c b/osdep.c
index f37c22ca2..8c74bf756 100644
--- a/osdep.c
+++ b/osdep.c
@@ -28,7 +28,7 @@
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
-#ifdef HOST_SOLARIS
+#ifdef CONFIG_SOLARIS
#include <sys/types.h>
#include <sys/statvfs.h>
#endif
@@ -116,7 +116,7 @@ static void *kqemu_vmalloc(size_t size)
int map_anon = 0;
const char *tmpdir;
char phys_ram_file[1024];
-#ifdef HOST_SOLARIS
+#ifdef CONFIG_SOLARIS
struct statvfs stfs;
#else
struct statfs stfs;
@@ -129,7 +129,7 @@ static void *kqemu_vmalloc(size_t size)
if (phys_ram_fd < 0) {
tmpdir = getenv("QEMU_TMPDIR");
if (!tmpdir)
-#ifdef HOST_SOLARIS
+#ifdef CONFIG_SOLARIS
tmpdir = "/tmp";
if (statvfs(tmpdir, &stfs) == 0) {
#else
diff --git a/target-mips/cpu.h b/target-mips/cpu.h
index bb9a49b98..5115cd6fc 100644
--- a/target-mips/cpu.h
+++ b/target-mips/cpu.h
@@ -14,7 +14,7 @@
// uint_fast8_t and uint_fast16_t not in <sys/int_types.h>
// XXX: move that elsewhere
-#if defined(HOST_SOLARIS) && HOST_SOLARIS < 10
+#if defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10
typedef unsigned char uint_fast8_t;
typedef unsigned int uint_fast16_t;
#endif
diff --git a/tcg/sparc/tcg-target.h b/tcg/sparc/tcg-target.h
index 97f353305..e8f8f65ee 100644
--- a/tcg/sparc/tcg-target.h
+++ b/tcg/sparc/tcg-target.h
@@ -95,7 +95,7 @@ enum {
/* Note: must be synced with dyngen-exec.h and Makefile.target */
-#ifdef HOST_SOLARIS
+#ifdef CONFIG_SOLARIS
#define TCG_AREG0 TCG_REG_G2
#define TCG_AREG1 TCG_REG_G3
#define TCG_AREG2 TCG_REG_G4
diff --git a/vl.c b/vl.c
index 50de511ad..ffe6a5f77 100644
--- a/vl.c
+++ b/vl.c
@@ -108,11 +108,7 @@
#ifdef _WIN32
#include <windows.h>
-#include <malloc.h>
-#include <sys/timeb.h>
#include <mmsystem.h>
-#define getopt_long_only getopt_long
-#define memalign(align, size) malloc(size)
#endif
#ifdef CONFIG_SDL
@@ -5873,7 +5869,10 @@ int main(int argc, char **argv, char **envp)
exit(1);
}
+#ifndef _WIN32
+ /* Win32 doesn't support line-buffering and requires size >= 2 */
setvbuf(stdout, NULL, _IOLBF, 0);
+#endif
init_timers();
if (init_timer_alarm() < 0) {