From patchwork Thu Oct 11 22:56:35 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: 191022 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 A42A72C007A for ; Fri, 12 Oct 2012 09:58:09 +1100 (EST) Received: from localhost ([::1]:54924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMRhf-00069n-Tt for incoming@patchwork.ozlabs.org; Thu, 11 Oct 2012 18:58:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMRgV-0002aa-Cn for qemu-devel@nongnu.org; Thu, 11 Oct 2012 18:56:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMRgT-0003sd-AS for qemu-devel@nongnu.org; Thu, 11 Oct 2012 18:56:55 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49223 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMRgT-0003sE-1V for qemu-devel@nongnu.org; Thu, 11 Oct 2012 18:56:53 -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 78322A30ED; Fri, 12 Oct 2012 00:56:52 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Fri, 12 Oct 2012 00:56:35 +0200 Message-Id: <1349996197-11054-4-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1349996197-11054-1-git-send-email-afaerber@suse.de> References: <1349996197-11054-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: =?UTF-8?q?Andreas=20F=C3=A4rber?= , aurelien@aurel32.net Subject: [Qemu-devel] [PATCH v2 3/5] target-mips: Pass MIPSCPU to mips_vpe_is_wfi() 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 moving halted field to CPUState. The variable name "c" is retained for MIPSCPU to leave "cpu" for CPUState. Also change return type to bool while at it. Signed-off-by: Andreas Färber --- target-mips/op_helper.c | 12 ++++++++---- 1 Datei geändert, 8 Zeilen hinzugefügt(+), 4 Zeilen entfernt(-) diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c index e721a4d..9770741 100644 --- a/target-mips/op_helper.c +++ b/target-mips/op_helper.c @@ -714,11 +714,13 @@ void helper_sdm(CPUMIPSState *env, target_ulong addr, target_ulong reglist, #ifndef CONFIG_USER_ONLY /* SMP helpers. */ -static int mips_vpe_is_wfi(CPUMIPSState *c) +static bool mips_vpe_is_wfi(MIPSCPU *c) { + CPUMIPSState *env = &c->env; + /* If the VPE is halted but otherwise active, it means it's waiting for an interrupt. */ - return c->halted && mips_vpe_active(c); + return env->halted && mips_vpe_active(env); } static inline void mips_vpe_wake(CPUMIPSState *c) @@ -742,7 +744,7 @@ static inline void mips_tc_wake(MIPSCPU *cpu, int tc) CPUMIPSState *c = &cpu->env; /* FIXME: TC reschedule. */ - if (mips_vpe_active(c) && !mips_vpe_is_wfi(c)) { + if (mips_vpe_active(c) && !mips_vpe_is_wfi(cpu)) { mips_vpe_wake(c); } } @@ -1899,9 +1901,11 @@ target_ulong helper_evpe(CPUMIPSState *env) target_ulong prev = env->mvp->CP0_MVPControl; do { + MIPSCPU *other_cpu = mips_env_get_cpu(other_cpu_env); + if (other_cpu_env != env /* If the VPE is WFI, don't disturb its sleep. */ - && !mips_vpe_is_wfi(other_cpu_env)) { + && !mips_vpe_is_wfi(other_cpu)) { /* Enable the VPE. */ other_cpu_env->mvp->CP0_MVPControl |= (1 << CP0MVPCo_EVP); mips_vpe_wake(other_cpu_env); /* And wake it up. */