sync with latest
[sdk/emulator/qemu.git] / hax.h
1 /*
2  * QEMU HAXM support
3  *
4  * Copyright IBM, Corp. 2008
5  *
6  * Authors:
7  *  Anthony Liguori   <aliguori@us.ibm.com>
8  * 
9  * Copyright (c) 2011 Intel Corporation
10  *  Written by:
11  *  Jiang Yunhong<yunhong.jiang@intel.com>
12  *  Xin Xiaohui<xiaohui.xin@intel.com>
13  *  Zhang Xiantao<xiantao.zhang@intel.com>
14  *
15  * This work is licensed under the terms of the GNU GPL, version 2 or later.
16  *
17  */
18
19 /* header to be included in non-HAX-specific code */
20 #ifndef _HAX_H
21 #define _HAX_H
22
23 #include "config-host.h"
24 #include "qemu-common.h"
25
26 #define dprint  printf
27 #ifdef CONFIG_HAX_BACKEND
28 int hax_enabled(void);
29 void hax_disable(int disable);
30 int hax_pre_init(uint64_t ram_size);
31 int hax_accel_init(void);
32 int hax_sync_vcpus(void);
33
34 #ifdef CONFIG_HAX
35 //#include "cpu.h"
36 #include "kvm.h"
37 #include "hw/hw.h"
38 #include "bitops.h"
39 #include "memory.h"
40
41 int hax_init_vcpu(CPUArchState *env);
42 int hax_vcpu_exec(CPUArchState *env);
43 void hax_vcpu_sync_state(CPUArchState *env, int modified);
44 //extern void hax_cpu_synchronize_state(CPUArchState *env);
45 //extern void hax_cpu_synchronize_post_reset(CPUArchState *env);
46 //extern void hax_cpu_synchronize_post_init(CPUArchState *env);
47 int hax_populate_ram(uint64_t va, uint32_t size);
48 int hax_set_phys_mem(MemoryRegionSection *section);
49 int hax_vcpu_emulation_mode(CPUArchState *env);
50 int hax_stop_emulation(CPUArchState *env);
51 int hax_stop_translate(CPUArchState *env);
52 int hax_arch_get_registers(CPUArchState *env);
53 int hax_vcpu_destroy(CPUArchState *env);
54 void hax_raise_event(CPUArchState *env);
55 int need_handle_intr_request(CPUArchState *env);
56 int hax_handle_io(CPUArchState *env, uint32_t df, uint16_t port, int direction,
57                  int size, int count, void *buffer);
58 void hax_reset_vcpu_state(void *opaque);
59 #include "target-i386/hax-interface.h"
60 #include "target-i386/hax-i386.h"
61 #endif
62
63 #else
64
65 #define hax_enabled()            (0)
66 #define hax_sync_vcpus()
67 #define hax_accel_init()         (0)
68 #define hax_pre_init(x)
69
70 #endif
71
72 #endif