aboutsummaryrefslogtreecommitdiff
path: root/accel/tcg/translate-common.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2017-07-04 15:57:28 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2017-07-04 16:00:43 +0200
commit290dae4678df9f271dbde5cc5cc7648aff136493 (patch)
tree4b29ad5be67344cae76274fa922dbd2e9d94c402 /accel/tcg/translate-common.c
parenta0be0c585f5dcc4d50a37f6a20d3d625c5ef3a2c (diff)
cpu: move interrupt handling out of translate-common.c
translate-common.c will not be available anymore with --disable-tcg, so we cannot leave cpu_interrupt_handler there. Move the TCG-specific handler to accel/tcg/tcg-all.c, and adopt KVM's handler as the default one, since it works just as well for Xen and qtest. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'accel/tcg/translate-common.c')
-rw-r--r--accel/tcg/translate-common.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/accel/tcg/translate-common.c b/accel/tcg/translate-common.c
deleted file mode 100644
index e6b8c4cf0f..0000000000
--- a/accel/tcg/translate-common.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Host code generation common components
- *
- * Copyright (c) 2015 Peter Crosthwaite <crosthwaite.peter@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "qemu/osdep.h"
-#include "qemu-common.h"
-#include "qom/cpu.h"
-#include "sysemu/cpus.h"
-#include "qemu/main-loop.h"
-
-#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;
-
- /*
- * If called from iothread context, wake the target cpu in
- * case its halted.
- */
- if (!qemu_cpu_is_self(cpu)) {
- qemu_cpu_kick(cpu);
- } 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");
- }
- }
-}
-
-CPUInterruptHandler cpu_interrupt_handler = tcg_handle_interrupt;
-#endif