|
| From: | Philippe Mathieu-Daudé |
| Subject: | Re: [PATCH v2 05/23] q800: move CPU object into Q800MachineState |
| Date: | Wed, 31 May 2023 19:43:31 +0200 |
| User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 |
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);
| [Prev in Thread] | Current Thread | [Next in Thread] |