]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ebc/SwitchStack.c
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ebc / SwitchStack.c
1 /** @file
2 Switch Stack functions.
3
4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include "BaseLibInternals.h"
10
11 /**
12 Transfers control to a function starting with a new stack.
13
14 Transfers control to the function specified by EntryPoint using the
15 new stack specified by NewStack and passing in the parameters specified
16 by Context1 and Context2. Context1 and Context2 are optional and may
17 be NULL. The function EntryPoint must never return.
18 Marker will be ignored on IA-32, x64, and EBC.
19 IPF CPUs expect one additional parameter of type VOID * that specifies
20 the new backing store pointer.
21
22 If EntryPoint is NULL, then ASSERT().
23 If NewStack is NULL, then ASSERT().
24
25 @param EntryPoint A pointer to function to call with the new stack.
26 @param Context1 A pointer to the context to pass into the EntryPoint
27 function.
28 @param Context2 A pointer to the context to pass into the EntryPoint
29 function.
30 @param NewStack A pointer to the new stack to use for the EntryPoint
31 function.
32 @param Marker A VA_LIST marker for the variable argument list.
33
34 **/
35 VOID
36 EFIAPI
37 InternalSwitchStack (
38 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
39 IN VOID *Context1, OPTIONAL
40 IN VOID *Context2, OPTIONAL
41 IN VOID *NewStack,
42 IN VA_LIST Marker
43 )
44
45 {
46 //
47 // This version of this function does not actually change the stack pointer
48 // This is to support compilation of CPU types that do not support assemblers
49 // such as EBC
50 //
51 EntryPoint (Context1, Context2);
52 }