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