summaryrefslogtreecommitdiffstats
path: root/target-microblaze/translate.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-04-12 02:17:53 +0200
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2012-04-24 16:04:56 +0200
commitb77f98cadad07a0863a6bfe1492c64f3a16ccbc5 (patch)
treefd7f38f6ce885763259245a9564028e369a8e788 /target-microblaze/translate.c
parentaa0d1267b3aa69c87fbd37a896bdd3f44d45c3f3 (diff)
downloadhqemu-b77f98cadad07a0863a6bfe1492c64f3a16ccbc5.zip
hqemu-b77f98cadad07a0863a6bfe1492c64f3a16ccbc5.tar.gz
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]
Diffstat (limited to 'target-microblaze/translate.c')
-rw-r--r--target-microblaze/translate.c4
1 files changed, 3 insertions, 1 deletions
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 @@ void cpu_dump_state (CPUMBState *env, FILE *f, fprintf_function cpu_fprintf,
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);
OpenPOWER on IntegriCloud