]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2004 - 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | \r | |
13 | Module Name:\r | |
14 | \r | |
15 | SwitchStack.c\r | |
16 | \r | |
17 | Abstract: \r | |
18 | \r | |
19 | Switch Stack functions.\r | |
20 | \r | |
21 | --*/\r | |
22 | \r | |
23 | #include "BaseLibInternal.h"\r | |
24 | \r | |
25 | /**\r | |
26 | Transfers control to a function starting with a new stack.\r | |
27 | \r | |
28 | Transfers control to the function specified by EntryPoint using the new stack\r | |
29 | specified by NewStack and passing in the parameters specified by Context1 and\r | |
30 | Context2. Context1 and Context2 are optional and may be NULL. The function\r | |
31 | EntryPoint must never return.\r | |
32 | \r | |
33 | If EntryPoint is NULL, then ASSERT().\r | |
34 | If NewStack is NULL, then ASSERT().\r | |
35 | For IPF CPUs, if NewStack is not aligned on a 16-byte boundary, then ASSERT().\r | |
36 | \r | |
37 | @param EntryPoint A pointer to function to call with the new stack.\r | |
38 | @param Context1 A pointer to the context to pass into the EntryPoint\r | |
39 | function.\r | |
40 | @param Context2 A pointer to the context to pass into the EntryPoint\r | |
41 | function.\r | |
42 | @param NewStack A pointer to the new stack to use for the EntryPoint\r | |
43 | function.\r | |
44 | \r | |
45 | **/\r | |
46 | VOID\r | |
47 | EFIAPI\r | |
48 | SwitchStack (\r | |
49 | IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r | |
50 | IN VOID *Context1,\r | |
51 | IN VOID *Context2,\r | |
52 | IN VOID *NewStack\r | |
53 | )\r | |
54 | {\r | |
55 | ASSERT (EntryPoint != NULL && NewStack != NULL);\r | |
56 | \r | |
57 | #ifdef MDE_CPU_IPF\r | |
58 | ASSERT (((UINTN)NewStack & 0xf) == 0);\r | |
59 | #endif\r | |
60 | \r | |
61 | InternalSwitchStack (EntryPoint, Context1, Context2, NewStack);\r | |
62 | }\r |