aboutsummaryrefslogtreecommitdiff
path: root/target-mips/op_mem.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-04-09 14:14:21 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-04-09 14:14:21 +0000
commit62c5609aa537a9c7f3c70e4baa5e67060368baa3 (patch)
tree4d97964618731f63c2fc7b01e99b2f43adc048bf /target-mips/op_mem.c
parent97428a4d84a22795e0d9f1517677ec01cb1bede1 (diff)
Catch unaligned sc/scd.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2642 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips/op_mem.c')
-rw-r--r--target-mips/op_mem.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/target-mips/op_mem.c b/target-mips/op_mem.c
index a1991721ac..19373cf002 100644
--- a/target-mips/op_mem.c
+++ b/target-mips/op_mem.c
@@ -117,6 +117,10 @@ void glue(op_ll, MEMSUFFIX) (void)
void glue(op_sc, MEMSUFFIX) (void)
{
CALL_FROM_TB0(dump_sc);
+ if (T0 & 0x3) {
+ env->CP0_BadVAddr = T0;
+ CALL_FROM_TB1(do_raise_exception, EXCP_AdES);
+ }
if (T0 == env->CP0_LLAddr) {
glue(stl, MEMSUFFIX)(T0, T1);
T0 = 1;
@@ -182,6 +186,10 @@ void glue(op_lld, MEMSUFFIX) (void)
void glue(op_scd, MEMSUFFIX) (void)
{
CALL_FROM_TB0(dump_sc);
+ if (T0 & 0x7) {
+ env->CP0_BadVAddr = T0;
+ CALL_FROM_TB1(do_raise_exception, EXCP_AdES);
+ }
if (T0 == env->CP0_LLAddr) {
glue(stq, MEMSUFFIX)(T0, T1);
T0 = 1;