]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Arm/InternalSwitchStack.c
Update to make end-of-line consistent for all source files in MdePkg. There are no...
[mirror_edk2.git] / MdePkg / Library / BaseLib / Arm / InternalSwitchStack.c
1 /** @file
2 SwitchStack() function for ARM.
3
4 Copyright (c) 2006 - 2007, Intel Corporation<BR>
5 Portions copyright (c) 2008-2009 Apple Inc.<BR>
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #include "BaseLibInternals.h"
17
18 /**
19 Transfers control to a function starting with a new stack.
20
21 Transfers control to the function specified by EntryPoint using the
22 new stack specified by NewStack and passing in the parameters specified
23 by Context1 and Context2. Context1 and Context2 are optional and may
24 be NULL. The function EntryPoint must never return.
25 Marker will be ignored on IA-32, x64, and EBC.
26 IPF CPUs expect one additional parameter of type VOID * that specifies
27 the new backing store pointer.
28
29 If EntryPoint is NULL, then ASSERT().
30 If NewStack is NULL, then ASSERT().
31
32 @param EntryPoint A pointer to function to call with the new stack.
33 @param Context1 A pointer to the context to pass into the EntryPoint
34 function.
35 @param Context2 A pointer to the context to pass into the EntryPoint
36 function.
37 @param NewStack A pointer to the new stack to use for the EntryPoint
38 function.
39 @param Marker VA_LIST marker for the variable argument list.
40
41 **/
42 VOID
43 EFIAPI
44 InternalSwitchStack (
45 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
46 IN VOID *Context1, OPTIONAL
47 IN VOID *Context2, OPTIONAL
48 IN VOID *NewStack,
49 IN VA_LIST Marker
50 )
51
52 {
53 //
54 // Stack should be aligned with CPU_STACK_ALIGNMENT
55 //
56 ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);
57
58 InternalSwitchStackAsm (EntryPoint, Context1, Context2, NewStack);
59 }