From fc0ced2fbd8d40672fcdd2f655bbdcd3e278f3ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 11 Apr 2012 01:22:08 +0200 Subject: target-lm32: QOM'ify CPU MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Embed CPULM32State as first member of QOM LM32CPU. Let CPUClass::reset() call cpu_state_reset() for now. Signed-off-by: Andreas Färber Acked-by: Michael Walle --- target-lm32/helper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'target-lm32/helper.c') diff --git a/target-lm32/helper.c b/target-lm32/helper.c index 78076e4603..3cf86d7b76 100644 --- a/target-lm32/helper.c +++ b/target-lm32/helper.c @@ -194,6 +194,7 @@ static uint32_t cfg_by_def(const LM32Def *def) CPULM32State *cpu_lm32_init(const char *cpu_model) { + LM32CPU *cpu; CPULM32State *env; const LM32Def *def; static int tcg_initialized; @@ -203,7 +204,8 @@ CPULM32State *cpu_lm32_init(const char *cpu_model) return NULL; } - env = g_malloc0(sizeof(CPULM32State)); + cpu = LM32_CPU(object_new(TYPE_LM32_CPU)); + env = &cpu->env; env->features = def->features; env->num_bps = def->num_breakpoints; -- cgit v1.2.3