]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFspPkg/Include/Library/FspCommonLib.h
IntelFspPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFspPkg / Include / Library / FspCommonLib.h
1 /** @file
2
3 Copyright (c) 2014 - 2015, 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 parameter passed by the bootlaoder.
38
39 @retval ApiParameter FSP API parameter passed by the bootlaoder.
40 **/
41 UINT32
42 EFIAPI
43 GetFspApiParameter (
44 VOID
45 );
46
47 /**
48 This function sets the FSP API parameter in the stack.
49
50 @param[in] Value New parameter value.
51
52 **/
53 VOID
54 EFIAPI
55 SetFspApiParameter (
56 IN UINT32 Value
57 );
58
59 /**
60 This function sets the FSP continuation function parameters in the stack.
61
62 @param[in] Value New parameter value to set.
63 @param[in] Index Parameter index.
64 **/
65 VOID
66 EFIAPI
67 SetFspContinuationFuncParameter (
68 IN UINT32 Value,
69 IN UINT32 Index
70 );
71
72 /**
73 This function changes the BootLoader return address in stack.
74
75 @param[in] ReturnAddress Address to return.
76
77 **/
78 VOID
79 EFIAPI
80 SetFspApiReturnAddress (
81 IN UINT32 ReturnAddress
82 );
83
84 /**
85 This function set the API status code returned to the BootLoader.
86
87 @param[in] ReturnStatus Status code to return.
88
89 **/
90 VOID
91 EFIAPI
92 SetFspApiReturnStatus (
93 IN UINT32 ReturnStatus
94 );
95
96 /**
97 This function sets the context switching stack to a new stack frame.
98
99 @param[in] NewStackTop New core stack to be set.
100
101 **/
102 VOID
103 EFIAPI
104 SetFspCoreStackPointer (
105 IN VOID *NewStackTop
106 );
107
108 /**
109 This function sets the platform specific data pointer.
110
111 @param[in] PlatformData Fsp platform specific data pointer.
112
113 **/
114 VOID
115 EFIAPI
116 SetFspPlatformDataPointer (
117 IN VOID *PlatformData
118 );
119
120 /**
121 This function gets the platform specific data pointer.
122
123 @param[in] PlatformData Fsp platform specific data pointer.
124
125 **/
126 VOID *
127 EFIAPI
128 GetFspPlatformDataPointer (
129 VOID
130 );
131
132 /**
133 This function sets the UPD data pointer.
134
135 @param[in] UpdDataRgnPtr UPD data pointer.
136 **/
137 VOID
138 EFIAPI
139 SetFspUpdDataPointer (
140 IN VOID *UpdDataRgnPtr
141 );
142
143 /**
144 This function gets the UPD data pointer.
145
146 @return UpdDataRgnPtr UPD data pointer.
147 **/
148 VOID *
149 EFIAPI
150 GetFspUpdDataPointer (
151 VOID
152 );
153
154 /**
155 This function sets the memory init UPD data pointer.
156
157 @param[in] MemoryInitUpdPtr memory init UPD data pointer.
158 **/
159 VOID
160 EFIAPI
161 SetFspMemoryInitUpdDataPointer (
162 IN VOID *MemoryInitUpdPtr
163 );
164
165 /**
166 This function gets the memory init UPD data pointer.
167
168 @return memory init UPD data pointer.
169 **/
170 VOID *
171 EFIAPI
172 GetFspMemoryInitUpdDataPointer (
173 VOID
174 );
175
176 /**
177 This function sets the silicon init UPD data pointer.
178
179 @param[in] SiliconInitUpdPtr silicon init UPD data pointer.
180 **/
181 VOID
182 EFIAPI
183 SetFspSiliconInitUpdDataPointer (
184 IN VOID *SiliconInitUpdPtr
185 );
186
187 /**
188 This function gets the silicon init UPD data pointer.
189
190 @return silicon init UPD data pointer.
191 **/
192 VOID *
193 EFIAPI
194 GetFspSiliconInitUpdDataPointer (
195 VOID
196 );
197
198 /**
199 Set FSP measurement point timestamp.
200
201 @param[in] Id Measurement point ID.
202
203 @return performance timestamp.
204 **/
205 UINT64
206 EFIAPI
207 SetFspMeasurePoint (
208 IN UINT8 Id
209 );
210
211 /**
212 This function gets the FSP info header pointer.
213
214 @retval FspInfoHeader FSP info header pointer
215 **/
216 FSP_INFO_HEADER *
217 EFIAPI
218 GetFspInfoHeader (
219 VOID
220 );
221
222 /**
223 This function gets the FSP info header pointer from the API context.
224
225 @retval FspInfoHeader FSP info header pointer
226 **/
227 FSP_INFO_HEADER *
228 EFIAPI
229 GetFspInfoHeaderFromApiContext (
230 VOID
231 );
232
233 /**
234 This function gets the VPD data pointer.
235
236 @return VpdDataRgnPtr VPD data pointer.
237 **/
238 VOID *
239 EFIAPI
240 GetFspVpdDataPointer (
241 VOID
242 );
243
244 /**
245 This function gets FSP API calling mode.
246
247 @retval API calling mode
248 **/
249 UINT8
250 EFIAPI
251 GetFspApiCallingMode (
252 VOID
253 );
254
255 /**
256 This function sets FSP API calling mode.
257
258 @param[in] Mode API calling mode
259 **/
260 VOID
261 EFIAPI
262 SetFspApiCallingMode (
263 UINT8 Mode
264 );
265
266 #endif