]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/AArch64/SwitchStack.S
MdePkg/Library/BaseLib/AArch64: Comment style harmonization
[mirror_edk2.git] / MdePkg / Library / BaseLib / AArch64 / SwitchStack.S
CommitLineData
ec661594
PB
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
807e2604
HL
15\r
16.text\r
17.align 5\r
18\r
0f895683
OM
19GCC_ASM_EXPORT(InternalSwitchStackAsm)\r
20GCC_ASM_EXPORT(CpuPause)\r
807e2604 21\r
ec661594
PB
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
33#**/\r
34#VOID\r
35#EFIAPI\r
36#InternalSwitchStackAsm (\r
37# SWITCH_STACK_ENTRY_POINT EntryPoint,\r
38# VOID *Context,\r
39# VOID *Context2,\r
40# VOID *NewStack\r
41# );\r
42#\r
807e2604 43ASM_PFX(InternalSwitchStackAsm):\r
35071e15 44 mov x29, #0\r
807e2604
HL
45 mov x30, x0\r
46 mov sp, x3\r
47 mov x0, x1\r
48 mov x1, x2\r
49 ret\r
50\r
ec661594
PB
51#/**\r
52#\r
53# Requests CPU to pause for a short period of time.\r
54#\r
55# Requests CPU to pause for a short period of time. Typically used in MP\r
56# systems to prevent memory starvation while waiting for a spin lock.\r
57#\r
58#**/\r
59#VOID\r
60#EFIAPI\r
61#CpuPause (\r
62# VOID\r
63# )\r
64#\r
807e2604
HL
65ASM_PFX(CpuPause):\r
66 nop\r
67 nop\r
68 nop\r
69 nop\r
70 nop\r
71 ret\r