]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
3bbe68a3 | 3 | Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r |
2c7e5c2f | 4 | This program and the accompanying materials \r |
3eb9473e | 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 | |
c7f33ca4 | 23 | #include "BaseLibInternals.h"\r |
3eb9473e | 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 | |
c7f33ca4 | 29 | new stack specified by NewStack and passing in the parameters specified\r |
30 | by Context1 and Context2. Context1 and Context2 are optional and may\r | |
31 | be NULL. The function EntryPoint must never return. This function\r | |
32 | supports a variable number of arguments following the NewStack parameter.\r | |
33 | These additional arguments are ignored on IA-32, x64, and EBC.\r | |
34 | IPF CPUs expect one additional parameter of type VOID * that specifies\r | |
35 | the new backing store pointer.\r | |
3eb9473e | 36 | \r |
37 | If EntryPoint is NULL, then ASSERT().\r | |
38 | If NewStack is NULL, then ASSERT().\r | |
3eb9473e | 39 | \r |
40 | @param EntryPoint A pointer to function to call with the new stack.\r | |
41 | @param Context1 A pointer to the context to pass into the EntryPoint\r | |
42 | function.\r | |
43 | @param Context2 A pointer to the context to pass into the EntryPoint\r | |
44 | function.\r | |
45 | @param NewStack A pointer to the new stack to use for the EntryPoint\r | |
46 | function.\r | |
47 | \r | |
48 | **/\r | |
49 | VOID\r | |
50 | EFIAPI\r | |
51 | SwitchStack (\r | |
52 | IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r | |
c7f33ca4 | 53 | IN VOID *Context1, OPTIONAL\r |
54 | IN VOID *Context2, OPTIONAL\r | |
55 | IN VOID *NewStack,\r | |
56 | ...\r | |
3eb9473e | 57 | )\r |
58 | {\r | |
c7f33ca4 | 59 | VA_LIST Marker;\r |
3eb9473e | 60 | \r |
c7f33ca4 | 61 | ASSERT (EntryPoint != NULL);\r |
62 | ASSERT (NewStack != NULL);\r | |
3eb9473e | 63 | \r |
c7f33ca4 | 64 | VA_START (Marker, NewStack);\r |
65 | \r | |
66 | InternalSwitchStack (EntryPoint, Context1, Context2, NewStack, Marker);\r | |
67 | \r | |
3bbe68a3 | 68 | VA_END (Marker);\r |
c7f33ca4 | 69 | //\r |
70 | // InternalSwitchStack () will never return\r | |
71 | //\r | |
72 | ASSERT (FALSE);\r | |
3eb9473e | 73 | }\r |