]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/ArmSvcLib/Arm/ArmSvc.asm
8f9ad17a6ae033678036a61fed3bd9d0c70046b9
[mirror_edk2.git] / ArmPkg / Library / ArmSvcLib / Arm / ArmSvc.asm
1 //
2 // Copyright (c) 2016 - 2017, ARM Limited. All rights reserved.
3 //
4 // This program and the accompanying materials
5 // are licensed and made available under the terms and conditions of the BSD License
6 // which accompanies this distribution. The full text of the license may be found at
7 // http://opensource.org/licenses/bsd-license.php
8 //
9 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 //
12 //
13
14
15 INCLUDE AsmMacroExport.inc
16
17 RVCT_ASM_EXPORT ArmCallSvc
18 // r0 will be popped just after the SVC call
19 push {r0, r4-r8}
20
21 // Load the SVC arguments values into the appropriate registers
22 ldm r0, {r0-r7}
23
24 svc #0
25
26 // Load the ARM_SVC_ARGS structure address from the stack into r8
27 ldr r8, [sp]
28
29 // Load the SVC returned values into the appropriate registers
30 // A SVC call can return up to 4 values - we do not need to store back r4-r7.
31 stm r8, {r0-r3}
32
33 mov r0, r8
34
35 // Restore the registers r4-r8
36 pop {r1, r4-r8}
37 bx lr
38
39 END