]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Arm/InternalSwitchStack.c
258e39732e8a9390400a60dd6b61fd394f715387
[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 Transfers control to a function starting with a new stack.
38
39 Transfers control to the function specified by EntryPoint using the
40 new stack specified by NewStack, and passes in the parameters specified
41 by Context1 and Context2. Context1 and Context2 are optional and may
42 be NULL. The function EntryPoint must never return.
43 Marker will be ignored on IA-32, x64, and EBC.
44 IPF CPUs expect one additional parameter of type VOID * that specifies
45 the new backing store pointer.
46
47 If EntryPoint is NULL, then ASSERT().
48 If NewStack is NULL, then ASSERT().
49
50 @param EntryPoint A pointer to function to call with the new stack.
51 @param Context1 A pointer to the context to pass into the EntryPoint
52 function.
53 @param Context2 A pointer to the context to pass into the EntryPoint
54 function.
55 @param NewStack A pointer to the new stack to use for the EntryPoint
56 function.
57 @param Marker A VA_LIST marker for the variable argument list.
58
59 **/
60 VOID
61 EFIAPI
62 InternalSwitchStack (
63 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
64 IN VOID *Context1 OPTIONAL,
65 IN VOID *Context2 OPTIONAL,
66 IN VOID *NewStack,
67 IN VA_LIST Marker
68 )
69
70 {
71 InternalSwitchStackAsm (EntryPoint, Context1, Context2, NewStack);
72 }