]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/ArmHvcLib/AArch64/ArmHvc.S
ArmPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / ArmPkg / Library / ArmHvcLib / AArch64 / ArmHvc.S
CommitLineData
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 4//\r
4059386c 5// SPDX-License-Identifier: BSD-2-Clause-Patent\r
58e92b39
AB
6//\r
7//\r
8\r
de656e66 9#include <AsmMacroIoLibV8.h>\r
58e92b39 10\r
de656e66 11ASM_FUNC(ArmCallHvc)\r
fb7ea611
OM
12 // Push x0 on the stack - The stack must always be quad-word aligned\r
13 str x0, [sp, #-16]!\r
58e92b39
AB
14\r
15 // Load the HVC arguments values into the appropriate registers\r
16 ldp x6, x7, [x0, #48]\r
17 ldp x4, x5, [x0, #32]\r
18 ldp x2, x3, [x0, #16]\r
19 ldp x0, x1, [x0, #0]\r
20\r
21 hvc #0\r
22\r
23 // Pop the ARM_HVC_ARGS structure address from the stack into x9\r
fb7ea611 24 ldr x9, [sp], #16\r
58e92b39 25\r
fb7ea611 26 // Store the HVC returned values into the ARM_HVC_ARGS structure.\r
58e92b39
AB
27 // A HVC call can return up to 4 values\r
28 stp x2, x3, [x9, #16]\r
29 stp x0, x1, [x9, #0]\r
30\r
31 mov x0, x9\r
32\r
33 ret\r