From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzUvv-0001Ae-Pb for qemu-devel@nongnu.org; Wed, 17 Jul 2013 12:50:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UzUvq-00074F-UT for qemu-devel@nongnu.org; Wed, 17 Jul 2013 12:50:31 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:36410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzUvq-00073q-Pc for qemu-devel@nongnu.org; Wed, 17 Jul 2013 12:50:26 -0400 From: Kwok Cheung Yeung Date: Wed, 17 Jul 2013 09:50:03 -0700 Message-ID: <1374079803-13742-1-git-send-email-kcy@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH] linux-user: Handle microMIPS encoding when processing trap exceptions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kwok Cheung Yeung , riku.voipio@iki.fi, aurelien@aurel32.net Decode trap instructions during the handling of a EXCP_TRAP according to the current ISA mode. Signed-off-by: Kwok Cheung Yeung --- 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