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>
This commit is contained in:
Andreas Färber 2012-04-15 23:29:19 +02:00
parent 11150915fc
commit 0f71a7095d
5 changed files with 142 additions and 1 deletions

View file

@ -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;