Commit 8549850891b3e0714cdb01aecf3e08a746c1b361

Authored by bellard
1 parent 7a962d30

fixed c0_context in tlb exception (Ralf Baechle)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1480 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 3 additions and 3 deletions
target-mips/helper.c
@@ -263,10 +263,10 @@ int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw, @@ -263,10 +263,10 @@ int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
263 } 263 }
264 /* Raise exception */ 264 /* Raise exception */
265 env->CP0_BadVAddr = address; 265 env->CP0_BadVAddr = address;
266 - env->CP0_Context =  
267 - (env->CP0_Context & 0x00000FFF) | (address & 0xFFFFF000); 266 + env->CP0_Context = (env->CP0_Context & 0xff800000) |
  267 + ((address >> 8) & 0x007ffff0);
268 env->CP0_EntryHi = 268 env->CP0_EntryHi =
269 - (env->CP0_EntryHi & 0x00000FFF) | (address & 0xFFFFF000); 269 + (env->CP0_EntryHi & 0x000000FF) | (address & 0xFFFFF000);
270 env->exception_index = exception; 270 env->exception_index = exception;
271 env->error_code = error_code; 271 env->error_code = error_code;
272 ret = 1; 272 ret = 1;