svc
Supervisor Call (Thumb)
SVC #<imm>
System Call (Thumb encoding).
Details
Supervisor Call (Thumb encoding). This T32 instruction raises a Supervisor Call exception (formerly SWI), transitioning to privileged mode to perform a system service. The immediate value identifies the requested service. No condition flags are affected; execution does not return to the next instruction unless the exception handler explicitly restores context.
Pseudocode Operation
SupervisorCallException(imm8)
Example
SVC #16
Encoding
Binary Layout
1101111
1
imm8
Operands
-
imm
ID
Reference (Arm AArch32 ISA)
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0x0F000000 | SVC{<c>}{<q>} {#}<imm> | A32 | cond | 1111 | imm24 | ||
| 0xDF00 | SVC{<c>}{<q>} {#}<imm> | T32 | 1101111 | 1 | imm8 |
Description
Supervisor Call causes a Supervisor Call exception. For more information, see Supervisor Call (SVC) exception.
Software can use this instruction as a call to an operating system to provide a service.
In the following cases, the Supervisor Call exception generated by the SVC instruction is taken to Hyp mode:
In these cases, the HSR, Hyp Syndrome Register identifies that the exception entry was caused by a Supervisor Call exception, EC value 0x11, see Use of the HSR. The immediate field in the HSR:
Operation
if ConditionPassed() then
EncodingSpecificOperations();
AArch32.CheckForSVCTrap(imm32<15:0>);
AArch32.CallSupervisor(imm32<15:0>);