]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Arm/SwitchStack.S
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Library / BaseLib / Arm / SwitchStack.S
CommitLineData
9095d37b 1//------------------------------------------------------------------------------\r
08068159 2//\r
9095d37b 3// Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
08068159 4// Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
c32dcd28 5// Portions copyright (c) 2011, ARM Limited. All rights reserved.<BR>\r
08068159 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
9095d37b 15\r
08068159 16.text\r
17.align 5\r
18\r
19GCC_ASM_EXPORT(InternalSwitchStackAsm)\r
9095d37b
LG
20GCC_ASM_EXPORT(CpuPause)\r
21\r
08068159 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
43 MOV LR, R0\r
44 MOV SP, R3\r
45 MOV R0, R1\r
46 MOV R1, R2\r
47 BX LR\r
48\r
49/**\r
50//\r
51// Requests CPU to pause for a short period of time.\r
52//\r
53// Requests CPU to pause for a short period of time. Typically used in MP\r
54// systems to prevent memory starvation while waiting for a spin lock.\r
55//\r
56VOID\r
57EFIAPI\r
58CpuPause (\r
59 VOID\r
60 )\r
61**/\r
62ASM_PFX(CpuPause):\r
63 nop\r
64 nop\r
65 nop\r
66 nop\r
67 nop\r
68 BX LR\r