Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KJYyj-0007K4-5I for qemu-devel@nongnu.org; Thu, 17 Jul 2008 15:17:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KJYyh-0007JO-OY for qemu-devel@nongnu.org; Thu, 17 Jul 2008 15:17:23 -0400 Received: from [199.232.76.173] (port=40341 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJYyh-0007JL-Hq for qemu-devel@nongnu.org; Thu, 17 Jul 2008 15:17:23 -0400 Received: from savannah.gnu.org ([199.232.41.3]:35528 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KJYyh-0006Af-Cq for qemu-devel@nongnu.org; Thu, 17 Jul 2008 15:17:23 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KJYyf-0000dn-H0 for qemu-devel@nongnu.org; Thu, 17 Jul 2008 19:17:21 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KJYyf-0000di-2O for qemu-devel@nongnu.org; Thu, 17 Jul 2008 19:17:21 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Thu, 17 Jul 2008 19:17:21 +0000 Subject: [Qemu-devel] [4883] Fix saving and loading of trap state Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 4883 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4883 Author: blueswir1 Date: 2008-07-17 19:17:19 +0000 (Thu, 17 Jul 2008) Log Message: ----------- Fix saving and loading of trap state Modified Paths: -------------- trunk/target-sparc/helper.c trunk/target-sparc/op_helper.c Modified: trunk/target-sparc/helper.c =================================================================== --- trunk/target-sparc/helper.c 2008-07-17 12:53:05 UTC (rev 4882) +++ trunk/target-sparc/helper.c 2008-07-17 19:17:19 UTC (rev 4883) @@ -742,6 +742,14 @@ return; } #endif + if (env->tl < MAXTL - 1) { + env->tl++; + } else { + env->pstate |= PS_RED; + if (env->tl != MAXTL) + env->tl++; + } + env->tsptr = &env->ts[env->tl]; env->tsptr->tstate = ((uint64_t)GET_CCR(env) << 32) | ((env->asi & 0xff) << 24) | ((env->pstate & 0xf3f) << 8) | GET_CWP64(env); @@ -758,14 +766,6 @@ cpu_set_cwp(env, cpu_cwp_inc(env, env->cwp + 1)); env->tbr &= ~0x7fffULL; env->tbr |= ((env->tl > 1) ? 1 << 14 : 0) | (intno << 5); - if (env->tl < MAXTL - 1) { - env->tl++; - } else { - env->pstate |= PS_RED; - if (env->tl != MAXTL) - env->tl++; - } - env->tsptr = &env->ts[env->tl]; env->pc = env->tbr; env->npc = env->pc + 4; env->exception_index = 0; Modified: trunk/target-sparc/op_helper.c =================================================================== --- trunk/target-sparc/op_helper.c 2008-07-17 12:53:05 UTC (rev 4882) +++ trunk/target-sparc/op_helper.c 2008-07-17 19:17:19 UTC (rev 4883) @@ -2680,26 +2680,26 @@ void helper_done(void) { - env->tl--; - env->tsptr = &env->ts[env->tl]; env->pc = env->tsptr->tpc; env->npc = env->tsptr->tnpc + 4; PUT_CCR(env, env->tsptr->tstate >> 32); env->asi = (env->tsptr->tstate >> 24) & 0xff; change_pstate((env->tsptr->tstate >> 8) & 0xf3f); PUT_CWP64(env, env->tsptr->tstate & 0xff); + env->tl--; + env->tsptr = &env->ts[env->tl]; } void helper_retry(void) { - env->tl--; - env->tsptr = &env->ts[env->tl]; env->pc = env->tsptr->tpc; env->npc = env->tsptr->tnpc; PUT_CCR(env, env->tsptr->tstate >> 32); env->asi = (env->tsptr->tstate >> 24) & 0xff; change_pstate((env->tsptr->tstate >> 8) & 0xf3f); PUT_CWP64(env, env->tsptr->tstate & 0xff); + env->tl--; + env->tsptr = &env->ts[env->tl]; } #endif