diff options
author | Andreas Färber <afaerber@suse.de> | 2012-04-15 23:29:19 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-04-30 11:32:13 +0200 |
commit | 0f71a7095db6bc055bc5bb520d85ea650cca8a33 (patch) | |
tree | f7df5f75ee70431f270671936477b793f378c500 /target-mips/translate.c | |
parent | 11150915fcfc44aaf35c807eaa16599eabc9e718 (diff) | |
download | qemu-0f71a7095db6bc055bc5bb520d85ea650cca8a33.zip qemu-0f71a7095db6bc055bc5bb520d85ea650cca8a33.tar.gz qemu-0f71a7095db6bc055bc5bb520d85ea650cca8a33.tar.bz2 |
target-mips: QOM'ify CPU
Embed CPUMIPSState as first member of QOM MIPSCPU.
Let CPUClass::reset() call cpu_state_reset() for now.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-mips/translate.c')
-rw-r--r-- | target-mips/translate.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/target-mips/translate.c b/target-mips/translate.c index a663b74..b10ec21 100644 --- a/target-mips/translate.c +++ b/target-mips/translate.c @@ -12691,13 +12691,15 @@ static void mips_tcg_init(void) CPUMIPSState *cpu_mips_init (const char *cpu_model) { + MIPSCPU *cpu; CPUMIPSState *env; const mips_def_t *def; def = cpu_mips_find_by_name(cpu_model); if (!def) return NULL; - env = g_malloc0(sizeof(CPUMIPSState)); + cpu = MIPS_CPU(object_new(TYPE_MIPS_CPU)); + env = &cpu->env; env->cpu_model = def; env->cpu_model_str = cpu_model; |