From patchwork Sat Feb 16 15:45:14 2013 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: 220999 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 3D51D2C0080 for ; Sun, 17 Feb 2013 04:24:46 +1100 (EST) Received: from localhost ([::1]:51496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6k2G-0005dE-NL for incoming@patchwork.ozlabs.org; Sat, 16 Feb 2013 10:50:44 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6k0s-0004gQ-3K for qemu-devel@nongnu.org; Sat, 16 Feb 2013 10:49:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U6k0p-0002Mk-NK for qemu-devel@nongnu.org; Sat, 16 Feb 2013 10:49:17 -0500 Received: from cantor2.suse.de ([195.135.220.15]:40380 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6k0p-0002Ma-HQ for qemu-devel@nongnu.org; Sat, 16 Feb 2013 10:49:15 -0500 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 080BBA398D; Sat, 16 Feb 2013 16:49:15 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Sat, 16 Feb 2013 16:45:14 +0100 Message-Id: <1361029542-8412-20-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1361029542-8412-1-git-send-email-afaerber@suse.de> References: <1361029542-8412-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: Michael Walle , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH 19/47] target-lm32: Move TCG initialization to LM32CPU initfn 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 Signed-off-by: Andreas Färber --- target-lm32/cpu.c | 6 ++++++ target-lm32/helper.c | 6 ------ 2 Dateien geändert, 6 Zeilen hinzugefügt(+), 6 Zeilen entfernt(-) diff --git a/target-lm32/cpu.c b/target-lm32/cpu.c index 6a84f51..5f16734 100644 --- a/target-lm32/cpu.c +++ b/target-lm32/cpu.c @@ -58,10 +58,16 @@ static void lm32_cpu_initfn(Object *obj) { LM32CPU *cpu = LM32_CPU(obj); CPULM32State *env = &cpu->env; + static bool tcg_initialized; cpu_exec_init(env); env->flags = 0; + + if (tcg_enabled() && !tcg_initialized) { + tcg_initialized = true; + lm32_translate_init(); + } } static void lm32_cpu_class_init(ObjectClass *oc, void *data) diff --git a/target-lm32/helper.c b/target-lm32/helper.c index a6691ad..47ae7e7 100644 --- a/target-lm32/helper.c +++ b/target-lm32/helper.c @@ -197,7 +197,6 @@ LM32CPU *cpu_lm32_init(const char *cpu_model) LM32CPU *cpu; CPULM32State *env; const LM32Def *def; - static int tcg_initialized; def = cpu_lm32_find_by_name(cpu_model); if (!def) { @@ -212,11 +211,6 @@ LM32CPU *cpu_lm32_init(const char *cpu_model) env->num_wps = def->num_watchpoints; env->cfg = cfg_by_def(def); - if (tcg_enabled() && !tcg_initialized) { - tcg_initialized = 1; - lm32_translate_init(); - } - object_property_set_bool(OBJECT(cpu), true, "realized", NULL); return cpu;