From 0ad97c7ee346c003b9a50968b2d77289b058cce5 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 2 Sep 2018 16:02:17 -0400 Subject: [PATCH] hw/tosa: Fix initialization of AArch32 CPUs We have to ensure that we pass the proper formatted name into cpu_new() --- qemu/hw/arm/tosa.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/qemu/hw/arm/tosa.c b/qemu/hw/arm/tosa.c index 3aa40192..76af6b11 100644 --- a/qemu/hw/arm/tosa.c +++ b/qemu/hw/arm/tosa.c @@ -21,12 +21,7 @@ static int tosa_init(struct uc_struct *uc, MachineState *machine) { - if (uc->mode & UC_MODE_MCLASS) { - uc->cpu = cpu_create(uc, "cortex-m3"); - } else { - uc->cpu = cpu_create(uc, "cortex-a15"); - } - + uc->cpu = cpu_create(uc, machine->cpu_type); return 0; } @@ -35,6 +30,12 @@ static void tosa_machine_init(struct uc_struct *uc, MachineClass *mc) mc->init = tosa_init; mc->is_default = 1; mc->arch = UC_ARCH_ARM; + + if (uc->mode & UC_MODE_MCLASS) { + mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-m3"); + } else { + mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a15"); + } } DEFINE_MACHINE("tosa", tosa_machine_init)