From e034e2c39aee1800101812045690e0575abb428b Mon Sep 17 00:00:00 2001 From: ths Date: Sat, 23 Jun 2007 18:04:12 +0000 Subject: Handle MIPS64 SEGBITS value correctly. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3011 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-mips/op.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'target-mips/op.c') diff --git a/target-mips/op.c b/target-mips/op.c index 66e27e2..715c355 100644 --- a/target-mips/op.c +++ b/target-mips/op.c @@ -1328,7 +1328,7 @@ void op_mtc0_entryhi (void) /* 1k pages not implemented */ val = T0 & ((TARGET_PAGE_MASK << 1) | 0xFF); #ifdef TARGET_MIPS64 - val = T0 & 0xC00000FFFFFFFFFFULL; + val &= env->SEGMask; #endif old = env->CP0_EntryHi; env->CP0_EntryHi = val; @@ -1526,7 +1526,8 @@ void op_mtc0_desave (void) #ifdef TARGET_MIPS64 void op_mtc0_xcontext (void) { - env->CP0_XContext = (env->CP0_XContext & 0x1ffffffffULL) | (T0 & ~0x1ffffffffULL); + target_ulong mask = (1ULL << (env->SEGBITS - 7)) - 1; + env->CP0_XContext = (env->CP0_XContext & mask) | (T0 & ~mask); RETURN(); } -- cgit v1.1