Keil Logo

angel_SWIreason_EnterSVC (0x17)

11.5 angel_SWIreason_EnterSVC (0x17)

Sets the processor to Supervisor mode and disables all interrupts by setting both interrupt mask bits in the new CPSR.

With a debug hardware unit, such as ARM RVI™ debug unit or ARM DSTREAM™ debug and trace unit:
  • the User stack pointer, R13_USR, is copied to the Supervisor mode stack pointer, R13_SVC
  • the I and F bits in the current CPSR are set, which disables normal and fast interrupts.


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 EnterSVC is called in User mode, this routine returns the caller to User mode and restores the interrupt flags. Otherwise, the action of this routine is undefined.
If entered in User mode, the Supervisor mode stack is lost as a result of copying the user stack pointer. The return to User routine restores R13_SVC to the Supervisor mode stack value, but this stack must not be used by applications.
After executing the SVC, the current link register is R14_SVC, not R14_USR. If the value of R14_USR is required after the call, it must be pushed onto the stack before the call and popped afterwards, as for a BL function call.
Non-ConfidentialPDF file icon PDF versionARM DUI0375H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.