@@ -21,13 +21,3 @@ int hax_sync_vcpus(void)
{
return 0;
}
-
-int hax_init_vcpu(CPUState *cpu)
-{
- return -ENOSYS;
-}
-
-int hax_smp_cpu_exec(CPUState *cpu)
-{
- return -ENOSYS;
-}
@@ -22,29 +22,12 @@
#ifndef QEMU_HAX_H
#define QEMU_HAX_H
-
int hax_sync_vcpus(void);
-int hax_init_vcpu(CPUState *cpu);
-int hax_smp_cpu_exec(CPUState *cpu);
-int hax_populate_ram(uint64_t va, uint64_t size);
-
-void hax_cpu_synchronize_state(CPUState *cpu);
-void hax_cpu_synchronize_post_reset(CPUState *cpu);
-void hax_cpu_synchronize_post_init(CPUState *cpu);
-void hax_cpu_synchronize_pre_loadvm(CPUState *cpu);
#ifdef CONFIG_HAX
int hax_enabled(void);
-#include "qemu/bitops.h"
-#include "exec/memory.h"
-int hax_vcpu_destroy(CPUState *cpu);
-void hax_raise_event(CPUState *cpu);
-void hax_reset_vcpu_state(void *opaque);
-#include "target/i386/hax-interface.h"
-#include "target/i386/hax-i386.h"
-
#else /* CONFIG_HAX */
#define hax_enabled() (0)
@@ -28,13 +28,13 @@
#include "exec/address-spaces.h"
#include "qemu-common.h"
-#include "hax-i386.h"
#include "sysemu/accel.h"
#include "sysemu/reset.h"
#include "sysemu/runstate.h"
#include "hw/boards.h"
#include "hax-cpus.h"
+#include "hax-int.h"
#define DEBUG_HAX 0
@@ -22,12 +22,12 @@
#include "qemu/osdep.h"
#include "qemu/error-report.h"
#include "qemu/main-loop.h"
-#include "hax-i386.h"
#include "sysemu/runstate.h"
#include "sysemu/cpus.h"
#include "qemu/guest-random.h"
#include "hax-cpus.h"
+#include "hax-int.h"
static void *hax_cpu_thread_fn(void *arg)
{
new file mode 100644
@@ -0,0 +1,40 @@
+/*
+ * QEMU HAXM support
+ *
+ * Copyright IBM, Corp. 2008
+ *
+ * Authors:
+ * Anthony Liguori <aliguori@us.ibm.com>
+ *
+ * Copyright (c) 2011 Intel Corporation
+ * Written by:
+ * Jiang Yunhong<yunhong.jiang@intel.com>
+ * Xin Xiaohui<xiaohui.xin@intel.com>
+ * Zhang Xiantao<xiantao.zhang@intel.com>
+ *
+ * Copyright 2016 Google, Inc.
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+#ifndef HAX_INT_H
+#define HAX_INT_H
+
+#include "hax-interface.h"
+#include "hax-i386.h"
+
+int hax_init_vcpu(CPUState *cpu);
+int hax_smp_cpu_exec(CPUState *cpu);
+int hax_populate_ram(uint64_t va, uint64_t size);
+
+void hax_cpu_synchronize_state(CPUState *cpu);
+void hax_cpu_synchronize_post_reset(CPUState *cpu);
+void hax_cpu_synchronize_post_init(CPUState *cpu);
+void hax_cpu_synchronize_pre_loadvm(CPUState *cpu);
+
+int hax_vcpu_destroy(CPUState *cpu);
+void hax_raise_event(CPUState *cpu);
+void hax_reset_vcpu_state(void *opaque);
+
+#endif /* HAX_INT_H */
@@ -13,7 +13,7 @@
#include "exec/address-spaces.h"
#include "qemu/error-report.h"
-#include "target/i386/hax-i386.h"
+#include "hax-int.h"
#include "qemu/queue.h"
#define DEBUG_HAX_MEM 0
@@ -14,9 +14,8 @@
#include "qemu/osdep.h"
#include <sys/ioctl.h>
-#include "target/i386/hax-i386.h"
-
#include "sysemu/cpus.h"
+#include "hax-int.h"
hax_fd hax_mod_open(void)
{
@@ -12,7 +12,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
-#include "hax-i386.h"
+#include "hax-int.h"
/*
* return 0 when success, -1 when driver not loaded,
@@ -23,6 +23,8 @@
#include <winioctl.h>
#include <windef.h>
+#include "hax-int.h"
+
#define HAX_INVALID_FD INVALID_HANDLE_VALUE
static inline void hax_mod_close(struct hax_state *hax)
Signed-off-by: Claudio Fontana <cfontana@suse.de> --- accel/stubs/hax-stub.c | 10 ---------- include/sysemu/hax.h | 17 ----------------- target/i386/hax-all.c | 2 +- target/i386/hax-cpus.c | 2 +- target/i386/hax-int.h | 41 +++++++++++++++++++++++++++++++++++++++++ target/i386/hax-mem.c | 2 +- target/i386/hax-posix.c | 3 +-- target/i386/hax-windows.c | 2 +- target/i386/hax-windows.h | 2 ++ 9 files changed, 48 insertions(+), 33 deletions(-) create mode 100644 target/i386/hax-int.h