[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH v2 08/22] ppc/xics: use the QOM interface to resend ir
From: |
Cédric Le Goater |
Subject: |
[Qemu-ppc] [PATCH v2 08/22] ppc/xics: use the QOM interface to resend irqs |
Date: |
Thu, 16 Feb 2017 14:47:31 +0100 |
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/intc/xics.c | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index 0ffdf09c5304..2decb921e4e3 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -229,16 +229,15 @@ static void icp_check_ipi(ICPState *ss)
qemu_irq_raise(ss->output);
}
-static void icp_resend(ICPState *ss)
+static void icp_resend(XICSInterface *xi, ICPState *ss)
{
- ICSState *ics;
+ XICSInterfaceClass *xic = XICS_INTERFACE_GET_CLASS(xi);
if (ss->mfrr < CPPR(ss)) {
icp_check_ipi(ss);
}
- QLIST_FOREACH(ics, &ss->xics->ics, list) {
- ics_resend(ics);
- }
+
+ xic->ics_resend(xi);
}
void icp_set_cppr(ICPState *ss, uint8_t cppr)
@@ -262,7 +261,7 @@ void icp_set_cppr(ICPState *ss, uint8_t cppr)
}
} else {
if (!XISR(ss)) {
- icp_resend(ss);
+ icp_resend(XICS_INTERFACE(qdev_get_machine()), ss);
}
}
}
@@ -299,6 +298,8 @@ uint32_t icp_ipoll(ICPState *ss, uint32_t *mfrr)
void icp_eoi(ICPState *ss, uint32_t xirr)
{
+ XICSInterface *xi = XICS_INTERFACE(qdev_get_machine());
+ XICSInterfaceClass *xic = XICS_INTERFACE_GET_CLASS(xi);
ICSState *ics;
uint32_t irq;
@@ -306,13 +307,13 @@ void icp_eoi(ICPState *ss, uint32_t xirr)
ss->xirr = (ss->xirr & ~CPPR_MASK) | (xirr & CPPR_MASK);
trace_xics_icp_eoi(ss->cs->cpu_index, xirr, ss->xirr);
irq = xirr & XISR_MASK;
- QLIST_FOREACH(ics, &ss->xics->ics, list) {
- if (ics_valid_irq(ics, irq)) {
- ics_eoi(ics, irq);
- }
+
+ ics = xic->ics_get(xi, irq);
+ if (ics) {
+ ics_eoi(ics, irq);
}
if (!XISR(ss)) {
- icp_resend(ss);
+ icp_resend(xi, ss);
}
}
@@ -592,10 +593,11 @@ static void ics_simple_reset(DeviceState *dev)
static int ics_simple_post_load(ICSState *ics, int version_id)
{
+ XICSInterface *xi = XICS_INTERFACE(qdev_get_machine());
int i;
for (i = 0; i < ics->xics->nr_servers; i++) {
- icp_resend(&ics->xics->ss[i]);
+ icp_resend(xi, &ics->xics->ss[i]);
}
return 0;
--
2.7.4
- Re: [Qemu-ppc] [PATCH v2 04/22] ppc/xics: add an InterruptStatsProvider interface to ICS and ICP objects, (continued)
- [Qemu-ppc] [PATCH v2 05/22] ppc/xics: introduce a QOM interface to handle ICSs, Cédric Le Goater, 2017/02/16
- [Qemu-ppc] [PATCH v2 06/22] ppc/xics: use the QOM interface under the sPAPR machine, Cédric Le Goater, 2017/02/16
- [Qemu-ppc] [PATCH v2 07/22] ppc/xics: use the QOM interface to get irqs, Cédric Le Goater, 2017/02/16
- [Qemu-ppc] [PATCH v2 08/22] ppc/xics: use the QOM interface to resend irqs,
Cédric Le Goater <=
- Re: [Qemu-ppc] [PATCH v2 08/22] ppc/xics: use the QOM interface to resend irqs, David Gibson, 2017/02/22
- Re: [Qemu-ppc] [PATCH v2 08/22] ppc/xics: use the QOM interface to resend irqs, Cédric Le Goater, 2017/02/24
- Re: [Qemu-ppc] [PATCH v2 08/22] ppc/xics: use the QOM interface to resend irqs, Cédric Le Goater, 2017/02/24
- Re: [Qemu-ppc] [PATCH v2 08/22] ppc/xics: use the QOM interface to resend irqs, David Gibson, 2017/02/26
- Re: [Qemu-ppc] [PATCH v2 08/22] ppc/xics: use the QOM interface to resend irqs, David Gibson, 2017/02/26
- Re: [Qemu-ppc] [PATCH v2 08/22] ppc/xics: use the QOM interface to resend irqs, Cédric Le Goater, 2017/02/27
- [Qemu-ppc] [PATCH v2 09/22] ppc/xics: remove xics_find_source(), Cédric Le Goater, 2017/02/16
- [Qemu-ppc] [PATCH v2 10/22] ppc/xics: register the reset handler of ICS objects, Cédric Le Goater, 2017/02/16