[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 20/26] ppc/xive: introduce a helper to create XI
From: |
Cédric Le Goater |
Subject: |
[Qemu-devel] [RFC PATCH 20/26] ppc/xive: introduce a helper to create XIVE interrupt source objects |
Date: |
Wed, 5 Jul 2017 19:13:33 +0200 |
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/intc/xive.c | 21 +++++++++++++++++++++
include/hw/ppc/xive.h | 4 ++++
2 files changed, 25 insertions(+)
diff --git a/hw/intc/xive.c b/hw/intc/xive.c
index 895dd2b2f61b..bec123649ebd 100644
--- a/hw/intc/xive.c
+++ b/hw/intc/xive.c
@@ -726,6 +726,27 @@ static const TypeInfo xive_ics_info = {
.class_init = xive_ics_class_init,
};
+void xive_ics_create(XiveICSState *xs, XIVE *x, uint32_t offset,
+ uint32_t nr_irqs, uint32_t shift,
+ uint32_t flags, Error **errp)
+{
+ Error *error = NULL;
+
+ object_property_add_const_link(OBJECT(xs), "xive", OBJECT(x),
+ &error_fatal);
+ object_property_add_const_link(OBJECT(xs), "xics",
+ OBJECT(qdev_get_machine()), &error_fatal);
+ object_property_set_int(OBJECT(xs), shift, "shift", &error_fatal);
+ object_property_set_int(OBJECT(xs), flags, "flags", &error_fatal);
+ object_property_set_int(OBJECT(xs), offset, "irq-base", &error_fatal);
+ object_property_set_int(OBJECT(xs), nr_irqs, "nr-irqs", &error_fatal);
+ object_property_set_bool(OBJECT(xs), true, "realized", &error);
+ if (error) {
+ error_propagate(errp, error);
+ return;
+ }
+}
+
/*
* Main XIVE object
*/
diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h
index 560f6ab66f73..a1c7797658ba 100644
--- a/include/hw/ppc/xive.h
+++ b/include/hw/ppc/xive.h
@@ -70,4 +70,8 @@ void xive_spapr_populate(XIVE *x, void *fdt);
void xive_mmio_map(XIVE *x);
+void xive_ics_create(XiveICSState *xs, XIVE *x, uint32_t offset,
+ uint32_t nr_irqs, uint32_t shift, uint32_t flags,
+ Error **errp);
+
#endif /* PPC_XIVE_H */
--
2.7.5
- [Qemu-devel] [RFC PATCH 16/26] ppc/xive: notify CPU when interrupt priority is more privileged, (continued)
- [Qemu-devel] [RFC PATCH 16/26] ppc/xive: notify CPU when interrupt priority is more privileged, Cédric Le Goater, 2017/07/05
- [Qemu-devel] [RFC PATCH 17/26] ppc/xive: add hcalls support, Cédric Le Goater, 2017/07/05
- [Qemu-devel] [RFC PATCH 18/26] ppc/xive: add device tree support, Cédric Le Goater, 2017/07/05
- [Qemu-devel] [RFC PATCH 19/26] ppc/xive: introduce a helper to map the XIVE memory regions, Cédric Le Goater, 2017/07/05
- [Qemu-devel] [RFC PATCH 20/26] ppc/xive: introduce a helper to create XIVE interrupt source objects,
Cédric Le Goater <=
- [Qemu-devel] [RFC PATCH 21/26] ppc/xive: introduce routines to allocate IRQ numbers, Cédric Le Goater, 2017/07/05
- [Qemu-devel] [RFC PATCH 22/26] ppc/xive: create an XIVE interrupt source to handle IPIs, Cédric Le Goater, 2017/07/05
- [Qemu-devel] [RFC PATCH 23/26] spapr: add a XIVE object to the sPAPR machine, Cédric Le Goater, 2017/07/05
- [Qemu-devel] [RFC PATCH 24/26] spapr: include the XIVE interrupt source for IPIs, Cédric Le Goater, 2017/07/05
- [Qemu-devel] [RFC PATCH 25/26] spapr: print the XIVE interrupt source for IPIs in the monitor, Cédric Le Goater, 2017/07/05
- [Qemu-devel] [RFC PATCH 26/26] spapr: force XIVE exploitation mode for POWER9 (HACK), Cédric Le Goater, 2017/07/05
- Re: [Qemu-devel] [RFC PATCH 00/26] guest exploitation of the XIVE interrupt controller (POWER9), David Gibson, 2017/07/10