target-m68k: Introduce QOM realizefn for M68kCPU
Introduce realizefn and set realized = true in cpu_m68k_init().
Split off GDB registration to a new m68k_cpu_init_gdb() so that it can
be called from the realizefn.
Signed-off-by: Andreas Färber <afaerber@suse.de>
diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index 5ddcd70..3ae6fa0 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -120,15 +120,21 @@
env->cpu_model_str = cpu_model;
register_m68k_insns(env);
+
+ object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
+
+ return env;
+}
+
+void m68k_cpu_init_gdb(M68kCPU *cpu)
+{
+ CPUM68KState *env = &cpu->env;
+
if (m68k_feature(env, M68K_FEATURE_CF_FPU)) {
gdb_register_coprocessor(env, fpu_gdb_get_reg, fpu_gdb_set_reg,
11, "cf-fp.xml", 18);
}
/* TODO: Add [E]MAC registers. */
-
- cpu_reset(ENV_GET_CPU(env));
- qemu_init_vcpu(env);
- return env;
}
void cpu_m68k_flush_flags(CPUM68KState *env, int cc_op)