]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/ArmSvcLib/Arm/ArmSvc.asm
82d10c023ae302fff5fc4d33c55e2c599acd93ff
[mirror_edk2.git] / ArmPkg / Library / ArmSvcLib / Arm / ArmSvc.asm
1 //
2 // Copyright (c) 2016 - 2017, ARM Limited. All rights reserved.
3 //
4 // SPDX-License-Identifier: BSD-2-Clause-Patent
5 //
6 //
7
8
9 INCLUDE AsmMacroExport.inc
10
11 RVCT_ASM_EXPORT ArmCallSvc
12 // r0 will be popped just after the SVC call
13 push {r0, r4-r8}
14
15 // Load the SVC arguments values into the appropriate registers
16 ldm r0, {r0-r7}
17
18 svc #0
19
20 // Load the ARM_SVC_ARGS structure address from the stack into r8
21 ldr r8, [sp]
22
23 // Load the SVC returned values into the appropriate registers
24 // A SVC call can return up to 4 values - we do not need to store back r4-r7.
25 stm r8, {r0-r3}
26
27 mov r0, r8
28
29 // Restore the registers r4-r8
30 pop {r1, r4-r8}
31 bx lr
32
33 END