mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
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>
This commit is contained in:
+3
-8
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user