qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Rabin Vincent <rabin@rab.in>
To: qemu-devel@nongnu.org
Cc: Rabin Vincent <rabin@rab.in>
Subject: [Qemu-devel] [PATCH 2/3] target-arm: implement Thumb-2 exception return
Date: Mon, 15 Feb 2010 00:02:35 +0530	[thread overview]
Message-ID: <1266172357-9252-3-git-send-email-rabin@rab.in> (raw)
In-Reply-To: <1266172357-9252-1-git-send-email-rabin@rab.in>

Support the "subs pc, lr" Thumb-2 exception return instruction.

Signed-off-by: Rabin Vincent <rabin@rab.in>
---
 target-arm/translate.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/target-arm/translate.c b/target-arm/translate.c
index 10a516b..f0667e5 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -8001,8 +8001,17 @@ static int disas_thumb2_insn(CPUState *env, DisasContext *s, uint16_t insn_hw1)
                         gen_bx(s, tmp);
                         break;
                     case 5: /* Exception return.  */
-                        /* Unpredictable in user mode.  */
-                        goto illegal_op;
+                        if (IS_USER(s)) {
+                            goto illegal_op;
+                        }
+
+                        tmp = load_reg(s, rn);
+                        tmp2 = new_tmp();
+                        tcg_gen_movi_i32(tmp2, insn & 0xff);
+                        gen_helper_sub_cc(tmp, tmp, tmp2);
+                        gen_exception_return(s, tmp);
+                        dead_tmp(tmp2);
+                        break;
                     case 6: /* mrs cpsr.  */
                         tmp = new_tmp();
                         if (IS_M(env)) {
-- 
1.6.6

  parent reply	other threads:[~2010-02-14 18:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-14 18:32 [Qemu-devel] [PATCH 0/3] target-arm: Thumb(-2) exception support Rabin Vincent
2010-02-14 18:32 ` [Qemu-devel] [PATCH 1/3] target-arm: fix thumb CPS Rabin Vincent
2010-02-14 18:32 ` Rabin Vincent [this message]
2010-02-14 18:32 ` [Qemu-devel] [PATCH 3/3] target-arm: support thumb exception handlers Rabin Vincent

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=1266172357-9252-3-git-send-email-rabin@rab.in \
    --to=rabin@rab.in \
    --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 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).