qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kwok Cheung Yeung <kcy@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: Kwok Cheung Yeung <kcy@codesourcery.com>,
	riku.voipio@iki.fi, aurelien@aurel32.net
Subject: [Qemu-devel] [PATCH] linux-user: Handle microMIPS encoding when processing trap exceptions
Date: Wed, 17 Jul 2013 09:50:03 -0700	[thread overview]
Message-ID: <1374079803-13742-1-git-send-email-kcy@codesourcery.com> (raw)

Decode trap instructions during the handling of a EXCP_TRAP according to
the current ISA mode.

Signed-off-by: Kwok Cheung Yeung <kcy@codesourcery.com>
---
 linux-user/main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/linux-user/main.c b/linux-user/main.c
index 7f15d3d..c417e26 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2379,7 +2379,10 @@ done_syscall:
 
                 /* The immediate versions don't provide a code.  */
                 if (!(trap_instr & 0xFC000000)) {
-                    code = ((trap_instr >> 6) & ((1 << 10) - 1));
+                    if (env->hflags & MIPS_HFLAG_M16)   /* microMIPS mode */
+                        code = ((trap_instr >> 12) & ((1 << 4) - 1));
+                    else
+                        code = ((trap_instr >> 6) & ((1 << 10) - 1));
                 }
 
                 if (do_break(env, &info, code) != 0) {
-- 
1.8.3.3

             reply	other threads:[~2013-07-17 16:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 16:50 Kwok Cheung Yeung [this message]
2013-07-17 17:20 ` [Qemu-devel] [PATCH] linux-user: Handle microMIPS encoding when processing trap exceptions Peter Maydell

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=1374079803-13742-1-git-send-email-kcy@codesourcery.com \
    --to=kcy@codesourcery.com \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /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).