diff options
author | Matheus Ferst <matheus.ferst@eldorado.org.br> | 2022-10-11 17:48:01 -0300 |
---|---|---|
committer | Daniel Henrique Barboza <danielhb413@gmail.com> | 2022-10-28 13:15:22 -0300 |
commit | f003109f710bb39a78c27ce18aa10579340f5a3f (patch) | |
tree | 1b7ed6f95000cebf3467dbee189b8ef42c56477e /hw | |
parent | bbd8dd5e45b831ef3fda585cf80d08f45cdaba95 (diff) | |
download | qemu-f003109f710bb39a78c27ce18aa10579340f5a3f.zip qemu-f003109f710bb39a78c27ce18aa10579340f5a3f.tar.gz qemu-f003109f710bb39a78c27ce18aa10579340f5a3f.tar.bz2 |
target/ppc: define PPC_INTERRUPT_* values directly
This enum defines the bit positions in env->pending_interrupts for each
interrupt. However, except for the comparison in kvmppc_set_interrupt,
the values are always used as (1 << PPC_INTERRUPT_*). Define them
directly like that to save some clutter. No functional change intended.
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Message-Id: <20221011204829.1641124-2-matheus.ferst@eldorado.org.br>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/ppc/ppc.c | 10 | ||||
-rw-r--r-- | hw/ppc/trace-events | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index 690f448..77e611e 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -40,7 +40,7 @@ static void cpu_ppc_tb_stop (CPUPPCState *env); static void cpu_ppc_tb_start (CPUPPCState *env); -void ppc_set_irq(PowerPCCPU *cpu, int n_IRQ, int level) +void ppc_set_irq(PowerPCCPU *cpu, int irq, int level) { CPUState *cs = CPU(cpu); CPUPPCState *env = &cpu->env; @@ -56,21 +56,21 @@ void ppc_set_irq(PowerPCCPU *cpu, int n_IRQ, int level) old_pending = env->pending_interrupts; if (level) { - env->pending_interrupts |= 1 << n_IRQ; + env->pending_interrupts |= irq; cpu_interrupt(cs, CPU_INTERRUPT_HARD); } else { - env->pending_interrupts &= ~(1 << n_IRQ); + env->pending_interrupts &= ~irq; if (env->pending_interrupts == 0) { cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); } } if (old_pending != env->pending_interrupts) { - kvmppc_set_interrupt(cpu, n_IRQ, level); + kvmppc_set_interrupt(cpu, irq, level); } - trace_ppc_irq_set_exit(env, n_IRQ, level, env->pending_interrupts, + trace_ppc_irq_set_exit(env, irq, level, env->pending_interrupts, CPU(cpu)->interrupt_request); if (locked) { diff --git a/hw/ppc/trace-events b/hw/ppc/trace-events index a07d5ac..956938e 100644 --- a/hw/ppc/trace-events +++ b/hw/ppc/trace-events @@ -127,7 +127,7 @@ ppc40x_set_tb_clk(uint32_t value) "new frequency %" PRIu32 ppc40x_timers_init(uint32_t value) "frequency %" PRIu32 ppc_irq_set(void *env, uint32_t pin, uint32_t level) "env [%p] pin %d level %d" -ppc_irq_set_exit(void *env, uint32_t n_IRQ, uint32_t level, uint32_t pending, uint32_t request) "env [%p] n_IRQ %d level %d => pending 0x%08" PRIx32 " req 0x%08" PRIx32 +ppc_irq_set_exit(void *env, uint32_t irq, uint32_t level, uint32_t pending, uint32_t request) "env [%p] irq 0x%05" PRIx32 " level %d => pending 0x%08" PRIx32 " req 0x%08" PRIx32 ppc_irq_set_state(const char *name, uint32_t level) "\"%s\" level %d" ppc_irq_reset(const char *name) "%s" ppc_irq_cpu(const char *action) "%s" |