target-microblaze: QOM'ify CPU
Embed CPUMBState as first member of QOM MicroBlazeCPU.
Let CPUClass::reset() call cpu_state_reset() for now.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Tested-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
[AF: Updated cpu.c to include cpu-qom.h indirectly via cpu.h]
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index b602820..f4d32c8 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -1891,11 +1891,13 @@
CPUMBState *cpu_mb_init (const char *cpu_model)
{
+ MicroBlazeCPU *cpu;
CPUMBState *env;
static int tcg_initialized = 0;
int i;
- env = g_malloc0(sizeof(CPUMBState));
+ cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU));
+ env = &cpu->env;
cpu_exec_init(env);
cpu_state_reset(env);