]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/AArch64/SwitchStack.S
MdePkg: Replace BSD License with BSD+Patent License
[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
9344f092 6# SPDX-License-Identifier: BSD-2-Clause-Patent\r
ec661594
PB
7#\r
8#------------------------------------------------------------------------------\r
807e2604
HL
9\r
10.text\r
11.align 5\r
12\r
0f895683
OM
13GCC_ASM_EXPORT(InternalSwitchStackAsm)\r
14GCC_ASM_EXPORT(CpuPause)\r
807e2604 15\r
ec661594
PB
16#/**\r
17#\r
18# This allows the caller to switch the stack and goes to the new entry point\r
19#\r
20# @param EntryPoint The pointer to the location to enter\r
21# @param Context Parameter to pass in\r
22# @param Context2 Parameter2 to pass in\r
23# @param NewStack New Location of the stack\r
24#\r
25# @return Nothing. Goes to the Entry Point passing in the new parameters\r
26#\r
27#**/\r
28#VOID\r
29#EFIAPI\r
30#InternalSwitchStackAsm (\r
31# SWITCH_STACK_ENTRY_POINT EntryPoint,\r
32# VOID *Context,\r
33# VOID *Context2,\r
34# VOID *NewStack\r
35# );\r
36#\r
807e2604 37ASM_PFX(InternalSwitchStackAsm):\r
35071e15 38 mov x29, #0\r
807e2604
HL
39 mov x30, x0\r
40 mov sp, x3\r
41 mov x0, x1\r
42 mov x1, x2\r
43 ret\r
44\r
ec661594
PB
45#/**\r
46#\r
47# Requests CPU to pause for a short period of time.\r
48#\r
49# Requests CPU to pause for a short period of time. Typically used in MP\r
50# systems to prevent memory starvation while waiting for a spin lock.\r
51#\r
52#**/\r
53#VOID\r
54#EFIAPI\r
55#CpuPause (\r
56# VOID\r
57# )\r
58#\r
807e2604
HL
59ASM_PFX(CpuPause):\r
60 nop\r
61 nop\r
62 nop\r
63 nop\r
64 nop\r
65 ret\r