From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kf7n6-0003ON-VY for qemu-devel@nongnu.org; Mon, 15 Sep 2008 02:42:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kf7n6-0003Nc-CV for qemu-devel@nongnu.org; Mon, 15 Sep 2008 02:42:32 -0400 Received: from [199.232.76.173] (port=36792 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kf7n6-0003NT-0D for qemu-devel@nongnu.org; Mon, 15 Sep 2008 02:42:32 -0400 Received: from savannah.gnu.org ([199.232.41.3]:50385 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 1Kf7n6-00028Y-5y for qemu-devel@nongnu.org; Mon, 15 Sep 2008 02:42:32 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kf7n4-0002xd-T0 for qemu-devel@nongnu.org; Mon, 15 Sep 2008 06:42:30 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kf7n4-0002xZ-KV for qemu-devel@nongnu.org; Mon, 15 Sep 2008 06:42:30 +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: Mon, 15 Sep 2008 06:42:30 +0000 Subject: [Qemu-devel] [5220] SH4: sleep instruction bug fix 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: 5220 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5220 Author: aurel32 Date: 2008-09-15 06:42:30 +0000 (Mon, 15 Sep 2008) Log Message: ----------- SH4: sleep instruction bug fix fix a bug on 'sleep' instruction, which have caused halt of idle task. As i386 'hlt' instruction does, it should save PC before sleep. (Shin-ichiro KAWASAKI) Modified Paths: -------------- trunk/target-sh4/helper.h trunk/target-sh4/op_helper.c trunk/target-sh4/translate.c Modified: trunk/target-sh4/helper.h =================================================================== --- trunk/target-sh4/helper.h 2008-09-14 19:16:21 UTC (rev 5219) +++ trunk/target-sh4/helper.h 2008-09-15 06:42:30 UTC (rev 5220) @@ -6,7 +6,7 @@ DEF_HELPER(void, helper_raise_illegal_instruction, (void)) DEF_HELPER(void, helper_raise_slot_illegal_instruction, (void)) DEF_HELPER(void, helper_debug, (void)) -DEF_HELPER(void, helper_sleep, (void)) +DEF_HELPER(void, helper_sleep, (uint32_t)) DEF_HELPER(void, helper_trapa, (uint32_t)) DEF_HELPER(uint32_t, helper_addv, (uint32_t, uint32_t)) Modified: trunk/target-sh4/op_helper.c =================================================================== --- trunk/target-sh4/op_helper.c 2008-09-14 19:16:21 UTC (rev 5219) +++ trunk/target-sh4/op_helper.c 2008-09-15 06:42:30 UTC (rev 5220) @@ -94,10 +94,11 @@ cpu_loop_exit(); } -void helper_sleep(void) +void helper_sleep(uint32_t next_pc) { env->halted = 1; env->exception_index = EXCP_HLT; + env->pc = next_pc; cpu_loop_exit(); } Modified: trunk/target-sh4/translate.c =================================================================== --- trunk/target-sh4/translate.c 2008-09-14 19:16:21 UTC (rev 5219) +++ trunk/target-sh4/translate.c 2008-09-15 06:42:30 UTC (rev 5220) @@ -505,7 +505,7 @@ return; case 0x001b: /* sleep */ if (ctx->memidx) { - tcg_gen_helper_0_0(helper_sleep); + tcg_gen_helper_0_1(helper_sleep, tcg_const_i32(ctx->pc + 2)); } else { tcg_gen_helper_0_0(helper_raise_illegal_instruction); ctx->bstate = BS_EXCP;