From patchwork Tue Jun 5 01:22:00 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: 162980 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 E1E07B6F6E for ; Tue, 5 Jun 2012 13:43:48 +1000 (EST) Received: from localhost ([::1]:37188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbiWn-0004za-KM for incoming@patchwork.ozlabs.org; Mon, 04 Jun 2012 21:25:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbiV9-00033O-N4 for qemu-devel@nongnu.org; Mon, 04 Jun 2012 21:24:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbiV7-0008IP-Fe for qemu-devel@nongnu.org; Mon, 04 Jun 2012 21:24:03 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52718 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbiV7-0008Hm-8e for qemu-devel@nongnu.org; Mon, 04 Jun 2012 21:24:01 -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 ECEA7915A2; Tue, 5 Jun 2012 03:23:57 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Tue, 5 Jun 2012 03:22:00 +0200 Message-Id: <1338859366-20689-29-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1338859366-20689-1-git-send-email-afaerber@suse.de> References: <1338859366-20689-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 28/74] pc: Use cpu_x86_init() to obtain X86CPU 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 Needed for pc_cpu_reset(). Also change return type to X86CPU. Signed-off-by: Andreas Färber Reviewed-by: Igor Mammedov --- hw/pc.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index c790bcb..1133921 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -932,21 +932,23 @@ static void pc_cpu_reset(void *opaque) env->halted = !cpu_is_bsp(env); } -static CPUX86State *pc_new_cpu(const char *cpu_model) +static X86CPU *pc_new_cpu(const char *cpu_model) { + X86CPU *cpu; CPUX86State *env; - env = cpu_init(cpu_model); - if (!env) { + cpu = cpu_x86_init(cpu_model); + if (cpu == NULL) { fprintf(stderr, "Unable to find x86 CPU definition\n"); exit(1); } + env = &cpu->env; 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); - return env; + return cpu; } void pc_cpus_init(const char *cpu_model)