Skip to content
Browse files

Fix dtlb fault generated instead of dtlb miss exceptions

  • Loading branch information...
1 parent b63023a commit c665b5650fa45ffdf51b32e2673535b15c97d94f @fallen committed Oct 14, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 target-lm32/helper.c
View
6 target-lm32/helper.c
@@ -105,13 +105,13 @@ void mmu_invalidate_tlb(CPULM32State *env, tlb_t *tlb)
tlb_flush_page(env, tlb[idx].vaddr);
}
-static void raise_mmu_exception(CPULM32State *env, target_ulong address, int rw)
+static void raise_mmu_exception(CPULM32State *env, target_ulong address, int rw, int fault)
{
/* already preset TLBVADDR and set TLBBADVADDR to miss address */
env->tlbvaddr = address & TARGET_PAGE_MASK;
env->tlbbadvaddr = address;
- if (rw == 0) {
+ if (rw == 0 || ((rw == 1) && (fault == 0))) {
/* preset lower bit, indicating that DTLB is selected on next write
* to TLBPADDR */
env->tlbvaddr |= 1;
@@ -144,7 +144,7 @@ int cpu_lm32_handle_mmu_fault(CPULM32State *env, target_ulong address, int rw,
TARGET_PAGE_SIZE);
ret = 0;
} else {
- raise_mmu_exception(env, address, rw);
+ raise_mmu_exception(env, address, rw, ret == 2);
ret = 1;
}

0 comments on commit c665b56

Please sign in to comment.
Something went wrong with that request. Please try again.