X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=translate-common.c;h=40fe5a19bb3c2ec14f0f2ac58e78db95cbc89aea;hb=6aabeb58391a33cda7e2b406adb431a5ef7e8eea;hp=619feb466ec1f8056f9fbfaf9eb51c9ae4b15dc8;hpb=5f12a788c04cf36442f3be00ebf6fdc3b8c8c4ba;p=mirror_qemu.git diff --git a/translate-common.c b/translate-common.c index 619feb466e..40fe5a19bb 100644 --- a/translate-common.c +++ b/translate-common.c @@ -17,17 +17,21 @@ * License along with this library; if not, see . */ +#include "qemu/osdep.h" #include "qemu-common.h" #include "qom/cpu.h" +#include "sysemu/cpus.h" +#include "qemu/main-loop.h" uintptr_t qemu_real_host_page_size; -uintptr_t qemu_real_host_page_mask; +intptr_t qemu_real_host_page_mask; #ifndef CONFIG_USER_ONLY /* mask must never be zero, except for A20 change call */ static void tcg_handle_interrupt(CPUState *cpu, int mask) { int old_mask; + g_assert(qemu_mutex_iothread_locked()); old_mask = cpu->interrupt_request; cpu->interrupt_request |= mask; @@ -38,17 +42,13 @@ static void tcg_handle_interrupt(CPUState *cpu, int mask) */ if (!qemu_cpu_is_self(cpu)) { qemu_cpu_kick(cpu); - return; - } - - if (use_icount) { - cpu->icount_decr.u16.high = 0xffff; - if (!cpu->can_do_io + } else { + cpu->icount_decr.u16.high = -1; + if (use_icount && + !cpu->can_do_io && (mask & ~old_mask) != 0) { cpu_abort(cpu, "Raised interrupt while not in I/O function"); } - } else { - cpu->tcg_exit_req = 1; } }