]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/ArmSmcLib/Arm/ArmSmc.asm
ArmPkg: update RVCT assembly functions to use new RVCT_ASM_EXPORT macro
[mirror_edk2.git] / ArmPkg / Library / ArmSmcLib / Arm / ArmSmc.asm
CommitLineData
eac42a51 1//\r
b4e53e38 2// Copyright (c) 2012-2014, ARM Limited. All rights reserved.\r
eac42a51 3//\r
4// This program and the accompanying materials\r
5// are licensed and made available under the terms and conditions of the BSD License\r
6// which accompanies this distribution. The full text of the license may be found at\r
7// http://opensource.org/licenses/bsd-license.php\r
8//\r
9// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11//\r
12//\r
13\r
eac42a51 14\r
efda1775 15 INCLUDE AsmMacroExport.inc\r
eac42a51 16\r
efda1775 17 RVCT_ASM_EXPORT ArmCallSmc\r
b4e53e38
OM
18 push {r4-r8}\r
19 // r0 will be popped just after the SMC call\r
432dc3c1 20 push {r0}\r
eac42a51 21\r
b4e53e38
OM
22 // Load the SMC arguments values into the appropriate registers\r
23 ldr r7, [r0, #28]\r
24 ldr r6, [r0, #24]\r
25 ldr r5, [r0, #20]\r
26 ldr r4, [r0, #16]\r
27 ldr r3, [r0, #12]\r
28 ldr r2, [r0, #8]\r
29 ldr r1, [r0, #4]\r
30 ldr r0, [r0, #0]\r
eac42a51 31\r
eac42a51 32 smc #0\r
eac42a51 33\r
b4e53e38
OM
34 // Pop the ARM_SMC_ARGS structure address from the stack into r8\r
35 pop {r8}\r
36\r
37 // Load the SMC returned values into the appropriate registers\r
38 // A SMC call can return up to 4 values - we do not need to store back r4-r7.\r
39 str r3, [r8, #12]\r
40 str r2, [r8, #8]\r
41 str r1, [r8, #4]\r
42 str r0, [r8, #0]\r
43\r
44 mov r0, r8\r
45\r
46 // Restore the registers r4-r8\r
47 pop {r4-r8}\r
48\r
166c01fb 49 bx lr\r
eac42a51 50\r
51 END\r