]> git.proxmox.com Git - mirror_qemu.git/commit
hw/core: add Resettable support to BusClass and DeviceClass
authorDamien Hedde <damien.hedde@greensocs.com>
Thu, 30 Jan 2020 16:02:04 +0000 (16:02 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 30 Jan 2020 16:02:04 +0000 (16:02 +0000)
commitc11256aa6fdd3971ef1dff23dfd8422049558d77
treecb2f02fedade05193332a68f1a71a2e6fca6f338
parentbc5a39bf2688130bae86351a6c6b005cf9566a3c
hw/core: add Resettable support to BusClass and DeviceClass

This commit adds support of Resettable interface to buses and devices:
+ ResettableState structure is added in the Bus/Device state
+ Resettable methods are implemented.
+ device/bus_is_in_reset function defined

This commit allows to transition the objects to the new
multi-phase interface without changing the reset behavior at all.
Object single reset method can be split into the 3 different phases
but the 3 phases are still executed in a row for a given object.
From the qdev/qbus reset api point of view, nothing is changed.
qdev_reset_all() and qbus_reset_all() are not modified as well as
device_legacy_reset().

Transition of an object must be done from parent class to child class.
Care has been taken to allow the transition of a parent class
without requiring the child classes to be transitioned at the same
time. Note that SysBus and SysBusDevice class do not need any transition
because they do not override the legacy reset method.

Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20200123132823.1117486-5-damien.hedde@greensocs.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/core/bus.c
hw/core/qdev.c
include/hw/qdev-core.h
tests/Makefile.include