diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2020-04-29 10:21:05 +0200 |
---|---|---|
committer | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2020-05-26 13:21:12 +0200 |
commit | 56b92eeeac8074501858e15b7658ec6099456f04 (patch) | |
tree | 9a1ee15ab25403bb274e0098edf81ec610f61dd1 /hw | |
parent | c707f06fb1d9b09e5d442e72f6f3dcd021671a90 (diff) | |
download | qemu-56b92eeeac8074501858e15b7658ec6099456f04.zip |
hw/mips/mips_int: De-duplicate KVM interrupt delivery
Refactor duplicated code in a single place.
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20200429082916.10669-2-f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/mips/mips_int.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/hw/mips/mips_int.c b/hw/mips/mips_int.c index 796730b11d..4a1bf846da 100644 --- a/hw/mips/mips_int.c +++ b/hw/mips/mips_int.c @@ -47,17 +47,12 @@ static void cpu_mips_irq_request(void *opaque, int irq, int level) if (level) { env->CP0_Cause |= 1 << (irq + CP0Ca_IP); - - if (kvm_enabled() && irq == 2) { - kvm_mips_set_interrupt(cpu, irq, level); - } - } else { env->CP0_Cause &= ~(1 << (irq + CP0Ca_IP)); + } - if (kvm_enabled() && irq == 2) { - kvm_mips_set_interrupt(cpu, irq, level); - } + if (kvm_enabled() && irq == 2) { + kvm_mips_set_interrupt(cpu, irq, level); } if (env->CP0_Cause & CP0Ca_IP_mask) { |