summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorDamien Hedde2020-01-30 17:02:04 +0100
committerPeter Maydell2020-01-30 17:02:04 +0100
commitabb89dbf2bb3c4f8c74da638a610a73db6a7d4af (patch)
tree246cd245db3d89b2f48accb19169844028712bf2 /hw
parenthw/core/qdev: update hotplug reset regarding resettable (diff)
downloadqemu-abb89dbf2bb3c4f8c74da638a610a73db6a7d4af.tar.gz
qemu-abb89dbf2bb3c4f8c74da638a610a73db6a7d4af.tar.xz
qemu-abb89dbf2bb3c4f8c74da638a610a73db6a7d4af.zip
hw/core: deprecate old reset functions and introduce new ones
Deprecate device_legacy_reset(), qdev_reset_all() and qbus_reset_all() to be replaced by new functions device_cold_reset() and bus_cold_reset() which uses resettable API. Also introduce resettable_cold_reset_fn() which may be used as a replacement for qdev_reset_all_fn and qbus_reset_all_fn(). Following patches will be needed to look at legacy reset call sites and switch to resettable api. The legacy functions will be removed when unused. Signed-off-by: Damien Hedde <damien.hedde@greensocs.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20200123132823.1117486-9-damien.hedde@greensocs.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/core/bus.c5
-rw-r--r--hw/core/qdev.c5
-rw-r--r--hw/core/resettable.c5
3 files changed, 15 insertions, 0 deletions
diff --git a/hw/core/bus.c b/hw/core/bus.c
index 2698f715bd..3dc0a825f0 100644
--- a/hw/core/bus.c
+++ b/hw/core/bus.c
@@ -68,6 +68,11 @@ int qbus_walk_children(BusState *bus,
return 0;
}
+void bus_cold_reset(BusState *bus)
+{
+ resettable_reset(OBJECT(bus), RESET_TYPE_COLD);
+}
+
bool bus_is_in_reset(BusState *bus)
{
return resettable_is_in_reset(OBJECT(bus));
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 7697f033b1..3937d1eb1a 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -361,6 +361,11 @@ void qbus_reset_all_fn(void *opaque)
qbus_reset_all(bus);
}
+void device_cold_reset(DeviceState *dev)
+{
+ resettable_reset(OBJECT(dev), RESET_TYPE_COLD);
+}
+
bool device_is_in_reset(DeviceState *dev)
{
return resettable_is_in_reset(OBJECT(dev));
diff --git a/hw/core/resettable.c b/hw/core/resettable.c
index 6e0b0f492f..96a99ce39e 100644
--- a/hw/core/resettable.c
+++ b/hw/core/resettable.c
@@ -264,6 +264,11 @@ void resettable_change_parent(Object *obj, Object *newp, Object *oldp)
}
}
+void resettable_cold_reset_fn(void *opaque)
+{
+ resettable_reset((Object *) opaque, RESET_TYPE_COLD);
+}
+
void resettable_class_set_parent_phases(ResettableClass *rc,
ResettableEnterPhase enter,
ResettableHoldPhase hold,