summaryrefslogtreecommitdiff
path: root/target-mips/exec.h
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-28 19:45:05 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-28 19:45:05 +0000
commit623a930ec30a75e6d6482ca8208d7bf1ca8d359b (patch)
tree6953605abd679c357ffba546fd43907a4ce9ea0e /target-mips/exec.h
parent8e129e0748f866d730f1e39bff296219fedac244 (diff)
downloadqemu-623a930ec30a75e6d6482ca8208d7bf1ca8d359b.tar.gz
qemu-623a930ec30a75e6d6482ca8208d7bf1ca8d359b.tar.bz2
qemu-623a930ec30a75e6d6482ca8208d7bf1ca8d359b.zip
Implement missing MIPS supervisor mode bits.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3472 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips/exec.h')
-rw-r--r--target-mips/exec.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/target-mips/exec.h b/target-mips/exec.h
index 61c09acb66..529306f3b2 100644
--- a/target-mips/exec.h
+++ b/target-mips/exec.h
@@ -230,24 +230,20 @@ static always_inline int cpu_halted(CPUState *env)
static always_inline void compute_hflags(CPUState *env)
{
env->hflags &= ~(MIPS_HFLAG_64 | MIPS_HFLAG_CP0 | MIPS_HFLAG_F64 |
- MIPS_HFLAG_FPU | MIPS_HFLAG_UM);
+ MIPS_HFLAG_FPU | MIPS_HFLAG_KSU);
if (!(env->CP0_Status & (1 << CP0St_EXL)) &&
!(env->CP0_Status & (1 << CP0St_ERL)) &&
!(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;
+ env->hflags |= (env->CP0_Status >> CP0St_KSU) & MIPS_HFLAG_KSU;
}
#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64)
- if (!(env->hflags & MIPS_HFLAG_UM) ||
+ if (((env->hflags & MIPS_HFLAG_KSU) != 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) &&
- !(env->hflags & MIPS_HFLAG_SM)))
+ !(env->hflags & MIPS_HFLAG_KSU))
env->hflags |= MIPS_HFLAG_CP0;
if (env->CP0_Status & (1 << CP0St_CU1))
env->hflags |= MIPS_HFLAG_FPU;