From patchwork Thu May 10 00:14:27 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: 158140 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 25422B6F13 for ; Thu, 10 May 2012 12:42:15 +1000 (EST) Received: from localhost ([::1]:52446 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSH5k-0006SG-5K for incoming@patchwork.ozlabs.org; Wed, 09 May 2012 20:18:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSH2R-0001Sc-Qs for qemu-devel@nongnu.org; Wed, 09 May 2012 20:15:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSH2P-0005eQ-71 for qemu-devel@nongnu.org; Wed, 09 May 2012 20:15:23 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35609 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSH2P-0005dd-1g for qemu-devel@nongnu.org; Wed, 09 May 2012 20:15:21 -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 D6A2A979ED; Thu, 10 May 2012 02:15:19 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Thu, 10 May 2012 02:14:27 +0200 Message-Id: <1336608892-30501-50-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: Max Filippov , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH next v2 49/74] xtensa_lx60: Use cpu_xtensa_init() to obtain XtensaCPU 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/xtensa_lx60.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/xtensa_lx60.c b/hw/xtensa_lx60.c index afdef49..31f8adc 100644 --- a/hw/xtensa_lx60.c +++ b/hw/xtensa_lx60.c @@ -164,6 +164,7 @@ static void lx_init(const LxBoardDesc *board, int be = 0; #endif MemoryRegion *system_memory = get_system_memory(); + XtensaCPU *cpu = NULL; CPUXtensaState *env = NULL; MemoryRegion *ram, *rom, *system_io; DriveInfo *dinfo; @@ -175,17 +176,19 @@ static void lx_init(const LxBoardDesc *board, } for (n = 0; n < smp_cpus; n++) { - env = cpu_init(cpu_model); - if (!env) { + cpu = cpu_xtensa_init(cpu_model); + if (cpu == NULL) { fprintf(stderr, "Unable to find CPU definition\n"); exit(1); } + env = &cpu->env; + env->sregs[PRID] = n; qemu_register_reset(lx60_reset, env); /* Need MMU initialized prior to ELF loading, * so that ELF gets loaded into virtual addresses */ - cpu_state_reset(env); + cpu_reset(CPU(cpu)); } ram = g_malloc(sizeof(*ram));