summaryrefslogtreecommitdiff
path: root/target-xtensa/helper.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-04-11 18:24:48 +0200
committerMax Filippov <jcmvbkbc@gmail.com>2012-04-14 03:48:08 +0400
commita4633e16d77bd1cf0c25e500d15943499b94f2f9 (patch)
treeb065c94b19193050b6137be021c39a60cb2b0cbc /target-xtensa/helper.c
parent7d6b9f0a3838632b4c553e0a387af0bbdf4297c0 (diff)
downloadqemu-a4633e16d77bd1cf0c25e500d15943499b94f2f9.tar.gz
target-xtensa: QOM'ify CPU
Embed CPUXtensaState as first member of XtensaCPU. Let CPUClass::reset() call cpu_state_reset() for now. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'target-xtensa/helper.c')
-rw-r--r--target-xtensa/helper.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/target-xtensa/helper.c b/target-xtensa/helper.c
index dab135c4a9..20338e61c6 100644
--- a/target-xtensa/helper.c
+++ b/target-xtensa/helper.c
@@ -95,6 +95,7 @@ CPUXtensaState *cpu_xtensa_init(const char *cpu_model)
{
static int tcg_inited;
static int debug_handler_inited;
+ XtensaCPU *cpu;
CPUXtensaState *env;
const XtensaConfig *config = NULL;
XtensaConfigList *core = xtensa_cores;
@@ -109,7 +110,8 @@ CPUXtensaState *cpu_xtensa_init(const char *cpu_model)
return NULL;
}
- env = g_malloc0(sizeof(*env));
+ cpu = XTENSA_CPU(object_new(TYPE_XTENSA_CPU));
+ env = &cpu->env;
env->config = config;
cpu_exec_init(env);