[RFC PATCH v2 12/14] hw/alpha: add a reset function for the clipper machine

Alex Bennée posted 14 patches 1 month, 3 weeks ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Thomas Huth <huth@tuxfamily.org>, Laurent Vivier <laurent@vivier.eu>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, Peter Maydell <peter.maydell@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <arikalo@gmail.com>, Bastian Koppelmann <kbastian@rumtueddeln.de>
[RFC PATCH v2 12/14] hw/alpha: add a reset function for the clipper machine
Posted by Alex Bennée 1 month, 3 weeks ago
Once this is setup we can move CPU reset to a 3-phase reset handler.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 hw/alpha/dp264.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index 98219f04569..f660fc41bcd 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -17,6 +17,7 @@
 #include "hw/ide/pci.h"
 #include "hw/isa/superio.h"
 #include "qemu/datadir.h"
+#include "system/reset.h"
 
 static uint64_t cpu_alpha_superpage_to_phys(void *opaque, uint64_t addr)
 {
@@ -42,6 +43,14 @@ static int clipper_pci_map_irq(PCIDevice *d, int irq_num)
     return (slot + 1) * 4 + irq_num;
 }
 
+static void clipper_reset(MachineState *ms, ResetType type)
+{
+   CPUState *cs = first_cpu;
+
+   qemu_devices_reset(type);
+   cpu_reset(cs);
+}
+
 static void clipper_init(MachineState *machine)
 {
     ram_addr_t ram_size = machine->ram_size;
@@ -205,6 +214,7 @@ static void clipper_machine_init(MachineClass *mc)
 {
     mc->desc = "Alpha DP264/CLIPPER";
     mc->init = clipper_init;
+    mc->reset = clipper_reset;
     mc->block_default_type = IF_IDE;
     mc->max_cpus = 4;
     mc->is_default = true;
-- 
2.47.3


Re: [RFC PATCH v2 12/14] hw/alpha: add a reset function for the clipper machine
Posted by Pierrick Bouvier 1 month, 3 weeks ago
On 2/19/26 9:18 AM, Alex Bennée wrote:
> Once this is setup we can move CPU reset to a 3-phase reset handler.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   hw/alpha/dp264.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>