]>
Commit | Line | Data |
---|---|---|
eac42a51 | 1 | //\r |
b4e53e38 | 2 | // Copyright (c) 2012-2014, ARM Limited. All rights reserved.\r |
eac42a51 | 3 | //\r |
4059386c | 4 | // SPDX-License-Identifier: BSD-2-Clause-Patent\r |
eac42a51 | 5 | //\r |
6 | //\r | |
7 | \r | |
eac42a51 | 8 | \r |
efda1775 | 9 | INCLUDE AsmMacroExport.inc\r |
eac42a51 | 10 | \r |
efda1775 | 11 | RVCT_ASM_EXPORT ArmCallSmc\r |
b4e53e38 OM |
12 | push {r4-r8}\r |
13 | // r0 will be popped just after the SMC call\r | |
432dc3c1 | 14 | push {r0}\r |
eac42a51 | 15 | \r |
b4e53e38 OM |
16 | // Load the SMC arguments values into the appropriate registers\r |
17 | ldr r7, [r0, #28]\r | |
18 | ldr r6, [r0, #24]\r | |
19 | ldr r5, [r0, #20]\r | |
20 | ldr r4, [r0, #16]\r | |
21 | ldr r3, [r0, #12]\r | |
22 | ldr r2, [r0, #8]\r | |
23 | ldr r1, [r0, #4]\r | |
24 | ldr r0, [r0, #0]\r | |
eac42a51 | 25 | \r |
eac42a51 | 26 | smc #0\r |
eac42a51 | 27 | \r |
b4e53e38 OM |
28 | // Pop the ARM_SMC_ARGS structure address from the stack into r8\r |
29 | pop {r8}\r | |
30 | \r | |
31 | // Load the SMC returned values into the appropriate registers\r | |
32 | // A SMC call can return up to 4 values - we do not need to store back r4-r7.\r | |
33 | str r3, [r8, #12]\r | |
34 | str r2, [r8, #8]\r | |
35 | str r1, [r8, #4]\r | |
36 | str r0, [r8, #0]\r | |
37 | \r | |
38 | mov r0, r8\r | |
39 | \r | |
40 | // Restore the registers r4-r8\r | |
41 | pop {r4-r8}\r | |
42 | \r | |
166c01fb | 43 | bx lr\r |
eac42a51 | 44 | \r |
45 | END\r |