From f0bf3c2e3b532ebc782872a25f62c7a7f9b5c69e Mon Sep 17 00:00:00 2001 From: Leon Alrae <leon.alrae@imgtec.com> Date: Wed, 14 Feb 2018 19:17:35 -0500 Subject: [PATCH] target-mips: fix semihosting for microMIPS R6 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. Backports commit 060ebfef1a09b58fb219b3769b72efb407515bf1 from qemu --- qemu/target-mips/translate.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/qemu/target-mips/translate.c b/qemu/target-mips/translate.c index 536144b6..51830b6a 100644 --- a/qemu/target-mips/translate.c +++ b/qemu/target-mips/translate.c @@ -13371,10 +13371,15 @@ static void gen_pool16c_r6_insn(DisasContext *ctx) break; case R6_SDBBP16: /* SDBBP16 */ - if (ctx->hflags & MIPS_HFLAG_SBRI) { - generate_exception(ctx, EXCP_RI); - } else { - generate_exception(ctx, EXCP_DBp); + // UNICORN: Commented out + /*if (is_uhi(extract32(ctx->opcode, 6, 4))) { + gen_helper_do_semihosting(cpu_env); + } else*/ { + if (ctx->hflags & MIPS_HFLAG_SBRI) { + generate_exception(ctx, EXCP_RI); + } else { + generate_exception(ctx, EXCP_DBp); + } } break; }