From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFTsG-0005d4-Ad for qemu-devel@nongnu.org; Wed, 04 Apr 2012 13:20:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SFTs6-00009I-T0 for qemu-devel@nongnu.org; Wed, 04 Apr 2012 13:19:58 -0400 Received: from cantor2.suse.de ([195.135.220.15]:57425 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFTs6-00008O-MR for qemu-devel@nongnu.org; Wed, 04 Apr 2012 13:19:50 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 4 Apr 2012 19:19:37 +0200 Message-Id: <1333559979-3984-3-git-send-email-afaerber@suse.de> In-Reply-To: <1333559979-3984-1-git-send-email-afaerber@suse.de> References: <1333559979-3984-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 2/4] target-s390x: QOM'ify CPU reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: blauwirbel@gmail.com, Christian Borntraeger , Alexander Graf , anthony@codemonkey.ws, =?UTF-8?q?Andreas=20F=C3=A4rber?= Move code from cpu_state_reset() to s390_cpu_reset(). Signed-off-by: Andreas F=C3=A4rber Tested-by: Christian Borntraeger --- target-s390x/cpu.c | 13 ++++++++++++- target-s390x/helper.c | 12 ++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c index 94320f2..cae0b18 100644 --- a/target-s390x/cpu.c +++ b/target-s390x/cpu.c @@ -1,6 +1,8 @@ /* * QEMU S/390 CPU * + * Copyright (c) 2009 Ulrich Hecht + * Copyright (c) 2011 Alexander Graf * Copyright (c) 2012 SUSE LINUX Products GmbH * * This library is free software; you can redistribute it and/or @@ -23,15 +25,24 @@ #include "qemu-timer.h" =20 =20 +/* CPUClass::reset() */ static void s390_cpu_reset(CPUState *s) { S390CPU *cpu =3D S390_CPU(s); S390CPUClass *scc =3D S390_CPU_GET_CLASS(cpu); CPUS390XState *env =3D &cpu->env; =20 + if (qemu_loglevel_mask(CPU_LOG_RESET)) { + qemu_log("CPU Reset (CPU %d)\n", env->cpu_index); + log_cpu_state(env, 0); + } + scc->parent_reset(s); =20 - cpu_state_reset(env); + memset(env, 0, offsetof(CPUS390XState, breakpoints)); + /* FIXME: reset vector? */ + tlb_flush(env, 1); + s390_add_running_cpu(env); } =20 static void s390_cpu_class_init(ObjectClass *oc, void *data) diff --git a/target-s390x/helper.c b/target-s390x/helper.c index ae57ab3..cd3e8f5 100644 --- a/target-s390x/helper.c +++ b/target-s390x/helper.c @@ -97,7 +97,7 @@ CPUS390XState *cpu_s390x_init(const char *cpu_model) env->cpu_model_str =3D cpu_model; env->cpu_num =3D cpu_num++; env->ext_index =3D -1; - cpu_state_reset(env); + cpu_reset(CPU(cpu)); qemu_init_vcpu(env); return env; } @@ -123,15 +123,7 @@ int cpu_s390x_handle_mmu_fault (CPUS390XState *env, = target_ulong address, int rw =20 void cpu_state_reset(CPUS390XState *env) { - if (qemu_loglevel_mask(CPU_LOG_RESET)) { - qemu_log("CPU Reset (CPU %d)\n", env->cpu_index); - log_cpu_state(env, 0); - } - - memset(env, 0, offsetof(CPUS390XState, breakpoints)); - /* FIXME: reset vector? */ - tlb_flush(env, 1); - s390_add_running_cpu(env); + cpu_reset(ENV_GET_CPU(env)); } =20 #ifndef CONFIG_USER_ONLY --=20 1.7.7