]>
Commit | Line | Data |
---|---|---|
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 | |
da351bdb PB |
9 | \r |
10 | EXPORT InternalSwitchStackAsm\r | |
11 | EXPORT CpuPause\r | |
12 | AREA BaseLib_LowLevel, CODE, READONLY\r | |
13 | \r | |
ec661594 PB |
14 | ;/**\r |
15 | ;\r | |
16 | ; This allows the caller to switch the stack and goes to the new entry point\r | |
17 | ;\r | |
18 | ; @param EntryPoint The pointer to the location to enter\r | |
19 | ; @param Context Parameter to pass in\r | |
20 | ; @param Context2 Parameter2 to pass in\r | |
21 | ; @param NewStack New Location of the stack\r | |
22 | ;\r | |
23 | ; @return Nothing. Goes to the Entry Point passing in the new parameters\r | |
24 | ;\r | |
25 | ;**/\r | |
26 | ;VOID\r | |
27 | ;EFIAPI\r | |
28 | ;InternalSwitchStackAsm (\r | |
29 | ; SWITCH_STACK_ENTRY_POINT EntryPoint,\r | |
30 | ; VOID *Context,\r | |
31 | ; VOID *Context2,\r | |
32 | ; VOID *NewStack\r | |
33 | ; );\r | |
34 | ;\r | |
da351bdb PB |
35 | InternalSwitchStackAsm\r |
36 | mov x29, #0\r | |
37 | mov x30, x0\r | |
38 | mov sp, x3\r | |
39 | mov x0, x1\r | |
40 | mov x1, x2\r | |
41 | ret\r | |
42 | \r | |
ec661594 PB |
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 | ;**/\r | |
51 | ;VOID\r | |
52 | ;EFIAPI\r | |
53 | ;CpuPause (\r | |
54 | ; VOID\r | |
55 | ; )\r | |
56 | ;\r | |
da351bdb PB |
57 | CpuPause\r |
58 | nop\r | |
59 | nop\r | |
60 | nop\r | |
61 | nop\r | |
62 | nop\r | |
63 | ret\r | |
64 | \r | |
65 | END\r |