]>
Commit | Line | Data |
---|---|---|
25402f5d | 1 | //\r |
b4e53e38 | 2 | // Copyright (c) 2012-2014, ARM Limited. All rights reserved.\r |
25402f5d HL |
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 | |
14 | .text\r | |
15 | .align 3\r | |
16 | \r | |
17 | GCC_ASM_EXPORT(ArmCallSmc)\r | |
25402f5d HL |
18 | \r |
19 | ASM_PFX(ArmCallSmc):\r | |
b4e53e38 OM |
20 | // Push x0 on the stack\r |
21 | str x0, [sp, #-8]!\r | |
25402f5d | 22 | \r |
b4e53e38 OM |
23 | // Load the SMC arguments values into the appropriate registers\r |
24 | ldp x6, x7, [x0, #48]\r | |
25 | ldp x4, x5, [x0, #32]\r | |
26 | ldp x2, x3, [x0, #16]\r | |
27 | ldp x0, x1, [x0, #0]\r | |
25402f5d | 28 | \r |
25402f5d | 29 | smc #0\r |
25402f5d | 30 | \r |
b4e53e38 OM |
31 | // Pop the ARM_SMC_ARGS structure address from the stack into x9\r |
32 | ldr x9, [sp], #8\r | |
33 | \r | |
34 | // Store the SMC returned values into the appropriate registers\r | |
35 | // A SMC call can return up to 4 values - we do not need to store back x4-x7.\r | |
36 | stp x2, x3, [x9, #16]\r | |
37 | stp x0, x1, [x9, #0]\r | |
38 | \r | |
39 | mov x0, x9\r | |
40 | \r | |
25402f5d | 41 | ret\r |