diff options
author | Andreas Färber <afaerber@suse.de> | 2012-04-11 18:24:50 +0200 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2012-04-14 03:48:08 +0400 |
commit | e554bbc6892394e506f5995ff4e0ca21cfe04a25 (patch) | |
tree | fae0ac266a9c4f7fe005136e1f816ae2ce49911a /target-xtensa/cpu.c | |
parent | 5087a72cb3e94f48c1d447babd67e33bfd9dda12 (diff) |
target-xtensa: Start QOM'ifying CPU init
Move XtensaConfig-independent code from cpu_xtensa_init() into a
QOM initfn, as a start.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'target-xtensa/cpu.c')
-rw-r--r-- | target-xtensa/cpu.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/target-xtensa/cpu.c b/target-xtensa/cpu.c index 55d2dea266..97deacb478 100644 --- a/target-xtensa/cpu.c +++ b/target-xtensa/cpu.c @@ -53,6 +53,14 @@ static void xtensa_cpu_reset(CPUState *s) reset_mmu(env); } +static void xtensa_cpu_initfn(Object *obj) +{ + XtensaCPU *cpu = XTENSA_CPU(obj); + CPUXtensaState *env = &cpu->env; + + cpu_exec_init(env); +} + static void xtensa_cpu_class_init(ObjectClass *oc, void *data) { CPUClass *cc = CPU_CLASS(oc); @@ -66,6 +74,7 @@ static const TypeInfo xtensa_cpu_type_info = { .name = TYPE_XTENSA_CPU, .parent = TYPE_CPU, .instance_size = sizeof(XtensaCPU), + .instance_init = xtensa_cpu_initfn, .abstract = false, .class_size = sizeof(XtensaCPUClass), .class_init = xtensa_cpu_class_init, |