]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFsp2Pkg/Library/BaseFspSwitchStackLib/FspSwitchStackLib.c
IntelFsp2Pkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFsp2Pkg / Library / BaseFspSwitchStackLib / FspSwitchStackLib.c
1 /** @file
2
3 Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
4 SPDX-License-Identifier: BSD-2-Clause-Patent
5
6 **/
7
8 #include <Base.h>
9 #include <Library/BaseLib.h>
10 #include <Library/FspCommonLib.h>
11
12 /**
13
14 Switch the current stack to the previous saved stack.
15
16 @param[in] NewStack The new stack to be switched.
17
18 @return OldStack After switching to the saved stack,
19 this value will be saved in eax before returning.
20
21
22 **/
23 UINT32
24 SwapStack (
25 IN UINT32 NewStack
26 )
27 {
28 FSP_GLOBAL_DATA *FspData;
29 UINT32 OldStack;
30
31 FspData = GetFspGlobalDataPointer ();
32 OldStack = FspData->CoreStack;
33 FspData->CoreStack = NewStack;
34 return OldStack;
35 }
36