qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [4883] Fix saving and loading of trap state
Date: Thu, 17 Jul 2008 19:17:21 +0000	[thread overview]
Message-ID: <E1KJYyf-0000di-2O@cvs.savannah.gnu.org> (raw)

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
 

                 reply	other threads:[~2008-07-17 19:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1KJYyf-0000di-2O@cvs.savannah.gnu.org \
    --to=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).