]>
Commit | Line | Data |
---|---|---|
c8ec22a2 JY |
1 | /** @file\r |
2 | \r | |
3 | Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r | |
4 | This program and the accompanying materials\r | |
5 | are licensed and made available under the terms and conditions of the BSD License\r | |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php.\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
12 | **/\r | |
13 | \r | |
14 | #include <Base.h>\r | |
15 | #include <Library/BaseLib.h>\r | |
16 | #include <Library/FspCommonLib.h>\r | |
17 | \r | |
18 | /**\r | |
19 | \r | |
20 | Switch the current stack to the previous saved stack.\r | |
21 | \r | |
22 | @param[in] NewStack The new stack to be switched.\r | |
23 | \r | |
24 | @return OldStack After switching to the saved stack,\r | |
25 | this value will be saved in eax before returning.\r | |
26 | \r | |
27 | \r | |
28 | **/\r | |
29 | UINT32\r | |
30 | SwapStack (\r | |
31 | IN UINT32 NewStack\r | |
32 | )\r | |
33 | {\r | |
34 | FSP_GLOBAL_DATA *FspData;\r | |
35 | UINT32 OldStack;\r | |
36 | \r | |
37 | FspData = GetFspGlobalDataPointer ();\r | |
38 | OldStack = FspData->CoreStack;\r | |
39 | FspData->CoreStack = NewStack;\r | |
40 | return OldStack;\r | |
41 | }\r | |
42 | \r |