From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSIgW-0007KS-ER for qemu-devel@nongnu.org; Tue, 05 Jan 2010 18:19:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSIgS-0007D2-FT for qemu-devel@nongnu.org; Tue, 05 Jan 2010 18:19:31 -0500 Received: from [199.232.76.173] (port=35299 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSIgR-0007Ch-6J for qemu-devel@nongnu.org; Tue, 05 Jan 2010 18:19:27 -0500 Received: from mail-fx0-f222.google.com ([209.85.220.222]:54407) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSIgP-0008JO-SX for qemu-devel@nongnu.org; Tue, 05 Jan 2010 18:19:26 -0500 Received: by mail-fx0-f222.google.com with SMTP id 22so19469351fxm.2 for ; Tue, 05 Jan 2010 15:19:25 -0800 (PST) Received: from localhost ([127.0.0.1] helo=[192.168.1.2]) by skyserv with esmtp (Exim 4.71) (envelope-from ) id 1NSIgN-0001kr-8x for qemu-devel@nongnu.org; Wed, 06 Jan 2010 02:19:23 +0300 From: "Igor V. Kovalenko" Date: Wed, 06 Jan 2010 02:19:23 +0300 Message-ID: <20100105231923.6526.22283.stgit@skyserv> In-Reply-To: <20100105231558.6526.44483.stgit@skyserv> References: <20100105231558.6526.44483.stgit@skyserv> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 4/9] sparc64: check for pending irq when pil, pstate or softint is changed List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Igor V. Kovalenko Signed-off-by: Igor V. Kovalenko --- target-sparc/op_helper.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 files changed, 36 insertions(+), 3 deletions(-) diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c index a7da0e4..b1978cb 100644 --- a/target-sparc/op_helper.c +++ b/target-sparc/op_helper.c @@ -3301,6 +3301,12 @@ static inline void change_pstate(uint64_t new_pstate) void helper_wrpstate(target_ulong new_state) { change_pstate(new_state & 0xf3f); + +#if !defined(CONFIG_USER_ONLY) + if (env->pstate & PS_IE) { + 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 (env->pstate & PS_IE) { + cpu_check_irqs(env); + } +#endif } void helper_retry(void) @@ -3341,21 +3355,40 @@ 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 (env->pstate & PS_IE) { + 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) + 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