aboutsummaryrefslogtreecommitdiff
path: root/qom/cpu.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 /qom/cpu.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 'qom/cpu.c')
-rw-r--r--qom/cpu.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/qom/cpu.c b/qom/cpu.c
index 7b20f84162..8757f033a0 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -32,6 +32,8 @@
#include "hw/qdev-properties.h"
#include "trace-root.h"
+CPUInterruptHandler cpu_interrupt_handler;
+
bool cpu_exists(int64_t id)
{
CPUState *cpu;
@@ -417,6 +419,17 @@ static vaddr cpu_adjust_watchpoint_address(CPUState *cpu, vaddr addr, int len)
return addr;
}
+static void generic_handle_interrupt(CPUState *cpu, int mask)
+{
+ cpu->interrupt_request |= mask;
+
+ if (!qemu_cpu_is_self(cpu)) {
+ qemu_cpu_kick(cpu);
+ }
+}
+
+CPUInterruptHandler cpu_interrupt_handler = generic_handle_interrupt;
+
static void cpu_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);