target-cris: QOM'ify CPU

Embed CPUCRISState as first member of QOM CRISCPU.

Let CPUClass::reset() call cpu_state_reset() for now.

Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
Andreas Färber 2012-04-11 23:12:05 +02:00 committed by Edgar E. Iglesias
parent 092dfc7714
commit e739a48e58
5 changed files with 136 additions and 1 deletions

View file

@ -3505,11 +3505,13 @@ static uint32_t vr_by_name(const char *name)
CPUCRISState *cpu_cris_init (const char *cpu_model)
{
CRISCPU *cpu;
CPUCRISState *env;
static int tcg_initialized = 0;
int i;
env = g_malloc0(sizeof(CPUCRISState));
cpu = CRIS_CPU(object_new(TYPE_CRIS_CPU));
env = &cpu->env;
env->pregs[PR_VR] = vr_by_name(cpu_model);
cpu_exec_init(env);