[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/26] pnv/xive: Use device_class_set_parent_realize()
From: |
David Gibson |
Subject: |
[PULL 15/26] pnv/xive: Use device_class_set_parent_realize() |
Date: |
Wed, 8 Jan 2020 16:23:01 +1100 |
From: Greg Kurz <address@hidden>
The XIVE router base class currently inherits an empty realize hook
from the sysbus device base class, but it will soon implement one
of its own to perform some sanity checks. Do the preliminary plumbing
to have it called.
Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/intc/pnv_xive.c | 10 ++++++++++
include/hw/ppc/pnv_xive.h | 10 ++++++++++
2 files changed, 20 insertions(+)
diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c
index a0a69b98a7..6412cf222e 100644
--- a/hw/intc/pnv_xive.c
+++ b/hw/intc/pnv_xive.c
@@ -1816,10 +1816,17 @@ static void pnv_xive_init(Object *obj)
static void pnv_xive_realize(DeviceState *dev, Error **errp)
{
PnvXive *xive = PNV_XIVE(dev);
+ PnvXiveClass *pxc = PNV_XIVE_GET_CLASS(dev);
XiveSource *xsrc = &xive->ipi_source;
XiveENDSource *end_xsrc = &xive->end_source;
Error *local_err = NULL;
+ pxc->parent_realize(dev, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
+
assert(xive->chip);
/*
@@ -1947,10 +1954,12 @@ static void pnv_xive_class_init(ObjectClass *klass,
void *data)
XiveRouterClass *xrc = XIVE_ROUTER_CLASS(klass);
XiveNotifierClass *xnc = XIVE_NOTIFIER_CLASS(klass);
XivePresenterClass *xpc = XIVE_PRESENTER_CLASS(klass);
+ PnvXiveClass *pxc = PNV_XIVE_CLASS(klass);
xdc->dt_xscom = pnv_xive_dt_xscom;
dc->desc = "PowerNV XIVE Interrupt Controller";
+ device_class_set_parent_realize(dc, pnv_xive_realize,
&pxc->parent_realize);
dc->realize = pnv_xive_realize;
dc->props = pnv_xive_properties;
@@ -1971,6 +1980,7 @@ static const TypeInfo pnv_xive_info = {
.instance_init = pnv_xive_init,
.instance_size = sizeof(PnvXive),
.class_init = pnv_xive_class_init,
+ .class_size = sizeof(PnvXiveClass),
.interfaces = (InterfaceInfo[]) {
{ TYPE_PNV_XSCOM_INTERFACE },
{ }
diff --git a/include/hw/ppc/pnv_xive.h b/include/hw/ppc/pnv_xive.h
index f4c7caad40..76cf16f644 100644
--- a/include/hw/ppc/pnv_xive.h
+++ b/include/hw/ppc/pnv_xive.h
@@ -16,6 +16,10 @@ struct PnvChip;
#define TYPE_PNV_XIVE "pnv-xive"
#define PNV_XIVE(obj) OBJECT_CHECK(PnvXive, (obj), TYPE_PNV_XIVE)
+#define PNV_XIVE_CLASS(klass) \
+ OBJECT_CLASS_CHECK(PnvXiveClass, (klass), TYPE_PNV_XIVE)
+#define PNV_XIVE_GET_CLASS(obj) \
+ OBJECT_GET_CLASS(PnvXiveClass, (obj), TYPE_PNV_XIVE)
#define XIVE_BLOCK_MAX 16
@@ -85,6 +89,12 @@ typedef struct PnvXive {
uint64_t edt[XIVE_TABLE_EDT_MAX];
} PnvXive;
+typedef struct PnvXiveClass {
+ XiveRouterClass parent_class;
+
+ DeviceRealize parent_realize;
+} PnvXiveClass;
+
void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon);
#endif /* PPC_PNV_XIVE_H */
--
2.24.1
- [PULL 04/26] ppc/spapr: Support reboot of secure pseries guest, (continued)
- [PULL 04/26] ppc/spapr: Support reboot of secure pseries guest, David Gibson, 2020/01/08
- [PULL 05/26] ppc/pnv: Modify the powerdown notifier to get the PowerNV machine, David Gibson, 2020/01/08
- [PULL 02/26] target/ppc: Handle AIL=0 in ppc_excp_vector_offset, David Gibson, 2020/01/08
- [PULL 10/26] ppc440_bamboo.c: remove label from bamboo_load_device_tree(), David Gibson, 2020/01/08
- [PULL 08/26] ppc/spapr: Don't call KVM_SVM_OFF ioctl on TCG, David Gibson, 2020/01/08
- [PULL 07/26] spapr/xive: Use device_class_set_parent_realize(), David Gibson, 2020/01/08
- [PULL 16/26] spapr, pnv, xive: Add a "xive-fabric" link to the XIVE router, David Gibson, 2020/01/08
- [PULL 25/26] ppc/pnv: check return value of blk_pwrite(), David Gibson, 2020/01/08
- [PULL 09/26] spapr.c: remove 'out' label in spapr_dt_cas_updates(), David Gibson, 2020/01/08
- [PULL 18/26] ppc/pnv: Add an "nr-threads" property to the base chip class, David Gibson, 2020/01/08
- [PULL 15/26] pnv/xive: Use device_class_set_parent_realize(),
David Gibson <=
- [PULL 22/26] pnv/xive: Deduce the PnvXive pointer from XiveTCTX::xptr, David Gibson, 2020/01/08
- [PULL 14/26] ppc/pnv: Introduce a "xics" property under the POWER8 chip, David Gibson, 2020/01/08
- [PULL 19/26] ppc/pnv: Add a "pnor" const link property to the BMC internal simulator, David Gibson, 2020/01/08
- [PULL 13/26] ppc/pnv: Introduce a "xics" property alias under the PSI model, David Gibson, 2020/01/08
- [PULL 17/26] xive: Use the XIVE fabric link under the XIVE router, David Gibson, 2020/01/08
- [PULL 21/26] spapr/xive: Deduce the SpaprXive pointer from XiveTCTX::xptr, David Gibson, 2020/01/08
- [PULL 06/26] mos6522: remove anh register, David Gibson, 2020/01/08
- [PULL 11/26] ppc/pnv: Drop "num-chips" machine property, David Gibson, 2020/01/08
- [PULL 03/26] linux-headers: Update, David Gibson, 2020/01/08
- [PULL 12/26] spapr/xive: remove redundant check in spapr_match_nvt(), David Gibson, 2020/01/08