mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
hw/mips: Use QEMU_IOTHREAD_LOCK_GUARD in cpu_mips_irq_request
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
0aa5d47ac5
commit
6fa8c46e55
1 changed files with 1 additions and 10 deletions
|
@ -32,17 +32,12 @@ static void cpu_mips_irq_request(void *opaque, int irq, int level)
|
||||||
MIPSCPU *cpu = opaque;
|
MIPSCPU *cpu = opaque;
|
||||||
CPUMIPSState *env = &cpu->env;
|
CPUMIPSState *env = &cpu->env;
|
||||||
CPUState *cs = CPU(cpu);
|
CPUState *cs = CPU(cpu);
|
||||||
bool locked = false;
|
|
||||||
|
|
||||||
if (irq < 0 || irq > 7) {
|
if (irq < 0 || irq > 7) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure locking works even if BQL is already held by the caller */
|
QEMU_IOTHREAD_LOCK_GUARD();
|
||||||
if (!qemu_mutex_iothread_locked()) {
|
|
||||||
locked = true;
|
|
||||||
qemu_mutex_lock_iothread();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (level) {
|
if (level) {
|
||||||
env->CP0_Cause |= 1 << (irq + CP0Ca_IP);
|
env->CP0_Cause |= 1 << (irq + CP0Ca_IP);
|
||||||
|
@ -59,10 +54,6 @@ static void cpu_mips_irq_request(void *opaque, int irq, int level)
|
||||||
} else {
|
} else {
|
||||||
cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD);
|
cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (locked) {
|
|
||||||
qemu_mutex_unlock_iothread();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpu_mips_irq_init_cpu(MIPSCPU *cpu)
|
void cpu_mips_irq_init_cpu(MIPSCPU *cpu)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue