summaryrefslogtreecommitdiffstats
path: root/hw/ppc/ppc.c
diff options
context:
space:
mode:
authorCédric Le Goater2019-03-06 09:50:07 +0100
committerDavid Gibson2019-03-12 04:33:04 +0100
commit051e2973bf24f0f6e622e35de7c9d1803e5c23d3 (patch)
treededd63313eb4e669bdafeee7c288542435cbea09 /hw/ppc/ppc.c
parentppc/xive: hardwire the Physical CAM line of the thread context (diff)
downloadqemu-051e2973bf24f0f6e622e35de7c9d1803e5c23d3.tar.gz
qemu-051e2973bf24f0f6e622e35de7c9d1803e5c23d3.tar.xz
qemu-051e2973bf24f0f6e622e35de7c9d1803e5c23d3.zip
ppc: externalize ppc_get_vcpu_by_pir()
We will use it to get the CPU interrupt presenter in XIVE when the TIMA is accessed from the indirect page. Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20190306085032.15744-3-clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc/ppc.c')
-rw-r--r--hw/ppc/ppc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
index df23a7000c..49d57469fb 100644
--- a/hw/ppc/ppc.c
+++ b/hw/ppc/ppc.c
@@ -1492,3 +1492,19 @@ void PPC_debug_write (void *opaque, uint32_t addr, uint32_t val)
break;
}
}
+
+PowerPCCPU *ppc_get_vcpu_by_pir(int pir)
+{
+ CPUState *cs;
+
+ CPU_FOREACH(cs) {
+ PowerPCCPU *cpu = POWERPC_CPU(cs);
+ CPUPPCState *env = &cpu->env;
+
+ if (env->spr_cb[SPR_PIR].default_value == pir) {
+ return cpu;
+ }
+ }
+
+ return NULL;
+}