From: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>
To: qemu-devel@nongnu.org
Subject: [PATCH] [RESEND] SH4 : sleep instruction bug fix (was Re: [Qemu-devel] [PATCH] SH4: Serial controller improvement and sleep op bug fix)
Date: Mon, 15 Sep 2008 14:28:53 +0900 [thread overview]
Message-ID: <48CDF295.4030703@juno.dti.ne.jp> (raw)
In-Reply-To: <20080914165648.GE22422@volta.aurel32.net>
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.
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;
next prev parent reply other threads:[~2008-09-15 5:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-07 14:34 [Qemu-devel] [PATCH] SH4: Serial controller improvement and sleep op bug fix Shin-ichiro KAWASAKI
2008-09-14 16:56 ` Aurelien Jarno
2008-09-15 5:28 ` Shin-ichiro KAWASAKI [this message]
2008-09-15 6:42 ` [PATCH] [RESEND] SH4 : sleep instruction bug fix (was Re: [Qemu-devel] [PATCH] SH4: Serial controller improvement and sleep op bug fix) Aurelien Jarno
2008-09-15 5:42 ` [Qemu-devel] [PATCH] [RESEND] SH4 : Serial controller improvement Shin-ichiro KAWASAKI
2008-09-15 7:06 ` Aurelien Jarno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48CDF295.4030703@juno.dti.ne.jp \
--to=kawasaki@juno.dti.ne.jp \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).