summaryrefslogtreecommitdiff
path: root/target-mips/exec.h
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-09-29 19:21:36 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-09-29 19:21:36 +0000
commit671880e651e611ec32dbb978e61c0bd4bc3e180e (patch)
treea6401fdd2ea52dc7ab54b8721eea7bc820f6c1ad /target-mips/exec.h
parent544540979cb8ebb4b4ca71bd8df89e5d8e7f8600 (diff)
downloadqemu-671880e651e611ec32dbb978e61c0bd4bc3e180e.tar.gz
qemu-671880e651e611ec32dbb978e61c0bd4bc3e180e.tar.bz2
qemu-671880e651e611ec32dbb978e61c0bd4bc3e180e.zip
Supervisor mode implementation, by Aurelien Jarno.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3267 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips/exec.h')
-rw-r--r--target-mips/exec.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/target-mips/exec.h b/target-mips/exec.h
index 9ff3f08b59..b6300bd494 100644
--- a/target-mips/exec.h
+++ b/target-mips/exec.h
@@ -261,16 +261,21 @@ static inline void compute_hflags(CPUState *env)
MIPS_HFLAG_FPU | MIPS_HFLAG_UM);
if (!(env->CP0_Status & (1 << CP0St_EXL)) &&
!(env->CP0_Status & (1 << CP0St_ERL)) &&
- !(env->hflags & MIPS_HFLAG_DM) &&
- (env->CP0_Status & (1 << CP0St_UM)))
- env->hflags |= MIPS_HFLAG_UM;
+ !(env->hflags & MIPS_HFLAG_DM)) {
+ if (env->CP0_Status & (1 << CP0St_UM))
+ env->hflags |= MIPS_HFLAG_UM;
+ if (env->CP0_Status & (1 << CP0St_R0))
+ env->hflags |= MIPS_HFLAG_SM;
+ }
#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 ((env->CP0_Status & (1 << CP0St_CU0)) || !(env->hflags & MIPS_HFLAG_UM))
+ if ((env->CP0_Status & (1 << CP0St_CU0)) ||
+ (!(env->hflags & MIPS_HFLAG_UM) &&
+ !(env->hflags & MIPS_HFLAG_SM)))
env->hflags |= MIPS_HFLAG_CP0;
if (env->CP0_Status & (1 << CP0St_CU1))
env->hflags |= MIPS_HFLAG_FPU;