mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
ppc: Introduce a ppc_cpu_pir() helper
Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20191125065820.927-6-clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
feecc6a043
commit
4a89e20458
2 changed files with 8 additions and 2 deletions
|
@ -1495,15 +1495,20 @@ void PPC_debug_write (void *opaque, uint32_t addr, uint32_t val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ppc_cpu_pir(PowerPCCPU *cpu)
|
||||||
|
{
|
||||||
|
CPUPPCState *env = &cpu->env;
|
||||||
|
return env->spr_cb[SPR_PIR].default_value;
|
||||||
|
}
|
||||||
|
|
||||||
PowerPCCPU *ppc_get_vcpu_by_pir(int pir)
|
PowerPCCPU *ppc_get_vcpu_by_pir(int pir)
|
||||||
{
|
{
|
||||||
CPUState *cs;
|
CPUState *cs;
|
||||||
|
|
||||||
CPU_FOREACH(cs) {
|
CPU_FOREACH(cs) {
|
||||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||||
CPUPPCState *env = &cpu->env;
|
|
||||||
|
|
||||||
if (env->spr_cb[SPR_PIR].default_value == pir) {
|
if (ppc_cpu_pir(cpu) == pir) {
|
||||||
return cpu;
|
return cpu;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
void ppc_set_irq(PowerPCCPU *cpu, int n_IRQ, int level);
|
void ppc_set_irq(PowerPCCPU *cpu, int n_IRQ, int level);
|
||||||
PowerPCCPU *ppc_get_vcpu_by_pir(int pir);
|
PowerPCCPU *ppc_get_vcpu_by_pir(int pir);
|
||||||
|
int ppc_cpu_pir(PowerPCCPU *cpu);
|
||||||
|
|
||||||
/* PowerPC hardware exceptions management helpers */
|
/* PowerPC hardware exceptions management helpers */
|
||||||
typedef void (*clk_setup_cb)(void *opaque, uint32_t freq);
|
typedef void (*clk_setup_cb)(void *opaque, uint32_t freq);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue