From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kf7mt-0003IJ-WB for qemu-devel@nongnu.org; Mon, 15 Sep 2008 02:42:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kf7mt-0003Ha-36 for qemu-devel@nongnu.org; Mon, 15 Sep 2008 02:42:19 -0400 Received: from [199.232.76.173] (port=36788 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kf7mt-0003HU-02 for qemu-devel@nongnu.org; Mon, 15 Sep 2008 02:42:19 -0400 Received: from hall.aurel32.net ([91.121.138.14]:45203) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kf7ms-00026i-Uh for qemu-devel@nongnu.org; Mon, 15 Sep 2008 02:42:19 -0400 Received: from volta.aurel32.net ([2002:52e8:2fb:1:21e:8cff:feb0:693b]) by hall.aurel32.net with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Kf7mp-0004Bd-PN for qemu-devel@nongnu.org; Mon, 15 Sep 2008 08:42:16 +0200 Received: from aurel32 by volta.aurel32.net with local (Exim 4.69) (envelope-from ) id 1Kf7mp-000382-0H for qemu-devel@nongnu.org; Mon, 15 Sep 2008 08:42:15 +0200 Date: Mon, 15 Sep 2008 08:42:14 +0200 From: Aurelien Jarno Subject: Re: [PATCH] [RESEND] SH4 : sleep instruction bug fix (was Re: [Qemu-devel] [PATCH] SH4: Serial controller improvement and sleep op bug fix) Message-ID: <20080915064214.GA9801@volta.aurel32.net> References: <48C3E662.1010204@juno.dti.ne.jp> <20080914165648.GE22422@volta.aurel32.net> <48CDF295.4030703@juno.dti.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <48CDF295.4030703@juno.dti.ne.jp> 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 On Mon, Sep 15, 2008 at 02:28:53PM +0900, Shin-ichiro KAWASAKI wrote: > Thank you for your response! > > Aurelien Jarno wrote: >> On Sun, Sep 07, 2008 at 11:34:10PM +0900, Shin-ichiro KAWASAKI wrote: >> >> Next time could you please send two different patches, so that one patch >> doesn't block the other. > > I see. I'll do so next time. Working with this patch, I'll resend twice to > divide into sleep instruction part and serial part. > > >>> Index: target-sh4/helper.h >>> =================================================================== >>> --- target-sh4/helper.h (revision 5132) >>> +++ target-sh4/helper.h (working copy) >>> @@ -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, (int32_t)) >>> DEF_HELPER(void, helper_trapa, (uint32_t)) >>> DEF_HELPER(uint32_t, helper_addv, (uint32_t, uint32_t)) >>> Index: target-sh4/op_helper.c >>> =================================================================== >>> --- target-sh4/op_helper.c (revision 5132) >>> +++ target-sh4/op_helper.c (working copy) >>> @@ -94,10 +94,11 @@ >>> cpu_loop_exit(); >>> } >>> -void helper_sleep(void) >>> +void helper_sleep(int32_t next_pc) >> >> Given then env->pc is unsigned, I think it should be uint32_t instead of >> int32_t here. Same in helper.h > > This is my mistake. Thanks for pointing it out. > This mail is attached with new patch of sleep instruction part. Thanks, applied. > Regards, > Shin-ichiro KAWASAKI > > > Index: trunk/target-sh4/helper.h > =================================================================== > --- trunk/target-sh4/helper.h (revision 5219) > +++ trunk/target-sh4/helper.h (working copy) > @@ -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)) > Index: trunk/target-sh4/op_helper.c > =================================================================== > --- trunk/target-sh4/op_helper.c (revision 5219) > +++ trunk/target-sh4/op_helper.c (working copy) > @@ -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(); > } > > Index: trunk/target-sh4/translate.c > =================================================================== > --- trunk/target-sh4/translate.c (revision 5219) > +++ trunk/target-sh4/translate.c (working copy) > @@ -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; > > > -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net