[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/36] hw/core/cpu-common: Convert TYPE_CPU class to 3-phase reset
From: |
Peter Maydell |
Subject: |
[PULL 11/36] hw/core/cpu-common: Convert TYPE_CPU class to 3-phase reset |
Date: |
Fri, 16 Dec 2022 21:42:19 +0000 |
Convert the parent class TYPE_CPU to 3-phase reset. This
is a necessary prerequisite to converting the subclasses.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20221124115023.2437291-2-peter.maydell@linaro.org
---
hw/core/cpu-common.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c
index f9fdd46b9d7..78b5f350a00 100644
--- a/hw/core/cpu-common.c
+++ b/hw/core/cpu-common.c
@@ -116,9 +116,9 @@ void cpu_reset(CPUState *cpu)
trace_guest_cpu_reset(cpu);
}
-static void cpu_common_reset(DeviceState *dev)
+static void cpu_common_reset_hold(Object *obj)
{
- CPUState *cpu = CPU(dev);
+ CPUState *cpu = CPU(obj);
CPUClass *cc = CPU_GET_CLASS(cpu);
if (qemu_loglevel_mask(CPU_LOG_RESET)) {
@@ -259,6 +259,7 @@ static int64_t cpu_common_get_arch_id(CPUState *cpu)
static void cpu_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
CPUClass *k = CPU_CLASS(klass);
k->parse_features = cpu_common_parse_features;
@@ -269,7 +270,7 @@ static void cpu_class_init(ObjectClass *klass, void *data)
set_bit(DEVICE_CATEGORY_CPU, dc->categories);
dc->realize = cpu_common_realizefn;
dc->unrealize = cpu_common_unrealizefn;
- dc->reset = cpu_common_reset;
+ rc->phases.hold = cpu_common_reset_hold;
cpu_class_init_props(dc);
/*
* Reason: CPUs still need special care by board code: wiring up
--
2.25.1
- [PULL 22/36] target/openrisc: Convert to 3-phase reset, (continued)
- [PULL 22/36] target/openrisc: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 09/36] hw/misc/mos6522: Convert TYPE_MOS6522 to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 07/36] hw/input/ps2: Convert TYPE_PS2_DEVICE to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 12/36] target/arm: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 04/36] Replace use of qdev_reset_all() with device_cold_reset(), Peter Maydell, 2022/12/16
- [PULL 05/36] qdev: Remove qdev_reset_all() and qbus_reset_all(), Peter Maydell, 2022/12/16
- [PULL 06/36] hw: Remove device_legacy_reset(), Peter Maydell, 2022/12/16
- [PULL 14/36] target/cris: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 08/36] hw/input/ps2.c: Convert TYPE_PS2_{KBD, MOUSE}_DEVICE to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 10/36] hw/misc: Convert TYPE_MOS6522 subclasses to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 11/36] hw/core/cpu-common: Convert TYPE_CPU class to 3-phase reset,
Peter Maydell <=
- [PULL 15/36] target/hexagon: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 16/36] target/i386: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 17/36] target/loongarch: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 18/36] target/m68k: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 21/36] target/nios2: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 25/36] target/rx: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 24/36] target/riscv: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 26/36] target/sh4: Convert to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 32/36] pci: Convert TYPE_PCIE_ROOT_PORT to 3-phase reset, Peter Maydell, 2022/12/16
- [PULL 33/36] pci: Convert child classes of TYPE_PCIE_ROOT_PORT to 3-phase reset, Peter Maydell, 2022/12/16