Patchwork [2/2] target-arm: Fix SWI (SVC) instruction in M profile.

login
register
mail settings
Submitter Peter Maydell
Date Jan. 11, 2013, 3:36 p.m.
Message ID <1357918615-24337-3-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/211371/
State New
Headers show

Comments

Peter Maydell - Jan. 11, 2013, 3:36 p.m.
From: "Alex_Rozenman@mentor.com" <Alex_Rozenman@mentor.com>

When do_interrupt_v7m is called with EXCP_SWI, the PC already
points to the next instruction. Don't modify it here.

Signed-off-by: Alex Rozenman <Alex_Rozenman@mentor.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/helper.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/target-arm/helper.c b/target-arm/helper.c
index 0525aec..66ab78e 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -1736,7 +1736,7 @@  static void do_interrupt_v7m(CPUARMState *env)
         armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_USAGE);
         return;
     case EXCP_SWI:
-        env->regs[15] += 2;
+        /* The PC already points to the next instruction.  */
         armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_SVC);
         return;
     case EXCP_PREFETCH_ABORT: