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 3/3] target-arm: support thumb exception handlers
Date: Mon, 15 Feb 2010 00:02:36 +0530	[thread overview]
Message-ID: <1266172357-9252-4-git-send-email-rabin@rab.in> (raw)
In-Reply-To: <1266172357-9252-1-git-send-email-rabin@rab.in>

When handling an exception, switch to the correct mode based on the
Thumb Exception (TE) bit in the SCTLR.

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

diff --git a/target-arm/helper.c b/target-arm/helper.c
index 27001e8..434628b 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -824,11 +824,10 @@ void do_interrupt(CPUARMState *env)
     env->spsr = cpsr_read(env);
     /* Clear IT bits.  */
     env->condexec_bits = 0;
-    /* Switch to the new mode, and switch to Arm mode.  */
-    /* ??? Thumb interrupt handlers not implemented.  */
+    /* Switch to the new mode, and to the correct instruction set.  */
     env->uncached_cpsr = (env->uncached_cpsr & ~CPSR_M) | new_mode;
     env->uncached_cpsr |= mask;
-    env->thumb = 0;
+    env->thumb = !!(env->cp15.c1_sys & (1 << 30));
     env->regs[14] = env->regs[15] + offset;
     env->regs[15] = addr;
     env->interrupt_request |= CPU_INTERRUPT_EXITTB;
-- 
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 ` [Qemu-devel] [PATCH 2/3] target-arm: implement Thumb-2 exception return Rabin Vincent
2010-02-14 18:32 ` Rabin Vincent [this message]

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-4-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).