From patchwork Thu May 10 00:13:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 158119 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BB022B6FA1 for ; Thu, 10 May 2012 12:13:57 +1000 (EST) Received: from localhost ([::1]:44227 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSH2r-0002AI-0M for incoming@patchwork.ozlabs.org; Wed, 09 May 2012 20:15:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSH26-0000Mm-Tk for qemu-devel@nongnu.org; Wed, 09 May 2012 20:15:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSH24-0005FD-Sh for qemu-devel@nongnu.org; Wed, 09 May 2012 20:15:02 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35522 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSH24-0005Ef-Lw for qemu-devel@nongnu.org; Wed, 09 May 2012 20:15:00 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 983EE979ED; Thu, 10 May 2012 02:14:59 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Thu, 10 May 2012 02:13:44 +0200 Message-Id: <1336608892-30501-7-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1336608892-30501-1-git-send-email-afaerber@suse.de> References: <1336608892-30501-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: Anthony Liguori , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH next v2 06/74] pc: Pass X86CPU to pc_cpu_reset() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Allows us to use cpu_reset() in place of cpu_state_reset(). Signed-off-by: Andreas Färber --- hw/pc.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 4715f7a..4167782 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -934,9 +934,10 @@ void pc_acpi_smi_interrupt(void *opaque, int irq, int level) static void pc_cpu_reset(void *opaque) { - CPUX86State *env = opaque; + X86CPU *cpu = opaque; + CPUX86State *env = &cpu->env; - cpu_state_reset(env); + cpu_reset(CPU(cpu)); env->halted = !cpu_is_bsp(env); } @@ -954,8 +955,8 @@ static X86CPU *pc_new_cpu(const char *cpu_model) if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) { env->apic_state = apic_init(env, env->cpuid_apic_id); } - qemu_register_reset(pc_cpu_reset, env); - pc_cpu_reset(env); + qemu_register_reset(pc_cpu_reset, cpu); + pc_cpu_reset(cpu); return cpu; }