[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 16/20] xics: introduce macros for ICP/ICS link properti
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 16/20] xics: introduce macros for ICP/ICS link properties |
Date: |
Fri, 9 Jun 2017 15:26:48 +1000 |
From: Greg Kurz <address@hidden>
These properties are part of the XICS API. They deserve to appear
explicitely in the XICS header file.
Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/intc/xics.c | 8 ++++----
hw/ppc/pnv_core.c | 3 ++-
hw/ppc/pnv_psi.c | 3 ++-
hw/ppc/spapr.c | 3 ++-
hw/ppc/spapr_cpu_core.c | 3 ++-
include/hw/ppc/xics.h | 4 ++++
6 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index ec73f02..aa2c4e7 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -346,9 +346,9 @@ static void icp_realize(DeviceState *dev, Error **errp)
Object *obj;
Error *err = NULL;
- obj = object_property_get_link(OBJECT(dev), "xics", &err);
+ obj = object_property_get_link(OBJECT(dev), ICP_PROP_XICS, &err);
if (!obj) {
- error_setg(errp, "%s: required link 'xics' not found: %s",
+ error_setg(errp, "%s: required link '" ICP_PROP_XICS "' not found: %s",
__func__, error_get_pretty(err));
return;
}
@@ -654,9 +654,9 @@ static void ics_base_realize(DeviceState *dev, Error **errp)
Object *obj;
Error *err = NULL;
- obj = object_property_get_link(OBJECT(dev), "xics", &err);
+ obj = object_property_get_link(OBJECT(dev), ICS_PROP_XICS, &err);
if (!obj) {
- error_setg(errp, "%s: required link 'xics' not found: %s",
+ error_setg(errp, "%s: required link '" ICS_PROP_XICS "' not found: %s",
__func__, error_get_pretty(err));
return;
}
diff --git a/hw/ppc/pnv_core.c b/hw/ppc/pnv_core.c
index e8a9a94..0b6e729 100644
--- a/hw/ppc/pnv_core.c
+++ b/hw/ppc/pnv_core.c
@@ -121,7 +121,8 @@ static void pnv_core_realize_child(Object *child,
XICSFabric *xi, Error **errp)
obj = object_new(TYPE_PNV_ICP);
object_property_add_child(OBJECT(cpu), "icp", obj, &error_abort);
object_unref(obj);
- object_property_add_const_link(obj, "xics", OBJECT(xi), &error_abort);
+ object_property_add_const_link(obj, ICP_PROP_XICS, OBJECT(xi),
+ &error_abort);
object_property_set_bool(obj, true, "realized", &local_err);
if (local_err) {
error_propagate(errp, local_err);
diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c
index 2bf5bfe..9876c26 100644
--- a/hw/ppc/pnv_psi.c
+++ b/hw/ppc/pnv_psi.c
@@ -474,7 +474,8 @@ static void pnv_psi_realize(DeviceState *dev, Error **errp)
}
/* Create PSI interrupt control source */
- object_property_add_const_link(OBJECT(ics), "xics", obj, &error_abort);
+ object_property_add_const_link(OBJECT(ics), ICS_PROP_XICS, obj,
+ &error_abort);
object_property_set_int(OBJECT(ics), PSI_NUM_INTERRUPTS, "nr-irqs", &err);
if (err) {
error_propagate(errp, err);
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 01dda9e..b2951d7 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -107,7 +107,8 @@ static ICSState *spapr_ics_create(sPAPRMachineState *spapr,
obj = object_new(type_ics);
object_property_add_child(OBJECT(spapr), "ics", obj, &error_abort);
- object_property_add_const_link(obj, "xics", OBJECT(spapr), &error_abort);
+ object_property_add_const_link(obj, ICS_PROP_XICS, OBJECT(spapr),
+ &error_abort);
object_property_set_int(obj, nr_irqs, "nr-irqs", &local_err);
if (local_err) {
goto error;
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 029a141..e81879c 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -145,7 +145,8 @@ static void spapr_cpu_core_realize_child(Object *child,
Error **errp)
obj = object_new(spapr->icp_type);
object_property_add_child(OBJECT(cpu), "icp", obj, &error_abort);
object_unref(obj);
- object_property_add_const_link(obj, "xics", OBJECT(spapr), &error_abort);
+ object_property_add_const_link(obj, ICP_PROP_XICS, OBJECT(spapr),
+ &error_abort);
object_property_set_bool(obj, true, "realized", &local_err);
if (local_err) {
goto error;
diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
index 40a506e..3114532 100644
--- a/include/hw/ppc/xics.h
+++ b/include/hw/ppc/xics.h
@@ -86,6 +86,8 @@ struct ICPState {
XICSFabric *xics;
};
+#define ICP_PROP_XICS "xics"
+
struct PnvICPState {
ICPState parent_obj;
@@ -130,6 +132,8 @@ struct ICSState {
XICSFabric *xics;
};
+#define ICS_PROP_XICS "xics"
+
static inline bool ics_valid_irq(ICSState *ics, uint32_t nr)
{
return (ics->offset != 0) && (nr >= ics->offset)
--
2.9.4
- [Qemu-ppc] [PULL 11/20] spapr: Rework DRC name handling, (continued)
- [Qemu-ppc] [PULL 11/20] spapr: Rework DRC name handling, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 15/20] hw/cpu: core.c can be compiled as common object, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 08/20] spapr: Clean up handling of DR-indicator, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 09/20] spapr: Change DRC attach & detach methods to functions, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 17/20] xics: pass appropriate types to realize() handlers., David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 12/20] pnv_core: drop reference on ICPState object during CPU realization, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 13/20] xics: add reset() handler to ICPStateClass, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 20/20] Revert "spapr: fix memory hot-unplugging", David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 18/20] xics: setup cpu at realize time, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 05/20] spapr: Clean up DR entity sense handling, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 16/20] xics: introduce macros for ICP/ICS link properties,
David Gibson <=
- Re: [Qemu-ppc] [PULL 00/20] ppc-for-2.10 queue 20170609, Peter Maydell, 2017/06/13