]>
Commit | Line | Data |
---|---|---|
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 |
9344f092 | 6 | // SPDX-License-Identifier: BSD-2-Clause-Patent\r |
08068159 | 7 | //\r |
8 | //------------------------------------------------------------------------------\r | |
9095d37b | 9 | \r |
08068159 | 10 | .text\r |
11 | .align 5\r | |
12 | \r | |
13 | GCC_ASM_EXPORT(InternalSwitchStackAsm)\r | |
9095d37b LG |
14 | GCC_ASM_EXPORT(CpuPause)\r |
15 | \r | |
08068159 | 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 | VOID\r | |
28 | EFIAPI\r | |
29 | InternalSwitchStackAsm (\r | |
30 | SWITCH_STACK_ENTRY_POINT EntryPoint,\r | |
31 | VOID *Context,\r | |
32 | VOID *Context2,\r | |
33 | VOID *NewStack\r | |
34 | );\r | |
35 | **/\r | |
36 | ASM_PFX(InternalSwitchStackAsm):\r | |
37 | MOV LR, R0\r | |
38 | MOV SP, R3\r | |
39 | MOV R0, R1\r | |
40 | MOV R1, R2\r | |
41 | BX LR\r | |
42 | \r | |
43 | /**\r | |
44 | //\r | |
45 | // Requests CPU to pause for a short period of time.\r | |
46 | //\r | |
47 | // Requests CPU to pause for a short period of time. Typically used in MP\r | |
48 | // systems to prevent memory starvation while waiting for a spin lock.\r | |
49 | //\r | |
50 | VOID\r | |
51 | EFIAPI\r | |
52 | CpuPause (\r | |
53 | VOID\r | |
54 | )\r | |
55 | **/\r | |
56 | ASM_PFX(CpuPause):\r | |
57 | nop\r | |
58 | nop\r | |
59 | nop\r | |
60 | nop\r | |
61 | nop\r | |
62 | BX LR\r |