]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFsp2Pkg/Include/Library/FspCommonLib.h
IntelFsp2Pkg: Add function to get bootloader stack pointer
[mirror_edk2.git] / IntelFsp2Pkg / Include / Library / FspCommonLib.h
CommitLineData
cf1d4549
JY
1/** @file\r
2\r
35897da2 3 Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>\r
cf1d4549
JY
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#ifndef _FSP_COMMON_LIB_H_\r
15#define _FSP_COMMON_LIB_H_\r
16\r
17#include <FspGlobalData.h>\r
18#include <FspMeasurePointId.h>\r
19\r
20/**\r
21 This function sets the FSP global data pointer.\r
22\r
23 @param[in] FspData Fsp global data pointer.\r
24\r
25**/\r
26VOID\r
27EFIAPI\r
28SetFspGlobalDataPointer (\r
29 IN FSP_GLOBAL_DATA *FspData\r
30 );\r
31\r
32/**\r
33 This function gets the FSP global data pointer.\r
34\r
35**/\r
36FSP_GLOBAL_DATA *\r
37EFIAPI\r
38GetFspGlobalDataPointer (\r
39 VOID\r
40 );\r
41\r
42/**\r
35897da2 43 This function gets back the FSP API first parameter passed by the bootloader.\r
cf1d4549 44\r
35897da2 45 @retval ApiParameter FSP API first parameter passed by the bootloader.\r
cf1d4549
JY
46**/\r
47UINT32\r
48EFIAPI\r
49GetFspApiParameter (\r
50 VOID\r
51 );\r
52\r
53/**\r
35897da2 54 This function gets back the FSP API second parameter passed by the bootloader.\r
cf1d4549 55\r
35897da2 56 @retval ApiParameter FSP API second parameter passed by the bootloader.\r
cf1d4549
JY
57**/\r
58UINT32\r
59EFIAPI\r
60GetFspApiParameter2 (\r
61 VOID\r
62 );\r
63\r
35897da2
CC
64/**\r
65 This function returns the FSP entry stack pointer from address of the first API parameter.\r
66\r
67 @retval FSP entry stack pointer.\r
68**/\r
69VOID*\r
70EFIAPI\r
71GetFspEntryStack (\r
72 VOID\r
73 );\r
74\r
cf1d4549
JY
75/**\r
76 This function sets the FSP API parameter in the stack.\r
77\r
78 @param[in] Value New parameter value.\r
79\r
80**/\r
81VOID\r
82EFIAPI\r
83SetFspApiParameter (\r
84 IN UINT32 Value\r
85 );\r
86\r
87/**\r
88 This function set the API status code returned to the BootLoader.\r
89\r
90 @param[in] ReturnStatus Status code to return.\r
91\r
92**/\r
93VOID\r
94EFIAPI\r
95SetFspApiReturnStatus (\r
96 IN UINT32 ReturnStatus\r
97 );\r
98\r
99/**\r
100 This function sets the context switching stack to a new stack frame.\r
101\r
102 @param[in] NewStackTop New core stack to be set.\r
103\r
104**/\r
105VOID\r
106EFIAPI\r
107SetFspCoreStackPointer (\r
108 IN VOID *NewStackTop\r
109 );\r
110\r
111/**\r
112 This function sets the platform specific data pointer.\r
113\r
114 @param[in] PlatformData Fsp platform specific data pointer.\r
115\r
116**/\r
117VOID\r
118EFIAPI\r
119SetFspPlatformDataPointer (\r
120 IN VOID *PlatformData\r
121 );\r
122\r
123/**\r
124 This function gets the platform specific data pointer.\r
125\r
126 @param[in] PlatformData Fsp platform specific data pointer.\r
127\r
128**/\r
129VOID *\r
130EFIAPI\r
131GetFspPlatformDataPointer (\r
132 VOID\r
133 );\r
134\r
135/**\r
136 This function sets the UPD data pointer.\r
137\r
138 @param[in] UpdDataPtr UPD data pointer.\r
139**/\r
140VOID\r
141EFIAPI\r
142SetFspUpdDataPointer (\r
143 IN VOID *UpdDataPtr\r
144 );\r
145\r
146/**\r
147 This function gets the UPD data pointer.\r
148\r
149 @return UpdDataPtr UPD data pointer.\r
150**/\r
151VOID *\r
152EFIAPI\r
153GetFspUpdDataPointer (\r
154 VOID\r
155 );\r
156\r
157/**\r
158 This function sets the memory init UPD data pointer.\r
159\r
160 @param[in] MemoryInitUpdPtr memory init UPD data pointer.\r
161**/\r
162VOID\r
163EFIAPI\r
164SetFspMemoryInitUpdDataPointer (\r
165 IN VOID *MemoryInitUpdPtr\r
166 );\r
167\r
168/**\r
169 This function gets the memory init UPD data pointer.\r
170\r
171 @return memory init UPD data pointer.\r
172**/\r
173VOID *\r
174EFIAPI\r
175GetFspMemoryInitUpdDataPointer (\r
176 VOID\r
177 );\r
178\r
179/**\r
180 This function sets the silicon init UPD data pointer.\r
181\r
182 @param[in] SiliconInitUpdPtr silicon init UPD data pointer.\r
183**/\r
184VOID\r
185EFIAPI\r
186SetFspSiliconInitUpdDataPointer (\r
187 IN VOID *SiliconInitUpdPtr\r
188 );\r
189\r
190/**\r
191 This function gets the silicon init UPD data pointer.\r
192\r
193 @return silicon init UPD data pointer.\r
194**/\r
195VOID *\r
196EFIAPI\r
197GetFspSiliconInitUpdDataPointer (\r
198 VOID\r
199 );\r
200\r
201/**\r
202 Set FSP measurement point timestamp.\r
203\r
204 @param[in] Id Measurement point ID.\r
205\r
206 @return performance timestamp.\r
207**/\r
208UINT64\r
209EFIAPI\r
210SetFspMeasurePoint (\r
211 IN UINT8 Id\r
212 );\r
213\r
214/**\r
215 This function gets the FSP info header pointer.\r
216\r
217 @retval FspInfoHeader FSP info header pointer\r
218**/\r
219FSP_INFO_HEADER *\r
220EFIAPI\r
221GetFspInfoHeader (\r
222 VOID\r
223 );\r
224\r
225/**\r
226 This function sets the FSP info header pointer.\r
227\r
228 @param[in] FspInfoHeader FSP info header pointer\r
229**/\r
230VOID\r
231EFIAPI\r
232SetFspInfoHeader (\r
233 FSP_INFO_HEADER *FspInfoHeader\r
234 );\r
235\r
236/**\r
237 This function gets the FSP info header pointer from the API context.\r
238\r
239 @retval FspInfoHeader FSP info header pointer\r
240**/\r
241FSP_INFO_HEADER *\r
242EFIAPI\r
243GetFspInfoHeaderFromApiContext (\r
244 VOID\r
245 );\r
246\r
247/**\r
cc0b456a 248 This function gets the CfgRegion data pointer.\r
cf1d4549 249\r
cc0b456a 250 @return CfgRegion data pointer.\r
cf1d4549
JY
251**/\r
252VOID *\r
253EFIAPI\r
cc0b456a 254GetFspCfgRegionDataPointer (\r
cf1d4549
JY
255 VOID\r
256 );\r
257\r
258/**\r
259 This function gets FSP API calling mode.\r
260\r
261 @retval API calling mode\r
262**/\r
263UINT8\r
264EFIAPI\r
265GetFspApiCallingIndex (\r
266 VOID\r
267 );\r
268\r
269/**\r
270 This function sets FSP API calling mode.\r
271\r
272 @param[in] Index API calling index\r
273**/\r
274VOID\r
275EFIAPI\r
276SetFspApiCallingIndex (\r
277 UINT8 Index\r
278 );\r
279\r
280/**\r
281 This function gets FSP Phase StatusCode.\r
e37bb20c 282\r
cf1d4549
JY
283 @retval StatusCode\r
284**/\r
285UINT32\r
286EFIAPI\r
287GetPhaseStatusCode (\r
288 VOID\r
289 );\r
290\r
291\r
292/**\r
293 This function sets FSP Phase StatusCode.\r
294\r
295 @param[in] Mode Phase StatusCode\r
296**/\r
297VOID\r
298EFIAPI\r
299SetPhaseStatusCode (\r
300 UINT32 StatusCode\r
301 );\r
302\r
6b5677e1
YS
303/**\r
304 This function updates the return status of the FSP API with requested reset type and returns to Boot Loader.\r
305\r
306 @param[in] FspResetType Reset type that needs to returned as API return status\r
307\r
308**/\r
309VOID\r
310EFIAPI\r
311FspApiReturnStatusReset (\r
312 IN UINT32 FspResetType\r
313 );\r
cf1d4549 314#endif\r