]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwitchStack.c
Add Missing invocations to VA_END() for VA_START().
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / SwitchStack.c
1 /*++
2
3 Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12
13 Module Name:
14
15 SwitchStack.c
16
17 Abstract:
18
19 Switch Stack functions.
20
21 --*/
22
23 #include "BaseLibInternals.h"
24
25 /**
26 Transfers control to a function starting with a new stack.
27
28 Transfers control to the function specified by EntryPoint using the new stack
29 new stack specified by NewStack and passing in the parameters specified
30 by Context1 and Context2. Context1 and Context2 are optional and may
31 be NULL. The function EntryPoint must never return. This function
32 supports a variable number of arguments following the NewStack parameter.
33 These additional arguments are ignored on IA-32, x64, and EBC.
34 IPF CPUs expect one additional parameter of type VOID * that specifies
35 the new backing store pointer.
36
37 If EntryPoint is NULL, then ASSERT().
38 If NewStack is NULL, then ASSERT().
39
40 @param EntryPoint A pointer to function to call with the new stack.
41 @param Context1 A pointer to the context to pass into the EntryPoint
42 function.
43 @param Context2 A pointer to the context to pass into the EntryPoint
44 function.
45 @param NewStack A pointer to the new stack to use for the EntryPoint
46 function.
47
48 **/
49 VOID
50 EFIAPI
51 SwitchStack (
52 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
53 IN VOID *Context1, OPTIONAL
54 IN VOID *Context2, OPTIONAL
55 IN VOID *NewStack,
56 ...
57 )
58 {
59 VA_LIST Marker;
60
61 ASSERT (EntryPoint != NULL);
62 ASSERT (NewStack != NULL);
63
64 VA_START (Marker, NewStack);
65
66 InternalSwitchStack (EntryPoint, Context1, Context2, NewStack, Marker);
67
68 VA_END (Marker);
69 //
70 // InternalSwitchStack () will never return
71 //
72 ASSERT (FALSE);
73 }