Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LBZgK-0001Jl-7S for qemu-devel@nongnu.org; Sat, 13 Dec 2008 13:57:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LBZgJ-0001It-GG for qemu-devel@nongnu.org; Sat, 13 Dec 2008 13:57:39 -0500 Received: from [199.232.76.173] (port=39752 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBZgJ-0001Ik-5b for qemu-devel@nongnu.org; Sat, 13 Dec 2008 13:57:39 -0500 Received: from savannah.gnu.org ([199.232.41.3]:47122 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LBZgI-0003aS-Qh for qemu-devel@nongnu.org; Sat, 13 Dec 2008 13:57:38 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LBZgI-0005ld-7O for qemu-devel@nongnu.org; Sat, 13 Dec 2008 18:57:38 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LBZgH-0005lT-Tt for qemu-devel@nongnu.org; Sat, 13 Dec 2008 18:57:38 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Sat, 13 Dec 2008 18:57:37 +0000 Subject: [Qemu-devel] [6013] target-sh4: add prefi, icbi, synco Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6013 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6013 Author: aurel32 Date: 2008-12-13 18:57:37 +0000 (Sat, 13 Dec 2008) Log Message: ----------- target-sh4: add prefi, icbi, synco (Vladimir Prus) Modified Paths: -------------- trunk/target-sh4/cpu.h trunk/target-sh4/translate.c Modified: trunk/target-sh4/cpu.h =================================================================== --- trunk/target-sh4/cpu.h 2008-12-13 18:57:28 UTC (rev 6012) +++ trunk/target-sh4/cpu.h 2008-12-13 18:57:37 UTC (rev 6013) @@ -89,6 +89,10 @@ #define NB_MMU_MODES 2 +enum sh_features { + SH_FEATURE_SH4A = 1, +}; + typedef struct CPUSH4State { int id; /* CPU model */ @@ -113,6 +117,9 @@ /* float point status register */ float_status fp_status; + /* The features that we should emulate. See sh_features above. */ + uint32_t features; + /* Those belong to the specific unit (SH7750) but are handled here */ uint32_t mmucr; /* MMU control register */ uint32_t pteh; /* page table entry high register */ Modified: trunk/target-sh4/translate.c =================================================================== --- trunk/target-sh4/translate.c 2008-12-13 18:57:28 UTC (rev 6012) +++ trunk/target-sh4/translate.c 2008-12-13 18:57:37 UTC (rev 6013) @@ -49,6 +49,7 @@ int memidx; uint32_t delayed_pc; int singlestep_enabled; + uint32_t features; } DisasContext; #if defined(CONFIG_USER_ONLY) @@ -206,6 +207,7 @@ uint32_t pvr; uint32_t prr; uint32_t cvr; + uint32_t features; } sh4_def_t; static sh4_def_t sh4_defs[] = { @@ -227,6 +229,7 @@ .pvr = 0x10300700, .prr = 0x00000200, .cvr = 0x71440211, + .features = SH_FEATURE_SH4A, }, }; @@ -271,6 +274,7 @@ env = qemu_mallocz(sizeof(CPUSH4State)); if (!env) return NULL; + env->features = def->features; cpu_exec_init(env); sh4_translate_init(); env->cpu_model_str = cpu_model; @@ -1562,6 +1566,21 @@ return; case 0x0083: /* pref @Rn */ return; + case 0x00d3: /* prefi @Rn */ + if (ctx->features & SH_FEATURE_SH4A) + return; + else + break; + case 0x00e3: /* icbi @Rn */ + if (ctx->features & SH_FEATURE_SH4A) + return; + else + break; + case 0x00ab: /* synco */ + if (ctx->features & SH_FEATURE_SH4A) + return; + else + break; case 0x4024: /* rotcl Rn */ { TCGv tmp = tcg_temp_new(); @@ -1805,6 +1824,7 @@ ctx.delayed_pc = -1; /* use delayed pc from env pointer */ ctx.tb = tb; ctx.singlestep_enabled = env->singlestep_enabled; + ctx.features = env->features; #ifdef DEBUG_DISAS if (loglevel & CPU_LOG_TB_CPU) {