diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-05-28 20:36:48 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-05-28 20:36:48 +0000 |
commit | 6e473128b61901441fa2889dfa2079881895a9f9 (patch) | |
tree | f6be8334ee0b7031f5c5dcb45c4024b6d9c3a4b8 /target-mips/op.c | |
parent | 85aa199ad7755880060d0481dc1c762c372a1799 (diff) |
Handle PX/UX status flags correctly, by Aurelien Jarno.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2892 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips/op.c')
-rw-r--r-- | target-mips/op.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/target-mips/op.c b/target-mips/op.c index f4598fb46c..bc4d51a8f8 100644 --- a/target-mips/op.c +++ b/target-mips/op.c @@ -1358,6 +1358,12 @@ void op_mtc0_status (void) !(env->hflags & MIPS_HFLAG_DM) && (val & (1 << CP0St_UM))) env->hflags |= MIPS_HFLAG_UM; +#ifdef TARGET_MIPS64 + if ((env->hflags & MIPS_HFLAG_UM) && + !(val & (1 << CP0St_PX)) && + !(val & (1 << CP0St_UX))) + env->hflags &= ~MIPS_HFLAG_64; +#endif env->CP0_Status = (env->CP0_Status & ~mask) | val; if (loglevel & CPU_LOG_EXEC) CALL_FROM_TB2(do_mtc0_status_debug, old, val); @@ -2338,6 +2344,12 @@ void op_eret (void) !(env->hflags & MIPS_HFLAG_DM) && (env->CP0_Status & (1 << CP0St_UM))) env->hflags |= MIPS_HFLAG_UM; +#ifdef TARGET_MIPS64 + if ((env->hflags & MIPS_HFLAG_UM) && + !(env->CP0_Status & (1 << CP0St_PX)) && + !(env->CP0_Status & (1 << CP0St_UX))) + env->hflags &= ~MIPS_HFLAG_64; +#endif if (loglevel & CPU_LOG_EXEC) CALL_FROM_TB0(debug_post_eret); env->CP0_LLAddr = 1; @@ -2355,6 +2367,12 @@ void op_deret (void) !(env->hflags & MIPS_HFLAG_DM) && (env->CP0_Status & (1 << CP0St_UM))) env->hflags |= MIPS_HFLAG_UM; +#ifdef TARGET_MIPS64 + if ((env->hflags & MIPS_HFLAG_UM) && + !(env->CP0_Status & (1 << CP0St_PX)) && + !(env->CP0_Status & (1 << CP0St_UX))) + env->hflags &= ~MIPS_HFLAG_64; +#endif if (loglevel & CPU_LOG_EXEC) CALL_FROM_TB0(debug_post_eret); env->CP0_LLAddr = 1; |