qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 05/23] q800: move CPU object into Q800MachineState


From: Mark Cave-Ayland
Subject: Re: [PATCH v2 05/23] q800: move CPU object into Q800MachineState
Date: Sat, 3 Jun 2023 21:36:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0

On 31/05/2023 18:43, Philippe Mathieu-Daudé wrote:

On 31/5/23 14:53, Mark Cave-Ayland wrote:
Also change the instantiation of the CPU to use object_initialize_child()
followed by a separate realisation.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
  hw/m68k/q800.c         | 13 ++++++++-----
  include/hw/m68k/q800.h |  2 ++
  2 files changed, 10 insertions(+), 5 deletions(-)


@@ -407,8 +407,10 @@ static void q800_machine_init(MachineState *machine)
      }
      /* init CPUs */
-    cpu = M68K_CPU(cpu_create(machine->cpu_type));
-    qemu_register_reset(main_cpu_reset, cpu);
+    object_initialize_child(OBJECT(machine), "cpu", &m->cpu,
+                            M68K_CPU_TYPE_NAME("m68040"));

Shouldn't we keep using machine->cpu_type?

If the m68040 is the single CPU usable, we should set
MachineClass::valid_cpu_types[] in q800_machine_class_init().

+    object_property_set_bool(OBJECT(&m->cpu), "realized", true, &error_fatal);
+    qemu_register_reset(main_cpu_reset, &m->cpu);

Yes I can do that: I don't think it makes any difference to the q800 machine here because the MacOS toolbox ROM doesn't appear to boot with anything other than a 68040 CPU, but it could be useful to make this explicit.


ATB,

Mark.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]