[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 16/23] ppc/xics: Implement H_IPOLL using an accessor
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 16/23] ppc/xics: Implement H_IPOLL using an accessor |
Date: |
Fri, 1 Jul 2016 16:41:52 +1000 |
From: Benjamin Herrenschmidt <address@hidden>
None of the other presenter functions directly mucks with the
internal state, so don't do it there either.
Signed-off-by: Benjamin Herrenschmidt <address@hidden>
Signed-off-by: Nikunj A Dadhania <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/intc/xics.c | 8 ++++++++
hw/intc/xics_spapr.c | 7 ++++---
include/hw/ppc/xics.h | 1 +
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index f01af08..f43f98a 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -288,6 +288,14 @@ uint32_t icp_accept(ICPState *ss)
return xirr;
}
+uint32_t icp_ipoll(ICPState *ss, uint32_t *mfrr)
+{
+ if (mfrr) {
+ *mfrr = ss->mfrr;
+ }
+ return ss->xirr;
+}
+
void icp_eoi(XICSState *icp, int server, uint32_t xirr)
{
ICPState *ss = icp->ss + server;
diff --git a/hw/intc/xics_spapr.c b/hw/intc/xics_spapr.c
index 89190ef..94571dd 100644
--- a/hw/intc/xics_spapr.c
+++ b/hw/intc/xics_spapr.c
@@ -99,10 +99,11 @@ static target_ulong h_ipoll(PowerPCCPU *cpu,
sPAPRMachineState *spapr,
target_ulong opcode, target_ulong *args)
{
CPUState *cs = CPU(cpu);
- ICPState *ss = &spapr->icp->ss[cs->cpu_index];
+ uint32_t mfrr;
+ uint32_t xirr = icp_ipoll(spapr->icp->ss + cs->cpu_index, &mfrr);
- args[0] = ss->xirr;
- args[1] = ss->mfrr;
+ args[0] = xirr;
+ args[1] = mfrr;
return H_SUCCESS;
}
diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
index 3349006..7445a14 100644
--- a/include/hw/ppc/xics.h
+++ b/include/hw/ppc/xics.h
@@ -186,6 +186,7 @@ int xics_get_cpu_index_by_dt_id(int cpu_dt_id);
void icp_set_cppr(XICSState *icp, int server, uint8_t cppr);
void icp_set_mfrr(XICSState *icp, int server, uint8_t mfrr);
uint32_t icp_accept(ICPState *ss);
+uint32_t icp_ipoll(ICPState *ss, uint32_t *mfrr);
void icp_eoi(XICSState *icp, int server, uint32_t xirr);
void ics_write_xive(ICSState *ics, int nr, int server,
--
2.7.4
- [Qemu-ppc] [PULL 08/23] ppc: Print HSRR0/HSRR1 in "info registers", (continued)
- [Qemu-ppc] [PULL 08/23] ppc: Print HSRR0/HSRR1 in "info registers", David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 18/23] target-ppc: gen_pause for instructions: yield, mdoio, mdoom, miso, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 09/23] hw/ppc/spapr: Add some missing hcall function set strings, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 22/23] spapr: drop duplicate variable in spapr_core_release(), David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 23/23] qmp: fix spapr example of query-hotpluggable-cpus, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 07/23] ppc: LPCR is a HV resource, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 20/23] spapr: drop reference on child object during core realization, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 04/23] ppc: Fix conditions for delivering external interrupts to a guest, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 11/23] spapr: Restore support for older PowerPC CPU cores, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 06/23] ppc: Initial HDEC support, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 16/23] ppc/xics: Implement H_IPOLL using an accessor,
David Gibson <=
- [Qemu-ppc] [PULL 14/23] ppc/xics: Rename existing xics to xics_spapr, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 15/23] ppc/xics: Move SPAPR specific code to a separate file, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 17/23] ppc/xics: Replace "icp" with "xics" in most places, David Gibson, 2016/07/01
- Re: [Qemu-ppc] [PULL 00/23] ppc-for-2.7 queue 20160701, Peter Maydell, 2016/07/01