On 2/20/24 06:06, Peter Maydell wrote:
Implement new functions qemu_register_resettable() and
qemu_unregister_resettable().  These are intended to be
three-phase-reset aware equivalents of the old qemu_register_reset()
and qemu_unregister_reset().  Instead of passing in a function
pointer and opaque, you register any QOM object that implements the
Resettable interface.

The implementation is simple: we have a single global instance of a
ResettableContainer, which we reset in qemu_devices_reset(), and
the Resettable objects passed to qemu_register_resettable() are
added to it.

Signed-off-by: Peter Maydell<peter.mayd...@linaro.org>
---
  include/sysemu/reset.h | 37 ++++++++++++++++++++++++++++++++++---
  hw/core/reset.c        | 31 +++++++++++++++++++++++++++++--
  2 files changed, 63 insertions(+), 5 deletions(-)

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>

r~

Reply via email to