]> xenbits.xensource.com Git - qemu-xen-4.0-testing.git/commitdiff
M68K status register fixes.
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 9 Jun 2007 20:48:46 +0000 (20:48 +0000)
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 9 Jun 2007 20:48:46 +0000 (20:48 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2967 c046a42c-6fe2-441c-8c8c-71466251a162

target-m68k/op.c
target-m68k/op_helper.c
target-m68k/translate.c

index 932c99435780f8703ac174f4b25cfa3a30845e00..466fdc23426b01d584b9643cb89fad24b67fa2a1 100644 (file)
@@ -338,10 +338,7 @@ OP(ext16s32)
 
 OP(flush_flags)
 {
-    int cc_op  = PARAM1;
-    if (cc_op == CC_OP_DYNAMIC)
-        cc_op = env->cc_op;
-    cpu_m68k_flush_flags(env, cc_op);
+    cpu_m68k_flush_flags(env, env->cc_op);
     FORCE_RET();
 }
 
@@ -480,7 +477,7 @@ OP(fp_result)
 
 OP(set_sr)
 {
-    env->sr = get_op(PARAM1);
+    env->sr = get_op(PARAM1) & 0xffff;
     m68k_switch_sp(env);
     FORCE_RET();
 }
index 4c423ca98470ecabdb3f8d2b33de43dc7f86a417..39cd5d70385bea54e1188b7c1b033bf19b6ebd5a 100644 (file)
@@ -131,6 +131,8 @@ void do_interrupt(int is_hw)
 
     vector = env->exception_index << 2;
 
+    sp = env->aregs[7];
+
     fmt |= 0x40000000;
     fmt |= (sp & 3) << 28;
     fmt |= vector << 16;
@@ -143,8 +145,6 @@ void do_interrupt(int is_hw)
     }
     m68k_switch_sp(env);
 
-    sp = env->aregs[7];
-
     /* ??? This could cause MMU faults.  */
     sp &= ~3;
     sp -= 4;
index 1c0e4313584617a6797e76582a98d9299c5584c9..ad8faadc0c8a0506f3585e54b1be97f50237a840 100644 (file)
@@ -345,7 +345,8 @@ static inline void gen_flush_flags(DisasContext *s)
 {
     if (s->cc_op == CC_OP_FLAGS)
         return;
-    gen_op_flush_flags(s->cc_op);
+    gen_flush_cc_op(s);
+    gen_op_flush_flags();
     s->cc_op = CC_OP_FLAGS;
 }