/**
* SuperHCPUClass:
+ * @parent_realize: The parent class' realize handler.
* @parent_reset: The parent class' reset handler.
*
* A SuperH CPU model.
CPUClass parent_class;
/*< public >*/
+ DeviceRealize parent_realize;
void (*parent_reset)(CPUState *cpu);
} SuperHCPUClass;
set_default_nan_mode(1, &env->fp_status);
}
+static void superh_cpu_realizefn(DeviceState *dev, Error **errp)
+{
+ SuperHCPU *cpu = SUPERH_CPU(dev);
+ SuperHCPUClass *scc = SUPERH_CPU_GET_CLASS(dev);
+
+ cpu_reset(CPU(cpu));
+ qemu_init_vcpu(&cpu->env);
+
+ scc->parent_realize(dev, errp);
+}
+
static void superh_cpu_initfn(Object *obj)
{
SuperHCPU *cpu = SUPERH_CPU(obj);
CPUClass *cc = CPU_CLASS(oc);
SuperHCPUClass *scc = SUPERH_CPU_CLASS(oc);
+ scc->parent_realize = dc->realize;
+ dc->realize = superh_cpu_realizefn;
+
scc->parent_reset = cc->reset;
cc->reset = superh_cpu_reset;
env->features = def->features;
sh4_translate_init();
env->cpu_model_str = cpu_model;
- cpu_reset(CPU(cpu));
cpu_register(env, def);
- qemu_init_vcpu(env);
+
+ object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
+
return cpu;
}