13.8.1. angel_SWIreason_EnterSVC (0x17)

Sets the processor to Supervisor (SVC) mode and disables all interrupts by setting both interrupt mask bits in the new CPSR. Under Angel, the user stack pointer (r13_USR) is copied to the Supervisor stack pointer (r13_SVC) and the I and F bits in the current CPSR are set, disabling normal and fast interrupts.


If you are debugging with an EmbeddedICE interface:

  • the User mode stack pointer is not copied to the Supervisor stack pointer.

  • the I and F bits of the CPSR are not set.


On entry, r0 contains 0x17. Register r1 is not used. The CPSR can specify User or Supervisor mode.


On exit, r0 contains the address of a function to be called to return to User mode. The function has the following prototype:

void ReturnToUSR(void)


  • If debugging with ARMulatororMulti-ICE, r0 is set to zero to indicate that no function is available for returning to User mode.

  • If debugging with an EmbeddedICE interface, r0 is set to an undefined value and no function is available for returning to User mode.

If EnterSVC is called in User mode, this routine returns the caller to User mode and restores the interrupt flags. If EnterSVC is not called in User mode, the action of this routine is undefined.

If entered in User mode, the Supervisor stack is lost as a result of copying the user stack pointer. The return to User routine restores r13_SVC to the Angel Supervisor mode stack value, but this stack should not be used by applications.

After executing the SWI, the current link register will be r14_SVC, not r14_USR. If the value of r14_USR is needed after the call, it should be pushed onto the stack before the call and popped afterwards, as for a BL function call.

Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0040D