From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMER0-0006qJ-N9 for qemu-devel@nongnu.org; Mon, 03 Aug 2015 08:01:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMEQv-0002gS-2t for qemu-devel@nongnu.org; Mon, 03 Aug 2015 08:01:38 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:63685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMEQu-0002eA-UP for qemu-devel@nongnu.org; Mon, 03 Aug 2015 08:01:33 -0400 From: Leon Alrae Date: Mon, 3 Aug 2015 13:01:19 +0100 Message-ID: <1438603279-12432-1-git-send-email-leon.alrae@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH] target-mips: fix semihosting for microMIPS R6 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aurelien@aurel32.net In semihosting mode the SDBBP 1 instructions should trigger UHI syscall, but in QEMU this does not happen for recently added microMIPS R6. Consequently bare metal microMIPS R6 programs supporting UHI will not run. Signed-off-by: Leon Alrae --- target-mips/translate.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/target-mips/translate.c b/target-mips/translate.c index d1de35a..e299643 100644 --- a/target-mips/translate.c +++ b/target-mips/translate.c @@ -13278,10 +13278,14 @@ static void gen_pool16c_r6_insn(DisasContext *ctx) break; case R6_SDBBP16: /* SDBBP16 */ - if (ctx->hflags & MIPS_HFLAG_SBRI) { - generate_exception(ctx, EXCP_RI); + if (is_uhi(extract32(ctx->opcode, 6, 4))) { + gen_helper_do_semihosting(cpu_env); } else { - generate_exception(ctx, EXCP_DBp); + if (ctx->hflags & MIPS_HFLAG_SBRI) { + generate_exception(ctx, EXCP_RI); + } else { + generate_exception(ctx, EXCP_DBp); + } } break; } -- 2.1.0