]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/SwitchStack.c
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / Ebc / SwitchStack.c
1 /*++
2
3 Copyright (c) 2004 - 2006, Intel Corporation
4 All rights reserved. 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
20 --*/
21
22 #include "..\BaseLibInternal.h"
23
24 /**
25 Transfers control to a function starting with a new stack.
26
27 Transfers control to the function specified by EntryPoint using the new stack
28 specified by NewStack and passing in the parameters specified by Context1 and
29 Context2. Context1 and Context2 are optional and may be NULL. The function
30 EntryPoint must never return.
31
32 If EntryPoint is NULL, then ASSERT().
33 If NewStack is NULL, then ASSERT().
34
35 @param EntryPoint A pointer to function to call with the new stack.
36 @param Context1 A pointer to the context to pass into the EntryPoint
37 function.
38 @param Context2 A pointer to the context to pass into the EntryPoint
39 function.
40 @param NewStack A pointer to the new stack to use for the EntryPoint
41 function.
42
43 **/
44 VOID
45 EFIAPI
46 InternalSwitchStack (
47 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
48 IN VOID *Context1, OPTIONAL
49 IN VOID *Context2, OPTIONAL
50 IN VOID *NewStack
51 )
52 {
53 //
54 // This version of this function does not actually change the stack pointer
55 // This is to support compilation of CPU types that do not support assemblers
56 // such as EBC
57 //
58 EntryPoint (Context1, Context2);
59 }