ppc/xics: register the reset handler of ICS objects
authorCédric Le Goater <clg@kaod.org>
Mon, 27 Feb 2017 14:29:19 +0000 (15:29 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 1 Mar 2017 00:23:39 +0000 (11:23 +1100)
The reset of the ICS objects is currently handled by XICS but this can
be done for each individual ICS. This also reduces the use of the XICS
list of ICS.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/intc/xics.c
hw/ppc/spapr.c

index a71d3858b13fc08cb137ca6cc1222f4cbdd5a58d..97775c2b61e5f18f5ed18cf1f9109cdb4e8bbc20 100644 (file)
@@ -139,16 +139,11 @@ static void ics_simple_pic_print_info(InterruptStatsProvider *obj,
 static void xics_common_reset(DeviceState *d)
 {
     XICSState *xics = XICS_COMMON(d);
-    ICSState *ics;
     int i;
 
     for (i = 0; i < xics->nr_servers; i++) {
         device_reset(DEVICE(&xics->ss[i]));
     }
-
-    QLIST_FOREACH(ics, &xics->ics, list) {
-        device_reset(DEVICE(ics));
-    }
 }
 
 static void xics_common_initfn(Object *obj)
index a4e4b86d3773a0fa9abacadf6a8706113ba164e5..a5e6072a805c3c23781be06da32f4e8ade889064 100644 (file)
@@ -114,6 +114,7 @@ static XICSState *try_create_xics(sPAPRMachineState *spapr,
     }
 
     ics = ICS_SIMPLE(object_new(type_ics));
+    qdev_set_parent_bus(DEVICE(ics), sysbus_get_default());
     object_property_add_child(OBJECT(spapr), "ics", OBJECT(ics), NULL);
     object_property_set_int(OBJECT(ics), nr_irqs, "nr-irqs", &err);
     object_property_add_const_link(OBJECT(ics), "xics", OBJECT(xics), NULL);