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