From: "陳韋任 (Wei-Ren Chen)" <chenwj@iis.sinica.edu.tw>
To: li guang <lig.fnst@cn.fujitsu.com>
Cc: "Aurelien Jarno" <aurelien@aurel32.net>,
qemu-devel@nongnu.org,
"陳韋任 (Wei-Ren Chen)" <chenwj@iis.sinica.edu.tw>,
"Johnson, Eric" <ericj@mips.com>
Subject: Re: [Qemu-devel] [PATCH] target-mips: Use EXCP_SC rather than a magic number
Date: Thu, 20 Dec 2012 10:14:20 +0800 [thread overview]
Message-ID: <20121220021420.GA11565@cs.nctu.edu.tw> (raw)
In-Reply-To: <1355968783.19189.7.camel@liguang.fnst.cn.fujitsu.com>
Hi Li,
> > > Signed-off-by: Chen Wei-Ren <chenwj@iis.sinica.edu.tw>
> > > ---
> > > target-mips/op_helper.c | 6 +++---
> > > 1 files changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
> > > index f45d494..98a445c 100644
> > > --- a/target-mips/op_helper.c
> > > +++ b/target-mips/op_helper.c
> > > @@ -39,10 +39,10 @@ static inline void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env,
> > > uintptr_t pc)
> > > {
> > > TranslationBlock *tb;
> > > -#if 1
> > > - if (exception < 0x100)
> > > + if (exception < EXCP_SC) {
> > > qemu_log("%s: %d %d\n", __func__, exception, error_code);
> > > -#endif
> > > + }
> > > +
>
> seems original '#if 1, #endif' statement
> is for temporary debug only,
> so maybe can be concealed out entirely.
> for log purpose, every exception code
> will log when 'do_interrupt' for MIPS
> if log is enabled.
Thanks for your feedback. You mean the code snippet below?
--- target-mips/helper.c
void do_interrupt (CPUMIPSState *env)
{
...
if (qemu_log_enabled() && env->exception_index != EXCP_EXT_INTERRUPT) {
if (env->exception_index < 0 || env->exception_index > EXCP_LAST)
name = "unknown";
else
name = excp_names[env->exception_index];
qemu_log("%s enter: PC " TARGET_FMT_lx " EPC " TARGET_FMT_lx " %s exception\n",
__func__, env->active_tc.PC, env->CP0_EPC, name);
}
...
}
Maybe we can do this way?
---
diff --git a/target-mips/cpu.h b/target-mips/cpu.h
index 31602ac..507a213 100644
--- a/target-mips/cpu.h
+++ b/target-mips/cpu.h
@@ -616,9 +616,9 @@ enum {
EXCP_DSPDIS,
EXCP_LAST = EXCP_DSPDIS,
+ /* Dummy exception for conditional stores. */
+ EXCP_SC = EXCP_LAST,
};
-/* Dummy exception for conditional stores. */
-#define EXCP_SC 0x100
/*
* This is an interrnally generated WAKE request line.
---
Aurelien, Johnson, thoughts? :)
Regards,
chenwj
--
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj
next prev parent reply other threads:[~2012-12-20 2:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-10 16:15 [Qemu-devel] [PATCH] target-mips: Use EXCP_SC rather than a magic number 陳韋任 (Wei-Ren Chen)
2012-12-20 1:23 ` 陳韋任 (Wei-Ren Chen)
2012-12-20 1:59 ` li guang
2012-12-20 2:14 ` 陳韋任 (Wei-Ren Chen) [this message]
2013-01-01 11:07 ` Aurelien Jarno
2013-01-01 11:03 ` 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=20121220021420.GA11565@cs.nctu.edu.tw \
--to=chenwj@iis.sinica.edu.tw \
--cc=aurelien@aurel32.net \
--cc=ericj@mips.com \
--cc=lig.fnst@cn.fujitsu.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.