aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2007-06-03 11:13:39 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2007-06-03 11:13:39 +0000
commit20dcee9483361ee0621cf6d68d271ecde686fd9c (patch)
tree12935f98ad16a1c931026d01ed76beaaea0550a4 /target-m68k/op_helper.c
parentLeave running timer alone if not reloading. (diff)
downloadqemu-kvm-20dcee9483361ee0621cf6d68d271ecde686fd9c.tar.gz
qemu-kvm-20dcee9483361ee0621cf6d68d271ecde686fd9c.tar.bz2
qemu-kvm-20dcee9483361ee0621cf6d68d271ecde686fd9c.zip
MCF5208 emulation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2924 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-m68k/op_helper.c')
-rw-r--r--target-m68k/op_helper.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/target-m68k/op_helper.c b/target-m68k/op_helper.c
index 8086238db..4c423ca98 100644
--- a/target-m68k/op_helper.c
+++ b/target-m68k/op_helper.c
@@ -87,6 +87,7 @@ static void do_rte(void)
env->pc = ldl_kernel(sp + 4);
sp |= (fmt >> 28) & 3;
env->sr = fmt & 0xffff;
+ m68k_switch_sp(env);
env->aregs[7] = sp + 8;
}
@@ -128,9 +129,6 @@ void do_interrupt(int is_hw)
}
}
- /* TODO: Implement USP. */
- sp = env->aregs[7];
-
vector = env->exception_index << 2;
fmt |= 0x40000000;
@@ -138,6 +136,15 @@ void do_interrupt(int is_hw)
fmt |= vector << 16;
fmt |= env->sr;
+ env->sr |= SR_S;
+ if (is_hw) {
+ env->sr = (env->sr & ~SR_I) | (env->pending_level << SR_I_SHIFT);
+ env->sr &= ~SR_M;
+ }
+ m68k_switch_sp(env);
+
+ sp = env->aregs[7];
+
/* ??? This could cause MMU faults. */
sp &= ~3;
sp -= 4;
@@ -145,11 +152,6 @@ void do_interrupt(int is_hw)
sp -= 4;
stl_kernel(sp, fmt);
env->aregs[7] = sp;
- env->sr |= SR_S;
- if (is_hw) {
- env->sr = (env->sr & ~SR_I) | (env->pending_level << SR_I_SHIFT);
- env->sr &= ~SR_M;
- }
/* Jump to vector. */
env->pc = ldl_kernel(env->vbr + vector);
}