From patchwork Sat Apr 14 22:12:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 152579 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 41A17B6FE8 for ; Sun, 15 Apr 2012 09:14:40 +1000 (EST) Received: from localhost ([::1]:46058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJBE1-0002Oa-TK for incoming@patchwork.ozlabs.org; Sat, 14 Apr 2012 18:13:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJBDH-0000Rx-Vc for qemu-devel@nongnu.org; Sat, 14 Apr 2012 18:13:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SJBDG-0000uE-8U for qemu-devel@nongnu.org; Sat, 14 Apr 2012 18:12:59 -0400 Received: from cantor2.suse.de ([195.135.220.15]:57835 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJBDF-0000tO-TQ for qemu-devel@nongnu.org; Sat, 14 Apr 2012 18:12:58 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id D808E938E3; Sun, 15 Apr 2012 00:12:56 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Sun, 15 Apr 2012 00:12:45 +0200 Message-Id: <1334441565-26433-14-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1334441565-26433-1-git-send-email-afaerber@suse.de> References: <1334441565-26433-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Aurelien Jarno Subject: [Qemu-devel] [PATCH v3 13/13] target-sh4: Make itlb_replacement() use SuperHCPU X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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);