diff --git a/qemu/hw/m68k/dummy_m68k.c b/qemu/hw/m68k/dummy_m68k.c index 3acc3d3c..984fdb36 100644 --- a/qemu/hw/m68k/dummy_m68k.c +++ b/qemu/hw/m68k/dummy_m68k.c @@ -20,9 +20,8 @@ static int dummy_m68k_init(struct uc_struct *uc, MachineState *machine) { CPUM68KState *env; - const char *cpu_type = parse_cpu_model(uc, "cf4ve"); - uc->cpu = cpu_create(uc, cpu_type); + uc->cpu = cpu_create(uc, machine->cpu_type); if (!uc->cpu) { fprintf(stderr, "Unable to find m68k CPU definition\n"); return -1; diff --git a/qemu/target/m68k/cpu.c b/qemu/target/m68k/cpu.c index 1b41c329..55f9cd08 100644 --- a/qemu/target/m68k/cpu.c +++ b/qemu/target/m68k/cpu.c @@ -268,7 +268,7 @@ static void m68k_cpu_class_init(struct uc_struct *uc, ObjectClass *c, void *data initfn, \ } -static const TypeInfo m68k_cpus_type_infos[] = { +static TypeInfo m68k_cpus_type_infos[] = { { /* base class should be registered first */ TYPE_M68K_CPU, TYPE_CPU, @@ -302,5 +302,7 @@ static const TypeInfo m68k_cpus_type_infos[] = { void m68k_cpu_register_types(void *opaque) { + m68k_cpus_type_infos[0].instance_userdata = opaque; + type_register_static_array(opaque, m68k_cpus_type_infos, ARRAY_SIZE(m68k_cpus_type_infos)); }