Commit 640f42e4e9d55ef3aa48cc59e8bc8942ce946e1e
1 parent
ac611340
kqemu: merge CONFIG_KQEMU and USE_KQEMU
Basically a recursive ":%s/USE_KQEMU/CONFIG_KQEMU/g". Signed-off-by: Paul Bolle <pebolle@tiscali.nl> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7189 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
16 changed files
with
59 additions
and
59 deletions
configure
@@ -1770,7 +1770,7 @@ case "$target_cpu" in | @@ -1770,7 +1770,7 @@ case "$target_cpu" in | ||
1770 | if test $kqemu = "yes" -a "$target_softmmu" = "yes" | 1770 | if test $kqemu = "yes" -a "$target_softmmu" = "yes" |
1771 | then | 1771 | then |
1772 | echo "CONFIG_KQEMU=yes" >> $config_mak | 1772 | echo "CONFIG_KQEMU=yes" >> $config_mak |
1773 | - echo "#define USE_KQEMU 1" >> $config_h | 1773 | + echo "#define CONFIG_KQEMU 1" >> $config_h |
1774 | fi | 1774 | fi |
1775 | if test "$kvm" = "yes" ; then | 1775 | if test "$kvm" = "yes" ; then |
1776 | echo "CONFIG_KVM=yes" >> $config_mak | 1776 | echo "CONFIG_KVM=yes" >> $config_mak |
@@ -1786,7 +1786,7 @@ case "$target_cpu" in | @@ -1786,7 +1786,7 @@ case "$target_cpu" in | ||
1786 | if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" | 1786 | if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" |
1787 | then | 1787 | then |
1788 | echo "CONFIG_KQEMU=yes" >> $config_mak | 1788 | echo "CONFIG_KQEMU=yes" >> $config_mak |
1789 | - echo "#define USE_KQEMU 1" >> $config_h | 1789 | + echo "#define CONFIG_KQEMU 1" >> $config_h |
1790 | fi | 1790 | fi |
1791 | if test "$kvm" = "yes" ; then | 1791 | if test "$kvm" = "yes" ; then |
1792 | echo "CONFIG_KVM=yes" >> $config_mak | 1792 | echo "CONFIG_KVM=yes" >> $config_mak |
cpu-all.h
@@ -846,7 +846,7 @@ int cpu_inl(CPUState *env, int addr); | @@ -846,7 +846,7 @@ int cpu_inl(CPUState *env, int addr); | ||
846 | #endif | 846 | #endif |
847 | 847 | ||
848 | /* address in the RAM (different from a physical address) */ | 848 | /* address in the RAM (different from a physical address) */ |
849 | -#ifdef USE_KQEMU | 849 | +#ifdef CONFIG_KQEMU |
850 | typedef uint32_t ram_addr_t; | 850 | typedef uint32_t ram_addr_t; |
851 | #else | 851 | #else |
852 | typedef unsigned long ram_addr_t; | 852 | typedef unsigned long ram_addr_t; |
cpu-exec.c
@@ -314,7 +314,7 @@ int cpu_exec(CPUState *env1) | @@ -314,7 +314,7 @@ int cpu_exec(CPUState *env1) | ||
314 | } | 314 | } |
315 | env->exception_index = -1; | 315 | env->exception_index = -1; |
316 | } | 316 | } |
317 | -#ifdef USE_KQEMU | 317 | +#ifdef CONFIG_KQEMU |
318 | if (kqemu_is_ok(env) && env->interrupt_request == 0 && env->exit_request == 0) { | 318 | if (kqemu_is_ok(env) && env->interrupt_request == 0 && env->exit_request == 0) { |
319 | int ret; | 319 | int ret; |
320 | env->eflags = env->eflags | helper_cc_compute_all(CC_OP) | (DF & DF_MASK); | 320 | env->eflags = env->eflags | helper_cc_compute_all(CC_OP) | (DF & DF_MASK); |
@@ -594,7 +594,7 @@ int cpu_exec(CPUState *env1) | @@ -594,7 +594,7 @@ int cpu_exec(CPUState *env1) | ||
594 | jump. */ | 594 | jump. */ |
595 | { | 595 | { |
596 | if (next_tb != 0 && | 596 | if (next_tb != 0 && |
597 | -#ifdef USE_KQEMU | 597 | +#ifdef CONFIG_KQEMU |
598 | (env->kqemu_enabled != 2) && | 598 | (env->kqemu_enabled != 2) && |
599 | #endif | 599 | #endif |
600 | tb->page_addr[1] == -1) { | 600 | tb->page_addr[1] == -1) { |
@@ -651,7 +651,7 @@ int cpu_exec(CPUState *env1) | @@ -651,7 +651,7 @@ int cpu_exec(CPUState *env1) | ||
651 | } | 651 | } |
652 | /* reset soft MMU for next block (it can currently | 652 | /* reset soft MMU for next block (it can currently |
653 | only be set by a memory fault) */ | 653 | only be set by a memory fault) */ |
654 | -#if defined(USE_KQEMU) | 654 | +#if defined(CONFIG_KQEMU) |
655 | #define MIN_CYCLE_BEFORE_SWITCH (100 * 1000) | 655 | #define MIN_CYCLE_BEFORE_SWITCH (100 * 1000) |
656 | if (kqemu_is_ok(env) && | 656 | if (kqemu_is_ok(env) && |
657 | (cpu_get_time_fast() - env->last_io_time) >= MIN_CYCLE_BEFORE_SWITCH) { | 657 | (cpu_get_time_fast() - env->last_io_time) >= MIN_CYCLE_BEFORE_SWITCH) { |
exec-all.h
@@ -352,7 +352,7 @@ static inline int can_do_io(CPUState *env) | @@ -352,7 +352,7 @@ static inline int can_do_io(CPUState *env) | ||
352 | } | 352 | } |
353 | #endif | 353 | #endif |
354 | 354 | ||
355 | -#ifdef USE_KQEMU | 355 | +#ifdef CONFIG_KQEMU |
356 | #define KQEMU_MODIFY_PAGE_MASK (0xff & ~(VGA_DIRTY_FLAG | CODE_DIRTY_FLAG)) | 356 | #define KQEMU_MODIFY_PAGE_MASK (0xff & ~(VGA_DIRTY_FLAG | CODE_DIRTY_FLAG)) |
357 | 357 | ||
358 | #define MSR_QPI_COMMBASE 0xfabe0010 | 358 | #define MSR_QPI_COMMBASE 0xfabe0010 |
exec.c
@@ -71,9 +71,9 @@ | @@ -71,9 +71,9 @@ | ||
71 | #define TARGET_VIRT_ADDR_SPACE_BITS 42 | 71 | #define TARGET_VIRT_ADDR_SPACE_BITS 42 |
72 | #elif defined(TARGET_PPC64) | 72 | #elif defined(TARGET_PPC64) |
73 | #define TARGET_PHYS_ADDR_SPACE_BITS 42 | 73 | #define TARGET_PHYS_ADDR_SPACE_BITS 42 |
74 | -#elif defined(TARGET_X86_64) && !defined(USE_KQEMU) | 74 | +#elif defined(TARGET_X86_64) && !defined(CONFIG_KQEMU) |
75 | #define TARGET_PHYS_ADDR_SPACE_BITS 42 | 75 | #define TARGET_PHYS_ADDR_SPACE_BITS 42 |
76 | -#elif defined(TARGET_I386) && !defined(USE_KQEMU) | 76 | +#elif defined(TARGET_I386) && !defined(CONFIG_KQEMU) |
77 | #define TARGET_PHYS_ADDR_SPACE_BITS 36 | 77 | #define TARGET_PHYS_ADDR_SPACE_BITS 36 |
78 | #else | 78 | #else |
79 | /* Note: for compatibility with kqemu, we use 32 bits for x86_64 */ | 79 | /* Note: for compatibility with kqemu, we use 32 bits for x86_64 */ |
@@ -1760,7 +1760,7 @@ void tlb_flush(CPUState *env, int flush_global) | @@ -1760,7 +1760,7 @@ void tlb_flush(CPUState *env, int flush_global) | ||
1760 | 1760 | ||
1761 | memset (env->tb_jmp_cache, 0, TB_JMP_CACHE_SIZE * sizeof (void *)); | 1761 | memset (env->tb_jmp_cache, 0, TB_JMP_CACHE_SIZE * sizeof (void *)); |
1762 | 1762 | ||
1763 | -#ifdef USE_KQEMU | 1763 | +#ifdef CONFIG_KQEMU |
1764 | if (env->kqemu_enabled) { | 1764 | if (env->kqemu_enabled) { |
1765 | kqemu_flush(env, flush_global); | 1765 | kqemu_flush(env, flush_global); |
1766 | } | 1766 | } |
@@ -1809,7 +1809,7 @@ void tlb_flush_page(CPUState *env, target_ulong addr) | @@ -1809,7 +1809,7 @@ void tlb_flush_page(CPUState *env, target_ulong addr) | ||
1809 | 1809 | ||
1810 | tlb_flush_jmp_cache(env, addr); | 1810 | tlb_flush_jmp_cache(env, addr); |
1811 | 1811 | ||
1812 | -#ifdef USE_KQEMU | 1812 | +#ifdef CONFIG_KQEMU |
1813 | if (env->kqemu_enabled) { | 1813 | if (env->kqemu_enabled) { |
1814 | kqemu_flush_page(env, addr); | 1814 | kqemu_flush_page(env, addr); |
1815 | } | 1815 | } |
@@ -1861,7 +1861,7 @@ void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t end, | @@ -1861,7 +1861,7 @@ void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t end, | ||
1861 | if (length == 0) | 1861 | if (length == 0) |
1862 | return; | 1862 | return; |
1863 | len = length >> TARGET_PAGE_BITS; | 1863 | len = length >> TARGET_PAGE_BITS; |
1864 | -#ifdef USE_KQEMU | 1864 | +#ifdef CONFIG_KQEMU |
1865 | /* XXX: should not depend on cpu context */ | 1865 | /* XXX: should not depend on cpu context */ |
1866 | env = first_cpu; | 1866 | env = first_cpu; |
1867 | if (env->kqemu_enabled) { | 1867 | if (env->kqemu_enabled) { |
@@ -2328,7 +2328,7 @@ void cpu_register_physical_memory_offset(target_phys_addr_t start_addr, | @@ -2328,7 +2328,7 @@ void cpu_register_physical_memory_offset(target_phys_addr_t start_addr, | ||
2328 | ram_addr_t orig_size = size; | 2328 | ram_addr_t orig_size = size; |
2329 | void *subpage; | 2329 | void *subpage; |
2330 | 2330 | ||
2331 | -#ifdef USE_KQEMU | 2331 | +#ifdef CONFIG_KQEMU |
2332 | /* XXX: should not depend on cpu context */ | 2332 | /* XXX: should not depend on cpu context */ |
2333 | env = first_cpu; | 2333 | env = first_cpu; |
2334 | if (env->kqemu_enabled) { | 2334 | if (env->kqemu_enabled) { |
@@ -2429,7 +2429,7 @@ void qemu_unregister_coalesced_mmio(target_phys_addr_t addr, ram_addr_t size) | @@ -2429,7 +2429,7 @@ void qemu_unregister_coalesced_mmio(target_phys_addr_t addr, ram_addr_t size) | ||
2429 | kvm_uncoalesce_mmio_region(addr, size); | 2429 | kvm_uncoalesce_mmio_region(addr, size); |
2430 | } | 2430 | } |
2431 | 2431 | ||
2432 | -#ifdef USE_KQEMU | 2432 | +#ifdef CONFIG_KQEMU |
2433 | /* XXX: better than nothing */ | 2433 | /* XXX: better than nothing */ |
2434 | static ram_addr_t kqemu_ram_alloc(ram_addr_t size) | 2434 | static ram_addr_t kqemu_ram_alloc(ram_addr_t size) |
2435 | { | 2435 | { |
@@ -2449,7 +2449,7 @@ ram_addr_t qemu_ram_alloc(ram_addr_t size) | @@ -2449,7 +2449,7 @@ ram_addr_t qemu_ram_alloc(ram_addr_t size) | ||
2449 | { | 2449 | { |
2450 | RAMBlock *new_block; | 2450 | RAMBlock *new_block; |
2451 | 2451 | ||
2452 | -#ifdef USE_KQEMU | 2452 | +#ifdef CONFIG_KQEMU |
2453 | if (kqemu_phys_ram_base) { | 2453 | if (kqemu_phys_ram_base) { |
2454 | return kqemu_ram_alloc(size); | 2454 | return kqemu_ram_alloc(size); |
2455 | } | 2455 | } |
@@ -2494,7 +2494,7 @@ void *qemu_get_ram_ptr(ram_addr_t addr) | @@ -2494,7 +2494,7 @@ void *qemu_get_ram_ptr(ram_addr_t addr) | ||
2494 | RAMBlock **prevp; | 2494 | RAMBlock **prevp; |
2495 | RAMBlock *block; | 2495 | RAMBlock *block; |
2496 | 2496 | ||
2497 | -#ifdef USE_KQEMU | 2497 | +#ifdef CONFIG_KQEMU |
2498 | if (kqemu_phys_ram_base) { | 2498 | if (kqemu_phys_ram_base) { |
2499 | return kqemu_phys_ram_base + addr; | 2499 | return kqemu_phys_ram_base + addr; |
2500 | } | 2500 | } |
@@ -2532,7 +2532,7 @@ ram_addr_t qemu_ram_addr_from_host(void *ptr) | @@ -2532,7 +2532,7 @@ ram_addr_t qemu_ram_addr_from_host(void *ptr) | ||
2532 | RAMBlock *block; | 2532 | RAMBlock *block; |
2533 | uint8_t *host = ptr; | 2533 | uint8_t *host = ptr; |
2534 | 2534 | ||
2535 | -#ifdef USE_KQEMU | 2535 | +#ifdef CONFIG_KQEMU |
2536 | if (kqemu_phys_ram_base) { | 2536 | if (kqemu_phys_ram_base) { |
2537 | return host - kqemu_phys_ram_base; | 2537 | return host - kqemu_phys_ram_base; |
2538 | } | 2538 | } |
@@ -2642,7 +2642,7 @@ static void notdirty_mem_writeb(void *opaque, target_phys_addr_t ram_addr, | @@ -2642,7 +2642,7 @@ static void notdirty_mem_writeb(void *opaque, target_phys_addr_t ram_addr, | ||
2642 | #endif | 2642 | #endif |
2643 | } | 2643 | } |
2644 | stb_p(qemu_get_ram_ptr(ram_addr), val); | 2644 | stb_p(qemu_get_ram_ptr(ram_addr), val); |
2645 | -#ifdef USE_KQEMU | 2645 | +#ifdef CONFIG_KQEMU |
2646 | if (cpu_single_env->kqemu_enabled && | 2646 | if (cpu_single_env->kqemu_enabled && |
2647 | (dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK) | 2647 | (dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK) |
2648 | kqemu_modify_page(cpu_single_env, ram_addr); | 2648 | kqemu_modify_page(cpu_single_env, ram_addr); |
@@ -2667,7 +2667,7 @@ static void notdirty_mem_writew(void *opaque, target_phys_addr_t ram_addr, | @@ -2667,7 +2667,7 @@ static void notdirty_mem_writew(void *opaque, target_phys_addr_t ram_addr, | ||
2667 | #endif | 2667 | #endif |
2668 | } | 2668 | } |
2669 | stw_p(qemu_get_ram_ptr(ram_addr), val); | 2669 | stw_p(qemu_get_ram_ptr(ram_addr), val); |
2670 | -#ifdef USE_KQEMU | 2670 | +#ifdef CONFIG_KQEMU |
2671 | if (cpu_single_env->kqemu_enabled && | 2671 | if (cpu_single_env->kqemu_enabled && |
2672 | (dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK) | 2672 | (dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK) |
2673 | kqemu_modify_page(cpu_single_env, ram_addr); | 2673 | kqemu_modify_page(cpu_single_env, ram_addr); |
@@ -2692,7 +2692,7 @@ static void notdirty_mem_writel(void *opaque, target_phys_addr_t ram_addr, | @@ -2692,7 +2692,7 @@ static void notdirty_mem_writel(void *opaque, target_phys_addr_t ram_addr, | ||
2692 | #endif | 2692 | #endif |
2693 | } | 2693 | } |
2694 | stl_p(qemu_get_ram_ptr(ram_addr), val); | 2694 | stl_p(qemu_get_ram_ptr(ram_addr), val); |
2695 | -#ifdef USE_KQEMU | 2695 | +#ifdef CONFIG_KQEMU |
2696 | if (cpu_single_env->kqemu_enabled && | 2696 | if (cpu_single_env->kqemu_enabled && |
2697 | (dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK) | 2697 | (dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK) |
2698 | kqemu_modify_page(cpu_single_env, ram_addr); | 2698 | kqemu_modify_page(cpu_single_env, ram_addr); |
@@ -2993,7 +2993,7 @@ static void io_mem_init(void) | @@ -2993,7 +2993,7 @@ static void io_mem_init(void) | ||
2993 | 2993 | ||
2994 | io_mem_watch = cpu_register_io_memory(0, watch_mem_read, | 2994 | io_mem_watch = cpu_register_io_memory(0, watch_mem_read, |
2995 | watch_mem_write, NULL); | 2995 | watch_mem_write, NULL); |
2996 | -#ifdef USE_KQEMU | 2996 | +#ifdef CONFIG_KQEMU |
2997 | if (kqemu_phys_ram_base) { | 2997 | if (kqemu_phys_ram_base) { |
2998 | /* alloc dirty bits array */ | 2998 | /* alloc dirty bits array */ |
2999 | phys_ram_dirty = qemu_vmalloc(kqemu_phys_ram_size >> TARGET_PAGE_BITS); | 2999 | phys_ram_dirty = qemu_vmalloc(kqemu_phys_ram_size >> TARGET_PAGE_BITS); |
hw/pc.c
@@ -85,7 +85,7 @@ uint64_t cpu_get_tsc(CPUX86State *env) | @@ -85,7 +85,7 @@ uint64_t cpu_get_tsc(CPUX86State *env) | ||
85 | /* Note: when using kqemu, it is more logical to return the host TSC | 85 | /* Note: when using kqemu, it is more logical to return the host TSC |
86 | because kqemu does not trap the RDTSC instruction for | 86 | because kqemu does not trap the RDTSC instruction for |
87 | performance reasons */ | 87 | performance reasons */ |
88 | -#ifdef USE_KQEMU | 88 | +#ifdef CONFIG_KQEMU |
89 | if (env->kqemu_enabled) { | 89 | if (env->kqemu_enabled) { |
90 | return cpu_get_real_ticks(); | 90 | return cpu_get_real_ticks(); |
91 | } else | 91 | } else |
kqemu.c
monitor.c
@@ -1368,7 +1368,7 @@ static void tlb_info(Monitor *mon) | @@ -1368,7 +1368,7 @@ static void tlb_info(Monitor *mon) | ||
1368 | 1368 | ||
1369 | static void do_info_kqemu(Monitor *mon) | 1369 | static void do_info_kqemu(Monitor *mon) |
1370 | { | 1370 | { |
1371 | -#ifdef USE_KQEMU | 1371 | +#ifdef CONFIG_KQEMU |
1372 | CPUState *env; | 1372 | CPUState *env; |
1373 | int val; | 1373 | int val; |
1374 | val = 0; | 1374 | val = 0; |
@@ -1445,7 +1445,7 @@ static void do_info_profile(Monitor *mon) | @@ -1445,7 +1445,7 @@ static void do_info_profile(Monitor *mon) | ||
1445 | kqemu_ret_int_count = 0; | 1445 | kqemu_ret_int_count = 0; |
1446 | kqemu_ret_excp_count = 0; | 1446 | kqemu_ret_excp_count = 0; |
1447 | kqemu_ret_intr_count = 0; | 1447 | kqemu_ret_intr_count = 0; |
1448 | -#ifdef USE_KQEMU | 1448 | +#ifdef CONFIG_KQEMU |
1449 | kqemu_record_dump(); | 1449 | kqemu_record_dump(); |
1450 | #endif | 1450 | #endif |
1451 | } | 1451 | } |
osdep.c
@@ -69,7 +69,7 @@ void qemu_vfree(void *ptr) | @@ -69,7 +69,7 @@ void qemu_vfree(void *ptr) | ||
69 | 69 | ||
70 | #else | 70 | #else |
71 | 71 | ||
72 | -#if defined(USE_KQEMU) | 72 | +#if defined(CONFIG_KQEMU) |
73 | 73 | ||
74 | #ifdef __OpenBSD__ | 74 | #ifdef __OpenBSD__ |
75 | #include <sys/param.h> | 75 | #include <sys/param.h> |
@@ -197,7 +197,7 @@ void *qemu_memalign(size_t alignment, size_t size) | @@ -197,7 +197,7 @@ void *qemu_memalign(size_t alignment, size_t size) | ||
197 | /* alloc shared memory pages */ | 197 | /* alloc shared memory pages */ |
198 | void *qemu_vmalloc(size_t size) | 198 | void *qemu_vmalloc(size_t size) |
199 | { | 199 | { |
200 | -#if defined(USE_KQEMU) | 200 | +#if defined(CONFIG_KQEMU) |
201 | if (kqemu_allowed) | 201 | if (kqemu_allowed) |
202 | return kqemu_vmalloc(size); | 202 | return kqemu_vmalloc(size); |
203 | #endif | 203 | #endif |
@@ -206,7 +206,7 @@ void *qemu_vmalloc(size_t size) | @@ -206,7 +206,7 @@ void *qemu_vmalloc(size_t size) | ||
206 | 206 | ||
207 | void qemu_vfree(void *ptr) | 207 | void qemu_vfree(void *ptr) |
208 | { | 208 | { |
209 | -#if defined(USE_KQEMU) | 209 | +#if defined(CONFIG_KQEMU) |
210 | if (kqemu_allowed) | 210 | if (kqemu_allowed) |
211 | kqemu_vfree(ptr); | 211 | kqemu_vfree(ptr); |
212 | #endif | 212 | #endif |
qemu-options.hx
@@ -1304,7 +1304,7 @@ STEXI | @@ -1304,7 +1304,7 @@ STEXI | ||
1304 | Set the filename for the BIOS. | 1304 | Set the filename for the BIOS. |
1305 | ETEXI | 1305 | ETEXI |
1306 | 1306 | ||
1307 | -#ifdef USE_KQEMU | 1307 | +#ifdef CONFIG_KQEMU |
1308 | DEF("kernel-kqemu", 0, QEMU_OPTION_kernel_kqemu, \ | 1308 | DEF("kernel-kqemu", 0, QEMU_OPTION_kernel_kqemu, \ |
1309 | "-kernel-kqemu enable KQEMU full virtualization (default is user mode only)\n") | 1309 | "-kernel-kqemu enable KQEMU full virtualization (default is user mode only)\n") |
1310 | #endif | 1310 | #endif |
@@ -1313,7 +1313,7 @@ STEXI | @@ -1313,7 +1313,7 @@ STEXI | ||
1313 | Enable KQEMU full virtualization (default is user mode only). | 1313 | Enable KQEMU full virtualization (default is user mode only). |
1314 | ETEXI | 1314 | ETEXI |
1315 | 1315 | ||
1316 | -#ifdef USE_KQEMU | 1316 | +#ifdef CONFIG_KQEMU |
1317 | DEF("no-kqemu", 0, QEMU_OPTION_no_kqemu, \ | 1317 | DEF("no-kqemu", 0, QEMU_OPTION_no_kqemu, \ |
1318 | "-no-kqemu disable KQEMU kernel module usage\n") | 1318 | "-no-kqemu disable KQEMU kernel module usage\n") |
1319 | #endif | 1319 | #endif |
softmmu_template.h
@@ -76,7 +76,7 @@ static inline DATA_TYPE glue(io_read, SUFFIX)(target_phys_addr_t physaddr, | @@ -76,7 +76,7 @@ static inline DATA_TYPE glue(io_read, SUFFIX)(target_phys_addr_t physaddr, | ||
76 | res |= (uint64_t)io_mem_read[index][2](io_mem_opaque[index], physaddr + 4) << 32; | 76 | res |= (uint64_t)io_mem_read[index][2](io_mem_opaque[index], physaddr + 4) << 32; |
77 | #endif | 77 | #endif |
78 | #endif /* SHIFT > 2 */ | 78 | #endif /* SHIFT > 2 */ |
79 | -#ifdef USE_KQEMU | 79 | +#ifdef CONFIG_KQEMU |
80 | env->last_io_time = cpu_get_time_fast(); | 80 | env->last_io_time = cpu_get_time_fast(); |
81 | #endif | 81 | #endif |
82 | return res; | 82 | return res; |
@@ -221,7 +221,7 @@ static inline void glue(io_write, SUFFIX)(target_phys_addr_t physaddr, | @@ -221,7 +221,7 @@ static inline void glue(io_write, SUFFIX)(target_phys_addr_t physaddr, | ||
221 | io_mem_write[index][2](io_mem_opaque[index], physaddr + 4, val >> 32); | 221 | io_mem_write[index][2](io_mem_opaque[index], physaddr + 4, val >> 32); |
222 | #endif | 222 | #endif |
223 | #endif /* SHIFT > 2 */ | 223 | #endif /* SHIFT > 2 */ |
224 | -#ifdef USE_KQEMU | 224 | +#ifdef CONFIG_KQEMU |
225 | env->last_io_time = cpu_get_time_fast(); | 225 | env->last_io_time = cpu_get_time_fast(); |
226 | #endif | 226 | #endif |
227 | } | 227 | } |
sysemu.h
@@ -104,7 +104,7 @@ extern int no_quit; | @@ -104,7 +104,7 @@ extern int no_quit; | ||
104 | extern int semihosting_enabled; | 104 | extern int semihosting_enabled; |
105 | extern int old_param; | 105 | extern int old_param; |
106 | 106 | ||
107 | -#ifdef USE_KQEMU | 107 | +#ifdef CONFIG_KQEMU |
108 | extern int kqemu_allowed; | 108 | extern int kqemu_allowed; |
109 | #endif | 109 | #endif |
110 | 110 |
target-i386/cpu.h
@@ -662,7 +662,7 @@ typedef struct CPUX86State { | @@ -662,7 +662,7 @@ typedef struct CPUX86State { | ||
662 | uint64_t mask; | 662 | uint64_t mask; |
663 | } mtrr_var[8]; | 663 | } mtrr_var[8]; |
664 | 664 | ||
665 | -#ifdef USE_KQEMU | 665 | +#ifdef CONFIG_KQEMU |
666 | int kqemu_enabled; | 666 | int kqemu_enabled; |
667 | int last_io_time; | 667 | int last_io_time; |
668 | #endif | 668 | #endif |
@@ -820,7 +820,7 @@ uint64_t cpu_get_tsc(CPUX86State *env); | @@ -820,7 +820,7 @@ uint64_t cpu_get_tsc(CPUX86State *env); | ||
820 | #define X86_DUMP_FPU 0x0001 /* dump FPU state too */ | 820 | #define X86_DUMP_FPU 0x0001 /* dump FPU state too */ |
821 | #define X86_DUMP_CCOP 0x0002 /* dump qemu flag cache */ | 821 | #define X86_DUMP_CCOP 0x0002 /* dump qemu flag cache */ |
822 | 822 | ||
823 | -#ifdef USE_KQEMU | 823 | +#ifdef CONFIG_KQEMU |
824 | static inline int cpu_get_time_fast(void) | 824 | static inline int cpu_get_time_fast(void) |
825 | { | 825 | { |
826 | int low, high; | 826 | int low, high; |
target-i386/helper.c
@@ -930,7 +930,7 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr) | @@ -930,7 +930,7 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr) | ||
930 | 930 | ||
931 | /* XXX: This value should match the one returned by CPUID | 931 | /* XXX: This value should match the one returned by CPUID |
932 | * and in exec.c */ | 932 | * and in exec.c */ |
933 | -#if defined(USE_KQEMU) | 933 | +#if defined(CONFIG_KQEMU) |
934 | #define PHYS_ADDR_MASK 0xfffff000LL | 934 | #define PHYS_ADDR_MASK 0xfffff000LL |
935 | #else | 935 | #else |
936 | # if defined(TARGET_X86_64) | 936 | # if defined(TARGET_X86_64) |
@@ -1630,14 +1630,14 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, | @@ -1630,14 +1630,14 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, | ||
1630 | /* XXX: This value must match the one used in the MMU code. */ | 1630 | /* XXX: This value must match the one used in the MMU code. */ |
1631 | if (env->cpuid_ext2_features & CPUID_EXT2_LM) { | 1631 | if (env->cpuid_ext2_features & CPUID_EXT2_LM) { |
1632 | /* 64 bit processor */ | 1632 | /* 64 bit processor */ |
1633 | -#if defined(USE_KQEMU) | 1633 | +#if defined(CONFIG_KQEMU) |
1634 | *eax = 0x00003020; /* 48 bits virtual, 32 bits physical */ | 1634 | *eax = 0x00003020; /* 48 bits virtual, 32 bits physical */ |
1635 | #else | 1635 | #else |
1636 | /* XXX: The physical address space is limited to 42 bits in exec.c. */ | 1636 | /* XXX: The physical address space is limited to 42 bits in exec.c. */ |
1637 | *eax = 0x00003028; /* 48 bits virtual, 40 bits physical */ | 1637 | *eax = 0x00003028; /* 48 bits virtual, 40 bits physical */ |
1638 | #endif | 1638 | #endif |
1639 | } else { | 1639 | } else { |
1640 | -#if defined(USE_KQEMU) | 1640 | +#if defined(CONFIG_KQEMU) |
1641 | *eax = 0x00000020; /* 32 bits physical */ | 1641 | *eax = 0x00000020; /* 32 bits physical */ |
1642 | #else | 1642 | #else |
1643 | if (env->cpuid_features & CPUID_PSE36) | 1643 | if (env->cpuid_features & CPUID_PSE36) |
@@ -1689,7 +1689,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model) | @@ -1689,7 +1689,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model) | ||
1689 | return NULL; | 1689 | return NULL; |
1690 | } | 1690 | } |
1691 | cpu_reset(env); | 1691 | cpu_reset(env); |
1692 | -#ifdef USE_KQEMU | 1692 | +#ifdef CONFIG_KQEMU |
1693 | kqemu_init(env); | 1693 | kqemu_init(env); |
1694 | #endif | 1694 | #endif |
1695 | if (kvm_enabled()) | 1695 | if (kvm_enabled()) |
target-i386/op_helper.c
@@ -1119,7 +1119,7 @@ void helper_sysret(int dflag) | @@ -1119,7 +1119,7 @@ void helper_sysret(int dflag) | ||
1119 | env->eflags |= IF_MASK; | 1119 | env->eflags |= IF_MASK; |
1120 | cpu_x86_set_cpl(env, 3); | 1120 | cpu_x86_set_cpl(env, 3); |
1121 | } | 1121 | } |
1122 | -#ifdef USE_KQEMU | 1122 | +#ifdef CONFIG_KQEMU |
1123 | if (kqemu_is_ok(env)) { | 1123 | if (kqemu_is_ok(env)) { |
1124 | if (env->hflags & HF_LMA_MASK) | 1124 | if (env->hflags & HF_LMA_MASK) |
1125 | CC_OP = CC_OP_EFLAGS; | 1125 | CC_OP = CC_OP_EFLAGS; |
@@ -2478,7 +2478,7 @@ void helper_lcall_protected(int new_cs, target_ulong new_eip, | @@ -2478,7 +2478,7 @@ void helper_lcall_protected(int new_cs, target_ulong new_eip, | ||
2478 | SET_ESP(sp, sp_mask); | 2478 | SET_ESP(sp, sp_mask); |
2479 | EIP = offset; | 2479 | EIP = offset; |
2480 | } | 2480 | } |
2481 | -#ifdef USE_KQEMU | 2481 | +#ifdef CONFIG_KQEMU |
2482 | if (kqemu_is_ok(env)) { | 2482 | if (kqemu_is_ok(env)) { |
2483 | env->exception_index = -1; | 2483 | env->exception_index = -1; |
2484 | cpu_loop_exit(); | 2484 | cpu_loop_exit(); |
@@ -2764,7 +2764,7 @@ void helper_iret_protected(int shift, int next_eip) | @@ -2764,7 +2764,7 @@ void helper_iret_protected(int shift, int next_eip) | ||
2764 | helper_ret_protected(shift, 1, 0); | 2764 | helper_ret_protected(shift, 1, 0); |
2765 | } | 2765 | } |
2766 | env->hflags2 &= ~HF2_NMI_MASK; | 2766 | env->hflags2 &= ~HF2_NMI_MASK; |
2767 | -#ifdef USE_KQEMU | 2767 | +#ifdef CONFIG_KQEMU |
2768 | if (kqemu_is_ok(env)) { | 2768 | if (kqemu_is_ok(env)) { |
2769 | CC_OP = CC_OP_EFLAGS; | 2769 | CC_OP = CC_OP_EFLAGS; |
2770 | env->exception_index = -1; | 2770 | env->exception_index = -1; |
@@ -2776,7 +2776,7 @@ void helper_iret_protected(int shift, int next_eip) | @@ -2776,7 +2776,7 @@ void helper_iret_protected(int shift, int next_eip) | ||
2776 | void helper_lret_protected(int shift, int addend) | 2776 | void helper_lret_protected(int shift, int addend) |
2777 | { | 2777 | { |
2778 | helper_ret_protected(shift, 0, addend); | 2778 | helper_ret_protected(shift, 0, addend); |
2779 | -#ifdef USE_KQEMU | 2779 | +#ifdef CONFIG_KQEMU |
2780 | if (kqemu_is_ok(env)) { | 2780 | if (kqemu_is_ok(env)) { |
2781 | env->exception_index = -1; | 2781 | env->exception_index = -1; |
2782 | cpu_loop_exit(); | 2782 | cpu_loop_exit(); |
@@ -2854,7 +2854,7 @@ void helper_sysexit(int dflag) | @@ -2854,7 +2854,7 @@ void helper_sysexit(int dflag) | ||
2854 | } | 2854 | } |
2855 | ESP = ECX; | 2855 | ESP = ECX; |
2856 | EIP = EDX; | 2856 | EIP = EDX; |
2857 | -#ifdef USE_KQEMU | 2857 | +#ifdef CONFIG_KQEMU |
2858 | if (kqemu_is_ok(env)) { | 2858 | if (kqemu_is_ok(env)) { |
2859 | env->exception_index = -1; | 2859 | env->exception_index = -1; |
2860 | cpu_loop_exit(); | 2860 | cpu_loop_exit(); |
@@ -3167,7 +3167,7 @@ void helper_rdmsr(void) | @@ -3167,7 +3167,7 @@ void helper_rdmsr(void) | ||
3167 | val = env->kernelgsbase; | 3167 | val = env->kernelgsbase; |
3168 | break; | 3168 | break; |
3169 | #endif | 3169 | #endif |
3170 | -#ifdef USE_KQEMU | 3170 | +#ifdef CONFIG_KQEMU |
3171 | case MSR_QPI_COMMBASE: | 3171 | case MSR_QPI_COMMBASE: |
3172 | if (env->kqemu_enabled) { | 3172 | if (env->kqemu_enabled) { |
3173 | val = kqemu_comm_base; | 3173 | val = kqemu_comm_base; |
vl.c
@@ -435,7 +435,7 @@ void cpu_outb(CPUState *env, int addr, int val) | @@ -435,7 +435,7 @@ void cpu_outb(CPUState *env, int addr, int val) | ||
435 | { | 435 | { |
436 | LOG_IOPORT("outb: %04x %02x\n", addr, val); | 436 | LOG_IOPORT("outb: %04x %02x\n", addr, val); |
437 | ioport_write(0, addr, val); | 437 | ioport_write(0, addr, val); |
438 | -#ifdef USE_KQEMU | 438 | +#ifdef CONFIG_KQEMU |
439 | if (env) | 439 | if (env) |
440 | env->last_io_time = cpu_get_time_fast(); | 440 | env->last_io_time = cpu_get_time_fast(); |
441 | #endif | 441 | #endif |
@@ -445,7 +445,7 @@ void cpu_outw(CPUState *env, int addr, int val) | @@ -445,7 +445,7 @@ void cpu_outw(CPUState *env, int addr, int val) | ||
445 | { | 445 | { |
446 | LOG_IOPORT("outw: %04x %04x\n", addr, val); | 446 | LOG_IOPORT("outw: %04x %04x\n", addr, val); |
447 | ioport_write(1, addr, val); | 447 | ioport_write(1, addr, val); |
448 | -#ifdef USE_KQEMU | 448 | +#ifdef CONFIG_KQEMU |
449 | if (env) | 449 | if (env) |
450 | env->last_io_time = cpu_get_time_fast(); | 450 | env->last_io_time = cpu_get_time_fast(); |
451 | #endif | 451 | #endif |
@@ -455,7 +455,7 @@ void cpu_outl(CPUState *env, int addr, int val) | @@ -455,7 +455,7 @@ void cpu_outl(CPUState *env, int addr, int val) | ||
455 | { | 455 | { |
456 | LOG_IOPORT("outl: %04x %08x\n", addr, val); | 456 | LOG_IOPORT("outl: %04x %08x\n", addr, val); |
457 | ioport_write(2, addr, val); | 457 | ioport_write(2, addr, val); |
458 | -#ifdef USE_KQEMU | 458 | +#ifdef CONFIG_KQEMU |
459 | if (env) | 459 | if (env) |
460 | env->last_io_time = cpu_get_time_fast(); | 460 | env->last_io_time = cpu_get_time_fast(); |
461 | #endif | 461 | #endif |
@@ -466,7 +466,7 @@ int cpu_inb(CPUState *env, int addr) | @@ -466,7 +466,7 @@ int cpu_inb(CPUState *env, int addr) | ||
466 | int val; | 466 | int val; |
467 | val = ioport_read(0, addr); | 467 | val = ioport_read(0, addr); |
468 | LOG_IOPORT("inb : %04x %02x\n", addr, val); | 468 | LOG_IOPORT("inb : %04x %02x\n", addr, val); |
469 | -#ifdef USE_KQEMU | 469 | +#ifdef CONFIG_KQEMU |
470 | if (env) | 470 | if (env) |
471 | env->last_io_time = cpu_get_time_fast(); | 471 | env->last_io_time = cpu_get_time_fast(); |
472 | #endif | 472 | #endif |
@@ -478,7 +478,7 @@ int cpu_inw(CPUState *env, int addr) | @@ -478,7 +478,7 @@ int cpu_inw(CPUState *env, int addr) | ||
478 | int val; | 478 | int val; |
479 | val = ioport_read(1, addr); | 479 | val = ioport_read(1, addr); |
480 | LOG_IOPORT("inw : %04x %04x\n", addr, val); | 480 | LOG_IOPORT("inw : %04x %04x\n", addr, val); |
481 | -#ifdef USE_KQEMU | 481 | +#ifdef CONFIG_KQEMU |
482 | if (env) | 482 | if (env) |
483 | env->last_io_time = cpu_get_time_fast(); | 483 | env->last_io_time = cpu_get_time_fast(); |
484 | #endif | 484 | #endif |
@@ -490,7 +490,7 @@ int cpu_inl(CPUState *env, int addr) | @@ -490,7 +490,7 @@ int cpu_inl(CPUState *env, int addr) | ||
490 | int val; | 490 | int val; |
491 | val = ioport_read(2, addr); | 491 | val = ioport_read(2, addr); |
492 | LOG_IOPORT("inl : %04x %08x\n", addr, val); | 492 | LOG_IOPORT("inl : %04x %08x\n", addr, val); |
493 | -#ifdef USE_KQEMU | 493 | +#ifdef CONFIG_KQEMU |
494 | if (env) | 494 | if (env) |
495 | env->last_io_time = cpu_get_time_fast(); | 495 | env->last_io_time = cpu_get_time_fast(); |
496 | #endif | 496 | #endif |
@@ -1357,7 +1357,7 @@ static void host_alarm_handler(int host_signum) | @@ -1357,7 +1357,7 @@ static void host_alarm_handler(int host_signum) | ||
1357 | if (env) { | 1357 | if (env) { |
1358 | /* stop the currently executing cpu because a timer occured */ | 1358 | /* stop the currently executing cpu because a timer occured */ |
1359 | cpu_exit(env); | 1359 | cpu_exit(env); |
1360 | -#ifdef USE_KQEMU | 1360 | +#ifdef CONFIG_KQEMU |
1361 | if (env->kqemu_enabled) { | 1361 | if (env->kqemu_enabled) { |
1362 | kqemu_cpu_interrupt(env); | 1362 | kqemu_cpu_interrupt(env); |
1363 | } | 1363 | } |
@@ -3343,7 +3343,7 @@ void qemu_service_io(void) | @@ -3343,7 +3343,7 @@ void qemu_service_io(void) | ||
3343 | CPUState *env = cpu_single_env; | 3343 | CPUState *env = cpu_single_env; |
3344 | if (env) { | 3344 | if (env) { |
3345 | cpu_exit(env); | 3345 | cpu_exit(env); |
3346 | -#ifdef USE_KQEMU | 3346 | +#ifdef CONFIG_KQEMU |
3347 | if (env->kqemu_enabled) { | 3347 | if (env->kqemu_enabled) { |
3348 | kqemu_cpu_interrupt(env); | 3348 | kqemu_cpu_interrupt(env); |
3349 | } | 3349 | } |
@@ -4634,7 +4634,7 @@ int main(int argc, char **argv, char **envp) | @@ -4634,7 +4634,7 @@ int main(int argc, char **argv, char **envp) | ||
4634 | 4634 | ||
4635 | /* On 32-bit hosts, QEMU is limited by virtual address space */ | 4635 | /* On 32-bit hosts, QEMU is limited by virtual address space */ |
4636 | if (value > (2047 << 20) | 4636 | if (value > (2047 << 20) |
4637 | -#ifndef USE_KQEMU | 4637 | +#ifndef CONFIG_KQEMU |
4638 | && HOST_LONG_BITS == 32 | 4638 | && HOST_LONG_BITS == 32 |
4639 | #endif | 4639 | #endif |
4640 | ) { | 4640 | ) { |
@@ -4809,7 +4809,7 @@ int main(int argc, char **argv, char **envp) | @@ -4809,7 +4809,7 @@ int main(int argc, char **argv, char **envp) | ||
4809 | } | 4809 | } |
4810 | break; | 4810 | break; |
4811 | #endif | 4811 | #endif |
4812 | -#ifdef USE_KQEMU | 4812 | +#ifdef CONFIG_KQEMU |
4813 | case QEMU_OPTION_no_kqemu: | 4813 | case QEMU_OPTION_no_kqemu: |
4814 | kqemu_allowed = 0; | 4814 | kqemu_allowed = 0; |
4815 | break; | 4815 | break; |
@@ -4820,7 +4820,7 @@ int main(int argc, char **argv, char **envp) | @@ -4820,7 +4820,7 @@ int main(int argc, char **argv, char **envp) | ||
4820 | #ifdef CONFIG_KVM | 4820 | #ifdef CONFIG_KVM |
4821 | case QEMU_OPTION_enable_kvm: | 4821 | case QEMU_OPTION_enable_kvm: |
4822 | kvm_allowed = 1; | 4822 | kvm_allowed = 1; |
4823 | -#ifdef USE_KQEMU | 4823 | +#ifdef CONFIG_KQEMU |
4824 | kqemu_allowed = 0; | 4824 | kqemu_allowed = 0; |
4825 | #endif | 4825 | #endif |
4826 | break; | 4826 | break; |
@@ -4976,7 +4976,7 @@ int main(int argc, char **argv, char **envp) | @@ -4976,7 +4976,7 @@ int main(int argc, char **argv, char **envp) | ||
4976 | } | 4976 | } |
4977 | } | 4977 | } |
4978 | 4978 | ||
4979 | -#if defined(CONFIG_KVM) && defined(USE_KQEMU) | 4979 | +#if defined(CONFIG_KVM) && defined(CONFIG_KQEMU) |
4980 | if (kvm_allowed && kqemu_allowed) { | 4980 | if (kvm_allowed && kqemu_allowed) { |
4981 | fprintf(stderr, | 4981 | fprintf(stderr, |
4982 | "You can not enable both KVM and kqemu at the same time\n"); | 4982 | "You can not enable both KVM and kqemu at the same time\n"); |
@@ -5055,7 +5055,7 @@ int main(int argc, char **argv, char **envp) | @@ -5055,7 +5055,7 @@ int main(int argc, char **argv, char **envp) | ||
5055 | } | 5055 | } |
5056 | #endif | 5056 | #endif |
5057 | 5057 | ||
5058 | -#ifdef USE_KQEMU | 5058 | +#ifdef CONFIG_KQEMU |
5059 | if (smp_cpus > 1) | 5059 | if (smp_cpus > 1) |
5060 | kqemu_allowed = 0; | 5060 | kqemu_allowed = 0; |
5061 | #endif | 5061 | #endif |
@@ -5148,7 +5148,7 @@ int main(int argc, char **argv, char **envp) | @@ -5148,7 +5148,7 @@ int main(int argc, char **argv, char **envp) | ||
5148 | if (ram_size == 0) | 5148 | if (ram_size == 0) |
5149 | ram_size = DEFAULT_RAM_SIZE * 1024 * 1024; | 5149 | ram_size = DEFAULT_RAM_SIZE * 1024 * 1024; |
5150 | 5150 | ||
5151 | -#ifdef USE_KQEMU | 5151 | +#ifdef CONFIG_KQEMU |
5152 | /* FIXME: This is a nasty hack because kqemu can't cope with dynamic | 5152 | /* FIXME: This is a nasty hack because kqemu can't cope with dynamic |
5153 | guest ram allocation. It needs to go away. */ | 5153 | guest ram allocation. It needs to go away. */ |
5154 | if (kqemu_allowed) { | 5154 | if (kqemu_allowed) { |