]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Arm/InternalSwitchStack.c
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / Arm / InternalSwitchStack.c
1 /** @file
2 SwitchStack() function for ARM.
3
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #include "BaseLibInternals.h"
11
12 /**
13 Transfers control to a function starting with a new stack.
14
15 This internal worker function transfers control to the function
16 specified by EntryPoint using the new stack specified by NewStack,
17 and passes in the parameters specified by Context1 and Context2.
18 Context1 and Context2 are optional and may be NULL.
19 The function EntryPoint must never return.
20
21 @param EntryPoint The pointer to the function to enter.
22 @param Context1 The first parameter to pass in.
23 @param Context2 The second Parameter to pass in
24 @param NewStack The new Location of the stack
25
26 **/
27 VOID
28 EFIAPI
29 InternalSwitchStackAsm (
30 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
31 IN VOID *Context1, OPTIONAL
32 IN VOID *Context2, OPTIONAL
33 IN VOID *NewStack
34 );
35
36
37 /**
38 Transfers control to a function starting with a new stack.
39
40 Transfers control to the function specified by EntryPoint using the
41 new stack specified by NewStack, and passes in the parameters specified
42 by Context1 and Context2. Context1 and Context2 are optional and may
43 be NULL. The function EntryPoint must never return.
44 Marker will be ignored on IA-32, x64, and EBC.
45 IPF CPUs expect one additional parameter of type VOID * that specifies
46 the new backing store pointer.
47
48 If EntryPoint is NULL, then ASSERT().
49 If NewStack is NULL, then ASSERT().
50
51 @param EntryPoint A pointer to function to call with the new stack.
52 @param Context1 A pointer to the context to pass into the EntryPoint
53 function.
54 @param Context2 A pointer to the context to pass into the EntryPoint
55 function.
56 @param NewStack A pointer to the new stack to use for the EntryPoint
57 function.
58 @param Marker A VA_LIST marker for the variable argument list.
59
60 **/
61 VOID
62 EFIAPI
63 InternalSwitchStack (
64 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
65 IN VOID *Context1, OPTIONAL
66 IN VOID *Context2, OPTIONAL
67 IN VOID *NewStack,
68 IN VA_LIST Marker
69 )
70
71 {
72 InternalSwitchStackAsm (EntryPoint, Context1, Context2, NewStack);
73 }