[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH v6 01/10] ppc/xics: introduce a helper to insert a new
From: |
Cédric Le Goater |
Subject: |
[Qemu-ppc] [PATCH v6 01/10] ppc/xics: introduce a helper to insert a new ics |
Date: |
Tue, 8 Nov 2016 09:08:01 +0100 |
Interrupt Control Sources (ICS) are now maintained under a list.
Signed-off-by: Cédric Le Goater <address@hidden>
Reviewed-by: David Gibson <address@hidden>
---
Changes since v5:
- used the helper in xics spapr/kvm
hw/intc/xics.c | 6 ++++++
hw/intc/xics_kvm.c | 4 +---
hw/intc/xics_spapr.c | 4 +---
include/hw/ppc/xics.h | 1 +
4 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index 095c16a30082..f24787e95013 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -151,6 +151,12 @@ static void xics_common_reset(DeviceState *d)
}
}
+void xics_insert_ics(XICSState *xics, ICSState *ics)
+{
+ ics->xics = xics;
+ QLIST_INSERT_HEAD(&xics->ics, ics, list);
+}
+
static void xics_prop_get_nr_irqs(Object *obj, Visitor *v, const char *name,
void *opaque, Error **errp)
{
diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
index 17694eaa8709..9b21281c4211 100644
--- a/hw/intc/xics_kvm.c
+++ b/hw/intc/xics_kvm.c
@@ -474,13 +474,11 @@ fail:
static void xics_kvm_initfn(Object *obj)
{
- XICSState *xics = XICS_COMMON(obj);
ICSState *ics;
ics = ICS_SIMPLE(object_new(TYPE_ICS_KVM));
object_property_add_child(obj, "ics", OBJECT(ics), NULL);
- ics->xics = xics;
- QLIST_INSERT_HEAD(&xics->ics, ics, list);
+ xics_insert_ics(XICS_COMMON(obj), ics);
}
static void xics_kvm_class_init(ObjectClass *oc, void *data)
diff --git a/hw/intc/xics_spapr.c b/hw/intc/xics_spapr.c
index 2e3f1c5e95b2..33afa9ecbf38 100644
--- a/hw/intc/xics_spapr.c
+++ b/hw/intc/xics_spapr.c
@@ -302,13 +302,11 @@ static void xics_spapr_realize(DeviceState *dev, Error
**errp)
static void xics_spapr_initfn(Object *obj)
{
- XICSState *xics = XICS_SPAPR(obj);
ICSState *ics;
ics = ICS_SIMPLE(object_new(TYPE_ICS_SIMPLE));
object_property_add_child(obj, "ics", OBJECT(ics), NULL);
- ics->xics = xics;
- QLIST_INSERT_HEAD(&xics->ics, ics, list);
+ xics_insert_ics(XICS_COMMON(obj), ics);
}
static void xics_spapr_class_init(ObjectClass *oc, void *data)
diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
index 3f0c31610aa4..1ee8663e9889 100644
--- a/include/hw/ppc/xics.h
+++ b/include/hw/ppc/xics.h
@@ -209,5 +209,6 @@ void ics_simple_write_xive(ICSState *ics, int nr, int
server,
void ics_set_irq_type(ICSState *ics, int srcno, bool lsi);
ICSState *xics_find_source(XICSState *icp, int irq);
+void xics_insert_ics(XICSState *xics, ICSState *ics);
#endif /* XICS_H */
--
2.7.4
- [Qemu-ppc] [PATCH v6 00/10] ppc/pnv: reworking the interrupt controller, Cédric Le Goater, 2016/11/08
- [Qemu-ppc] [PATCH v6 01/10] ppc/xics: introduce a helper to insert a new ics,
Cédric Le Goater <=
- [Qemu-ppc] [PATCH v6 02/10] ppc/xics: add a xics_get_cpu_index_by_pir helper, Cédric Le Goater, 2016/11/08
- [Qemu-ppc] [PATCH v6 03/10] ppc/xics: add a 'realize' handler to the xics_common class, Cédric Le Goater, 2016/11/08
- [Qemu-ppc] [PATCH v6 04/10] ppc/xics: add a 'set_nr_servers' handler to the xics_common class, Cédric Le Goater, 2016/11/08
- [Qemu-ppc] [PATCH v6 05/10] ppc/pnv: add a XICS object to the PowerNV machine, Cédric Le Goater, 2016/11/08
- [Qemu-ppc] [PATCH v6 06/10] ppc/pnv: add MMIO regions for ICPs, Cédric Le Goater, 2016/11/08
- [Qemu-ppc] [PATCH v6 07/10] ppc/pnv: link the CPUs to the machine XICS, Cédric Le Goater, 2016/11/08
- [Qemu-ppc] [PATCH v6 08/10] ppc/pnv: Add cut down PSI bridge model and hookup external interrupt, Cédric Le Goater, 2016/11/08
- [Qemu-ppc] [PATCH v6 09/10] ppc/pnv: Add OCC model stub with interrupt support, Cédric Le Goater, 2016/11/08
- [Qemu-ppc] [PATCH v6 10/10] ppc/pnv: Add Naples chip support for LPC interrupts, Cédric Le Goater, 2016/11/08