From: bellard Date: Sat, 2 Jul 2005 15:34:05 +0000 (+0000) Subject: fixed c0_context in tlb exception (Ralf Baechle) X-Git-Tag: release_0_7_1~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8549850891b3e0714cdb01aecf3e08a746c1b361;p=thirdparty%2Fqemu.git fixed c0_context in tlb exception (Ralf Baechle) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1480 c046a42c-6fe2-441c-8c8c-71466251a162 --- diff --git a/target-mips/helper.c b/target-mips/helper.c index 23814961421..aa97e8229f7 100644 --- a/target-mips/helper.c +++ b/target-mips/helper.c @@ -263,10 +263,10 @@ int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw, } /* Raise exception */ env->CP0_BadVAddr = address; - env->CP0_Context = - (env->CP0_Context & 0x00000FFF) | (address & 0xFFFFF000); + env->CP0_Context = (env->CP0_Context & 0xff800000) | + ((address >> 8) & 0x007ffff0); env->CP0_EntryHi = - (env->CP0_EntryHi & 0x00000FFF) | (address & 0xFFFFF000); + (env->CP0_EntryHi & 0x000000FF) | (address & 0xFFFFF000); env->exception_index = exception; env->error_code = error_code; ret = 1;