]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/AArch64/SwitchStack.S
MdePkg/BaseLib AARCH64: terminate stack frame list on stack switch
[mirror_edk2.git] / MdePkg / Library / BaseLib / AArch64 / SwitchStack.S
CommitLineData
807e2604
HL
1//------------------------------------------------------------------------------\r
2//\r
3// Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
4// Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
5// Portions copyright (c) 2011 - 2013, ARM Limited. All rights reserved.<BR>\r
6// This program and the accompanying materials\r
7// are licensed and made available under the terms and conditions of the BSD License\r
8// which accompanies this distribution. The full text of the license may be found at\r
9// http://opensource.org/licenses/bsd-license.php.\r
10//\r
11// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13//\r
14//------------------------------------------------------------------------------\r
15\r
16.text\r
17.align 5\r
18\r
0f895683
OM
19GCC_ASM_EXPORT(InternalSwitchStackAsm)\r
20GCC_ASM_EXPORT(CpuPause)\r
807e2604
HL
21\r
22/**\r
23//\r
24// This allows the caller to switch the stack and goes to the new entry point\r
25//\r
26// @param EntryPoint The pointer to the location to enter\r
27// @param Context Parameter to pass in\r
28// @param Context2 Parameter2 to pass in\r
29// @param NewStack New Location of the stack\r
30//\r
31// @return Nothing. Goes to the Entry Point passing in the new parameters\r
32//\r
33VOID\r
34EFIAPI\r
35InternalSwitchStackAsm (\r
36 SWITCH_STACK_ENTRY_POINT EntryPoint,\r
37 VOID *Context,\r
38 VOID *Context2,\r
39 VOID *NewStack\r
40 );\r
41**/\r
42ASM_PFX(InternalSwitchStackAsm):\r
35071e15 43 mov x29, #0\r
807e2604
HL
44 mov x30, x0\r
45 mov sp, x3\r
46 mov x0, x1\r
47 mov x1, x2\r
48 ret\r
49\r
50/**\r
51//\r
52// Requests CPU to pause for a short period of time.\r
53//\r
54// Requests CPU to pause for a short period of time. Typically used in MP\r
55// systems to prevent memory starvation while waiting for a spin lock.\r
56//\r
57VOID\r
58EFIAPI\r
59CpuPause (\r
60 VOID\r
61 )\r
62**/\r
63ASM_PFX(CpuPause):\r
64 nop\r
65 nop\r
66 nop\r
67 nop\r
68 nop\r
69 ret\r