Skip to content

Commit

Permalink
target-cris: Start QOM'ifying CPU init
Browse files Browse the repository at this point in the history
Move VR-independent code from cpu_cris_init() into an initfn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
  • Loading branch information
afaerber committed Apr 13, 2012
1 parent 69cb34c commit 814986f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions target-cris/cpu.c
Expand Up @@ -55,6 +55,14 @@ static void cris_cpu_reset(CPUState *s)
#endif
}

static void cris_cpu_initfn(Object *obj)
{
CRISCPU *cpu = CRIS_CPU(obj);
CPUCRISState *env = &cpu->env;

cpu_exec_init(env);
}

static void cris_cpu_class_init(ObjectClass *oc, void *data)
{
CPUClass *cc = CPU_CLASS(oc);
Expand All @@ -68,6 +76,7 @@ static const TypeInfo cris_cpu_type_info = {
.name = TYPE_CRIS_CPU,
.parent = TYPE_CPU,
.instance_size = sizeof(CRISCPU),
.instance_init = cris_cpu_initfn,
.abstract = false,
.class_size = sizeof(CRISCPUClass),
.class_init = cris_cpu_class_init,
Expand Down
2 changes: 1 addition & 1 deletion target-cris/translate.c
Expand Up @@ -3514,7 +3514,7 @@ CPUCRISState *cpu_cris_init (const char *cpu_model)
env = &cpu->env;

env->pregs[PR_VR] = vr_by_name(cpu_model);
cpu_exec_init(env);

cpu_reset(CPU(cpu));
qemu_init_vcpu(env);

Expand Down

0 comments on commit 814986f

Please sign in to comment.