mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 18:44:58 -06:00
target/ppc: introduce ppc_maybe_interrupt
This new method will check if any pending interrupt was unmasked and then call cpu_interrupt/cpu_reset_interrupt accordingly. Code that raises/lowers or masks/unmasks interrupts should call this method to keep CPU_INTERRUPT_HARD coherent with env->pending_interrupts. Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Message-Id: <20221021142156.4134411-2-matheus.ferst@eldorado.org.br> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
6a8e8188c3
commit
2fdedcbc69
10 changed files with 67 additions and 8 deletions
|
@ -42,7 +42,6 @@ static void cpu_ppc_tb_start (CPUPPCState *env);
|
|||
|
||||
void ppc_set_irq(PowerPCCPU *cpu, int irq, int level)
|
||||
{
|
||||
CPUState *cs = CPU(cpu);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
unsigned int old_pending;
|
||||
bool locked = false;
|
||||
|
@ -57,19 +56,15 @@ void ppc_set_irq(PowerPCCPU *cpu, int irq, int level)
|
|||
|
||||
if (level) {
|
||||
env->pending_interrupts |= irq;
|
||||
cpu_interrupt(cs, CPU_INTERRUPT_HARD);
|
||||
} else {
|
||||
env->pending_interrupts &= ~irq;
|
||||
if (env->pending_interrupts == 0) {
|
||||
cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD);
|
||||
}
|
||||
}
|
||||
|
||||
if (old_pending != env->pending_interrupts) {
|
||||
ppc_maybe_interrupt(env);
|
||||
kvmppc_set_interrupt(cpu, irq, level);
|
||||
}
|
||||
|
||||
|
||||
trace_ppc_irq_set_exit(env, irq, level, env->pending_interrupts,
|
||||
CPU(cpu)->interrupt_request);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue