]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/AArch64/SwitchStack.S
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Library / BaseLib / AArch64 / SwitchStack.S
1 #------------------------------------------------------------------------------
2 #
3 # Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
4 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
5 # Portions copyright (c) 2011 - 2013, ARM Limited. All rights reserved.<BR>
6 # SPDX-License-Identifier: BSD-2-Clause-Patent
7 #
8 #------------------------------------------------------------------------------
9
10 .text
11 .align 5
12
13 GCC_ASM_EXPORT(InternalSwitchStackAsm)
14 GCC_ASM_EXPORT(CpuPause)
15
16 #/**
17 #
18 # This allows the caller to switch the stack and goes to the new entry point
19 #
20 # @param EntryPoint The pointer to the location to enter
21 # @param Context Parameter to pass in
22 # @param Context2 Parameter2 to pass in
23 # @param NewStack New Location of the stack
24 #
25 # @return Nothing. Goes to the Entry Point passing in the new parameters
26 #
27 #**/
28 #VOID
29 #EFIAPI
30 #InternalSwitchStackAsm (
31 # SWITCH_STACK_ENTRY_POINT EntryPoint,
32 # VOID *Context,
33 # VOID *Context2,
34 # VOID *NewStack
35 # );
36 #
37 ASM_PFX(InternalSwitchStackAsm):
38 mov x29, #0
39 mov x30, x0
40 mov sp, x3
41 mov x0, x1
42 mov x1, x2
43 ret
44
45 #/**
46 #
47 # Requests CPU to pause for a short period of time.
48 #
49 # Requests CPU to pause for a short period of time. Typically used in MP
50 # systems to prevent memory starvation while waiting for a spin lock.
51 #
52 #**/
53 #VOID
54 #EFIAPI
55 #CpuPause (
56 # VOID
57 # )
58 #
59 ASM_PFX(CpuPause):
60 nop
61 nop
62 nop
63 nop
64 nop
65 ret