Patchwork [v3,12/13] target-sh4: Make update_itlb_use() take SuperHCPU

login
register
mail settings
Submitter Andreas Färber
Date April 14, 2012, 10:12 p.m.
Message ID <1334441565-26433-13-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/152578/
State New
Headers show

Comments

Andreas Färber - April 14, 2012, 10:12 p.m.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 target-sh4/helper.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

Patch

diff --git a/target-sh4/helper.c b/target-sh4/helper.c
index ffe79ec..c5c0593 100644
--- a/target-sh4/helper.c
+++ b/target-sh4/helper.c
@@ -202,7 +202,7 @@  void do_interrupt(CPUSH4State * env)
     }
 }
 
-static void update_itlb_use(CPUSH4State * env, int itlbnb)
+static void update_itlb_use(SuperHCPU *cpu, int itlbnb)
 {
     uint8_t or_mask = 0, and_mask = (uint8_t) - 1;
 
@@ -223,8 +223,8 @@  static void update_itlb_use(CPUSH4State * env, int itlbnb)
 	break;
     }
 
-    env->mmucr &= (and_mask << 24) | 0x00ffffff;
-    env->mmucr |= (or_mask << 24);
+    cpu->env.mmucr &= (and_mask << 24) | 0x00ffffff;
+    cpu->env.mmucr |= (or_mask << 24);
 }
 
 static int itlb_replacement(CPUSH4State * env)
@@ -297,7 +297,7 @@  static int copy_utlb_entry_itlb(SuperHCPU *cpu, int utlb)
         tlb_flush_page(&cpu->env, ientry->vpn << 10);
     }
     *ientry = cpu->env.utlb[utlb];
-    update_itlb_use(&cpu->env, itlb);
+    update_itlb_use(cpu, itlb);
     return itlb;
 }
 
@@ -315,7 +315,7 @@  static int find_itlb_entry(SuperHCPU *cpu, target_ulong address,
     } else if (e == MMU_DTLB_MISS) {
 	e = MMU_ITLB_MISS;
     } else if (e >= 0) {
-        update_itlb_use(&cpu->env, e);
+        update_itlb_use(cpu, e);
     }
     return e;
 }