]>
Commit | Line | Data |
---|---|---|
807e2604 HL |
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 | |
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 | |
15 | \r | |
16 | .text\r | |
17 | .align 5\r | |
18 | \r | |
0f895683 OM |
19 | GCC_ASM_EXPORT(InternalSwitchStackAsm)\r |
20 | GCC_ASM_EXPORT(CpuPause)\r | |
807e2604 HL |
21 | \r |
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 | |
33 | VOID\r | |
34 | EFIAPI\r | |
35 | InternalSwitchStackAsm (\r | |
36 | SWITCH_STACK_ENTRY_POINT EntryPoint,\r | |
37 | VOID *Context,\r | |
38 | VOID *Context2,\r | |
39 | VOID *NewStack\r | |
40 | );\r | |
41 | **/\r | |
42 | ASM_PFX(InternalSwitchStackAsm):\r | |
43 | mov x30, x0\r | |
44 | mov sp, x3\r | |
45 | mov x0, x1\r | |
46 | mov x1, x2\r | |
47 | ret\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 | |
56 | VOID\r | |
57 | EFIAPI\r | |
58 | CpuPause (\r | |
59 | VOID\r | |
60 | )\r | |
61 | **/\r | |
62 | ASM_PFX(CpuPause):\r | |
63 | nop\r | |
64 | nop\r | |
65 | nop\r | |
66 | nop\r | |
67 | nop\r | |
68 | ret\r |