3 Copyright (c) 2004 - 2006, 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
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.
22 #include "BaseLibInternals.h"
25 Transfers control to a function starting with a new stack.
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 by Context1 and Context2. Context1 and Context2 are optional and may
30 be NULL. The function EntryPoint must never return.
31 Marker will be ignored on IA-32, x64, and EBC.
32 IPF CPUs expect one additional parameter of type VOID * that specifies
33 the new backing store pointer.
35 If EntryPoint is NULL, then ASSERT().
36 If NewStack is NULL, then ASSERT().
38 @param EntryPoint A pointer to function to call with the new stack.
39 @param Context1 A pointer to the context to pass into the EntryPoint
41 @param Context2 A pointer to the context to pass into the EntryPoint
43 @param NewStack A pointer to the new stack to use for the EntryPoint
45 @param Marker VA_LIST marker for the variable argument list.
51 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
52 IN VOID
*Context1
, OPTIONAL
53 IN VOID
*Context2
, OPTIONAL
60 // This version of this function does not actually change the stack pointer
61 // This is to support compilation of CPU types that do not support assemblers
66 // Stack should be aligned with CPU_STACK_ALIGNMENT
68 ASSERT (((UINTN
)NewStack
& (CPU_STACK_ALIGNMENT
- 1)) == 0);
70 EntryPoint (Context1
, Context2
);