Patchwork target-arm: Fix SWI (SVC) instruction in M profile.

login
register
mail settings
Submitter Alex_Rozenman@mentor.com
Date Dec. 26, 2012, 7:24 a.m.
Message ID <1356506686-31056-1-git-send-email-Alex_Rozenman@mentor.com>
Download mbox | patch
Permalink /patch/208147/
State New
Headers show

Comments

Alex_Rozenman@mentor.com - Dec. 26, 2012, 7:24 a.m.
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>
---
 target-arm/helper.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Peter Maydell - Jan. 8, 2013, 4:45 p.m.
On 26 December 2012 07:24, Alex Rozenman <Alex_Rozenman@mentor.com> wrote:
> 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>

Thanks, applied to target-arm.next.

-- PMM

Patch

diff --git a/target-arm/helper.c b/target-arm/helper.c
index e343fac..39195b2 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -1741,7 +1741,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: