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