From patchwork Sat Apr 14 22:12:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [v3,13/13] target-sh4: Make itlb_replacement() use SuperHCPU From: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 152579 Message-Id: <1334441565-26433-14-git-send-email-afaerber@suse.de> To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Aurelien Jarno Date: Sun, 15 Apr 2012 00:12:45 +0200 Signed-off-by: Andreas Färber --- 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);