From 5087a72cb3e94f48c1d447babd67e33bfd9dda12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 11 Apr 2012 18:24:49 +0200 Subject: target-xtensa: QOM'ify CPU reset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move code from cpu_state_reset() into QOM xtensa_cpu_reset(). To avoid moving reset_mmu() and dependencies, make it non-static. Signed-off-by: Andreas Färber Signed-off-by: Max Filippov --- target-xtensa/cpu.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'target-xtensa/cpu.c') diff --git a/target-xtensa/cpu.c b/target-xtensa/cpu.c index d68be226ee..55d2dea266 100644 --- a/target-xtensa/cpu.c +++ b/target-xtensa/cpu.c @@ -1,6 +1,7 @@ /* * QEMU Xtensa CPU * + * Copyright (c) 2011, Max Filippov, Open Source and Linux Lab. * Copyright (c) 2012 SUSE LINUX Products GmbH * All rights reserved. * @@ -40,7 +41,16 @@ static void xtensa_cpu_reset(CPUState *s) xcc->parent_reset(s); - cpu_state_reset(env); + env->exception_taken = 0; + env->pc = env->config->exception_vector[EXC_RESET]; + env->sregs[LITBASE] &= ~1; + env->sregs[PS] = xtensa_option_enabled(env->config, + XTENSA_OPTION_INTERRUPT) ? 0x1f : 0x10; + env->sregs[VECBASE] = env->config->vecbase; + env->sregs[IBREAKENABLE] = 0; + + env->pending_irq_level = 0; + reset_mmu(env); } static void xtensa_cpu_class_init(ObjectClass *oc, void *data) -- cgit v1.2.1