target/m68k: Fix initialization of m68k targets

m68k is now able to be used for emulation again. It just needed to
properly have the unicorn context be set within the base type for the
CPUs
This commit is contained in:
Lioncash 2018-09-03 17:04:38 -04:00
parent 3dc1c40462
commit 44ca501cd3
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 4 additions and 3 deletions

View file

@ -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;

View file

@ -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));
}