Skip to contentSkip to conversation

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

PATCH Applied Alex Rozenman 2 participants 2 messages Dec 26, 2012 – Jan 8, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-arm: Fix SWI (SVC) instruction in M profile.

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

---
 target-arm/helper.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-arm/helper.c +1 -1
index e343fac..39195b2 100644
@@ -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:
Signature · 1 line
1.7.9.6
#1 lore raw
Quoted 4 lines · Alex Rozenman

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

Thanks, applied to target-arm.next.

-- PMM