From patchwork Thu Jan 7 20:28:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Igor V. Kovalenko" X-Patchwork-Id: 42474 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0A8711007D1 for ; Fri, 8 Jan 2010 07:39:04 +1100 (EST) Received: from localhost ([127.0.0.1]:35966 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSz8G-0007ZS-VM for incoming@patchwork.ozlabs.org; Thu, 07 Jan 2010 15:39:01 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSyy1-0004rp-EB for qemu-devel@nongnu.org; Thu, 07 Jan 2010 15:28:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSyxw-0004mU-Ck for qemu-devel@nongnu.org; Thu, 07 Jan 2010 15:28:24 -0500 Received: from [199.232.76.173] (port=38276 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSyxw-0004m0-2V for qemu-devel@nongnu.org; Thu, 07 Jan 2010 15:28:20 -0500 Received: from mail-fx0-f222.google.com ([209.85.220.222]:33820) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSyxu-0000ti-Du for qemu-devel@nongnu.org; Thu, 07 Jan 2010 15:28:19 -0500 Received: by mail-fx0-f222.google.com with SMTP id 22so21243905fxm.2 for ; Thu, 07 Jan 2010 12:28:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:subject:to:from:date :message-id:in-reply-to:references:user-agent:mime-version :content-type:content-transfer-encoding; bh=8K9RsGRwbbpN5GAzhuy3EvgXzm1iIAukitcJTRRiwFM=; b=igAgn9EFx4zcPLk8djaikOImS8xHqYvUHfsh9AFZGhGac1o8YUjkyd+CmkxjlJTkFy 9hQeOzIbKgvmc70ztZizMHGsbPlE7zTeq0BqI8Jjj9fVcP81dardkoSx7xwoNmYVV0dw 5V+CHW3GCC70PT4rvlr9E1JJKKlMfrWC/pk9g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:to:from:date:message-id:in-reply-to:references:user-agent :mime-version:content-type:content-transfer-encoding; b=f3osirHjzvhbf6EYgAtePzTNgqoz4z0WXTBwdOaGRCyM/vutuc8im0361zbdDUpoIJ mRlccs7jce5SCN2IiokDTxgBr2xXEJfBfWLAIsQxx+iF41hXnbPur1VS4AhV7p/gV4AK phU02BhCwCIndna7in6d0w+O4sYWanhO8xLkU= Received: by 10.223.81.76 with SMTP id w12mr16555693fak.1.1262896097309; Thu, 07 Jan 2010 12:28:17 -0800 (PST) Received: from skyserv (host-87-255-14-75.bigtelecom.ru [87.255.14.75]) by mx.google.com with ESMTPS id 14sm7920026fxm.7.2010.01.07.12.28.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 07 Jan 2010 12:28:16 -0800 (PST) Received: from localhost ([127.0.0.1] helo=[192.168.1.2]) by skyserv with esmtp (Exim 4.71) (envelope-from ) id 1NSyxr-0004QK-Se for qemu-devel@nongnu.org; Thu, 07 Jan 2010 23:28:15 +0300 To: qemu-devel@nongnu.org From: "Igor V. Kovalenko" Date: Thu, 07 Jan 2010 23:28:15 +0300 Message-ID: <20100107202815.16653.87375.stgit@skyserv> In-Reply-To: <20100107201810.16653.85771.stgit@skyserv> References: <20100107201810.16653.85771.stgit@skyserv> User-Agent: StGit/0.15 MIME-Version: 1.0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 5/9] sparc64: check for pending irq when pil, pstate or softint is changed X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Igor V. Kovalenko Signed-off-by: Igor V. Kovalenko --- target-sparc/op_helper.c | 41 ++++++++++++++++++++++++++++++++++++++--- 1 files changed, 38 insertions(+), 3 deletions(-) diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c index 3d7f64c..381e6c4 100644 --- a/target-sparc/op_helper.c +++ b/target-sparc/op_helper.c @@ -3301,6 +3301,12 @@ static inline void change_pstate(uint32_t new_pstate) void helper_wrpstate(target_ulong new_state) { change_pstate(new_state & 0xf3f); + +#if !defined(CONFIG_USER_ONLY) + if (cpu_interrupts_enabled(env)) { + cpu_check_irqs(env); + } +#endif } void helper_wrpil(target_ulong new_pil) @@ -3328,6 +3334,14 @@ void helper_done(void) change_pstate((tsptr->tstate >> 8) & 0xf3f); PUT_CWP64(env, tsptr->tstate & 0xff); env->tl--; + + DPRINTF_PSTATE("... helper_done tl=%d\n", env->tl); + +#if !defined(CONFIG_USER_ONLY) + if (cpu_interrupts_enabled(env)) { + cpu_check_irqs(env); + } +#endif } void helper_retry(void) @@ -3341,21 +3355,42 @@ void helper_retry(void) change_pstate((tsptr->tstate >> 8) & 0xf3f); PUT_CWP64(env, tsptr->tstate & 0xff); env->tl--; + + DPRINTF_PSTATE("... helper_retry tl=%d\n", env->tl); + +#if !defined(CONFIG_USER_ONLY) + if (cpu_interrupts_enabled(env)) { + cpu_check_irqs(env); + } +#endif +} + +static void do_modify_softint(const char* operation, uint32_t value) +{ + if (env->softint != value) { + env->softint = value; + DPRINTF_PSTATE(": %s new %08x\n", operation, env->softint); +#if !defined(CONFIG_USER_ONLY) + if (cpu_interrupts_enabled(env)) { + cpu_check_irqs(env); + } +#endif + } } void helper_set_softint(uint64_t value) { - env->softint |= (uint32_t)value; + do_modify_softint("helper_set_softint", env->softint | (uint32_t)value); } void helper_clear_softint(uint64_t value) { - env->softint &= (uint32_t)~value; + do_modify_softint("helper_clear_softint", env->softint & (uint32_t)~value); } void helper_write_softint(uint64_t value) { - env->softint = (uint32_t)value; + do_modify_softint("helper_write_softint", (uint32_t)value); } #endif