qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 13/13] target-sh4: Make itlb_replacement() use Su


From: Andreas Färber
Subject: [Qemu-devel] [PATCH v2 13/13] target-sh4: Make itlb_replacement() use SuperHCPU
Date: Fri, 13 Apr 2012 23:30:18 +0200

Signed-off-by: Andreas Färber <address@hidden>
---
 target-sh4/helper.c |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/target-sh4/helper.c b/target-sh4/helper.c
index c5c0593..c291eee 100644
--- a/target-sh4/helper.c
+++ b/target-sh4/helper.c
@@ -227,17 +227,21 @@ static void update_itlb_use(SuperHCPU *cpu, int itlbnb)
     cpu->env.mmucr |= (or_mask << 24);
 }
 
-static int itlb_replacement(CPUSH4State * env)
+static int itlb_replacement(SuperHCPU *cpu)
 {
-    if ((env->mmucr & 0xe0000000) == 0xe0000000)
+    if ((cpu->env.mmucr & 0xe0000000) == 0xe0000000) {
        return 0;
-    if ((env->mmucr & 0x98000000) == 0x18000000)
+    }
+    if ((cpu->env.mmucr & 0x98000000) == 0x18000000) {
        return 1;
-    if ((env->mmucr & 0x54000000) == 0x04000000)
+    }
+    if ((cpu->env.mmucr & 0x54000000) == 0x04000000) {
        return 2;
-    if ((env->mmucr & 0x2c000000) == 0x00000000)
+    }
+    if ((cpu->env.mmucr & 0x2c000000) == 0x00000000) {
        return 3;
-    cpu_abort(env, "Unhandled itlb_replacement");
+    }
+    cpu_abort(&cpu->env, "Unhandled itlb_replacement");
 }
 
 /* Find the corresponding entry in the right TLB
@@ -291,7 +295,7 @@ static int copy_utlb_entry_itlb(SuperHCPU *cpu, int utlb)
     int itlb;
 
     tlb_t * ientry;
-    itlb = itlb_replacement(&cpu->env);
+    itlb = itlb_replacement(cpu);
     ientry = &cpu->env.itlb[itlb];
     if (ientry->v) {
         tlb_flush_page(&cpu->env, ientry->vpn << 10);
-- 
1.7.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]