]>
Commit | Line | Data |
---|---|---|
58e92b39 AB |
1 | //\r |
2 | // Copyright (c) 2012-2014, ARM Limited. All rights reserved.\r | |
de656e66 | 3 | // Copyright (c) 2014-2016, Linaro Limited. All rights reserved.\r |
58e92b39 AB |
4 | //\r |
5 | // This program and the accompanying materials\r | |
6 | // are licensed and made available under the terms and conditions of the BSD License\r | |
7 | // which accompanies this distribution. The full text of the license may be found at\r | |
8 | // http://opensource.org/licenses/bsd-license.php\r | |
9 | //\r | |
10 | // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | //\r | |
13 | //\r | |
14 | \r | |
de656e66 | 15 | #include <AsmMacroIoLibV8.h>\r |
58e92b39 | 16 | \r |
de656e66 | 17 | ASM_FUNC(ArmCallHvc)\r |
fb7ea611 OM |
18 | // Push x0 on the stack - The stack must always be quad-word aligned\r |
19 | str x0, [sp, #-16]!\r | |
58e92b39 AB |
20 | \r |
21 | // Load the HVC arguments values into the appropriate registers\r | |
22 | ldp x6, x7, [x0, #48]\r | |
23 | ldp x4, x5, [x0, #32]\r | |
24 | ldp x2, x3, [x0, #16]\r | |
25 | ldp x0, x1, [x0, #0]\r | |
26 | \r | |
27 | hvc #0\r | |
28 | \r | |
29 | // Pop the ARM_HVC_ARGS structure address from the stack into x9\r | |
fb7ea611 | 30 | ldr x9, [sp], #16\r |
58e92b39 | 31 | \r |
fb7ea611 | 32 | // Store the HVC returned values into the ARM_HVC_ARGS structure.\r |
58e92b39 AB |
33 | // A HVC call can return up to 4 values\r |
34 | stp x2, x3, [x9, #16]\r | |
35 | stp x0, x1, [x9, #0]\r | |
36 | \r | |
37 | mov x0, x9\r | |
38 | \r | |
39 | ret\r |