]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Definition of Pei Core Structures and Services\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2008, Intel Corporation\r | |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _PEI_MAIN_H_\r | |
16 | #define _PEI_MAIN_H_\r | |
17 | \r | |
18 | #include <PiPei.h>\r | |
19 | #include <Ppi/DxeIpl.h>\r | |
20 | #include <Ppi/MemoryDiscovered.h>\r | |
21 | #include <Ppi/StatusCode.h>\r | |
22 | #include <Ppi/Reset.h>\r | |
23 | #include <Ppi/FirmwareVolume.h>\r | |
24 | #include <Ppi/FirmwareVolumeInfo.h>\r | |
25 | #include <Ppi/Decompress.h>\r | |
26 | #include <Ppi/GuidedSectionExtraction.h>\r | |
27 | #include <Ppi/LoadFile.h>\r | |
28 | #include <Ppi/Security2.h>\r | |
29 | #include <Ppi/TemporaryRamSupport.h>\r | |
30 | #include <Library/DebugLib.h>\r | |
31 | #include <Library/PeiCoreEntryPoint.h>\r | |
32 | #include <Library/BaseLib.h>\r | |
33 | #include <Library/HobLib.h>\r | |
34 | #include <Library/PerformanceLib.h>\r | |
35 | #include <Library/PeiServicesLib.h>\r | |
36 | #include <Library/ReportStatusCodeLib.h>\r | |
37 | #include <Library/PeCoffLib.h>\r | |
38 | #include <Library/PeCoffGetEntryPointLib.h>\r | |
39 | #include <Library/BaseMemoryLib.h>\r | |
40 | #include <Library/CacheMaintenanceLib.h>\r | |
41 | #include <Library/TimerLib.h>\r | |
42 | #include <Library/PcdLib.h>\r | |
43 | #include <IndustryStandard/PeImage.h>\r | |
44 | #include <Library/PeiServicesTablePointerLib.h>\r | |
45 | #include <Library/MemoryAllocationLib.h>\r | |
46 | #include <Guid/FirmwareFileSystem2.h>\r | |
47 | #include <Guid/AprioriFileName.h>\r | |
48 | \r | |
49 | ///\r | |
50 | /// It is an FFS type extension used for PeiFindFileEx. It indicates current\r | |
51 | /// Ffs searching is for all PEIMs can be dispatched by PeiCore.\r | |
52 | ///\r | |
53 | #define PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE 0xff\r | |
54 | \r | |
55 | ///\r | |
56 | /// Pei Core private data structures\r | |
57 | ///\r | |
58 | typedef union {\r | |
59 | EFI_PEI_PPI_DESCRIPTOR *Ppi;\r | |
60 | EFI_PEI_NOTIFY_DESCRIPTOR *Notify;\r | |
61 | VOID *Raw;\r | |
62 | } PEI_PPI_LIST_POINTERS;\r | |
63 | \r | |
64 | ///\r | |
65 | /// PPI database structure which contains two link: PpiList and NotifyList. PpiList\r | |
66 | /// is in head of PpiListPtrs array and notify is in end of PpiListPtrs.\r | |
67 | ///\r | |
68 | typedef struct {\r | |
69 | ///\r | |
70 | /// index of end of PpiList link list.\r | |
71 | ///\r | |
72 | INTN PpiListEnd;\r | |
73 | ///\r | |
74 | /// index of end of notify link list.\r | |
75 | ///\r | |
76 | INTN NotifyListEnd;\r | |
77 | ///\r | |
78 | /// index of the dispatched notify list.\r | |
79 | ///\r | |
80 | INTN DispatchListEnd;\r | |
81 | ///\r | |
82 | /// index of last installed Ppi description in PpiList link list.\r | |
83 | ///\r | |
84 | INTN LastDispatchedInstall;\r | |
85 | ///\r | |
86 | /// index of last dispatched notify in Notify link list.\r | |
87 | /// \r | |
88 | INTN LastDispatchedNotify;\r | |
89 | ///\r | |
90 | /// Ppi database.\r | |
91 | ///\r | |
92 | PEI_PPI_LIST_POINTERS PpiListPtrs[FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)];\r | |
93 | } PEI_PPI_DATABASE;\r | |
94 | \r | |
95 | \r | |
96 | //\r | |
97 | // PEI_CORE_FV_HANDE.PeimState\r | |
98 | // Do not change these values as there is code doing math to change states.\r | |
99 | // Look for Private->Fv[FvCount].PeimState[PeimCount]++;\r | |
100 | //\r | |
101 | #define PEIM_STATE_NOT_DISPATCHED 0x00\r | |
102 | #define PEIM_STATE_DISPATCHED 0x01\r | |
103 | #define PEIM_STATE_REGISITER_FOR_SHADOW 0x02\r | |
104 | #define PEIM_STATE_DONE 0x03\r | |
105 | \r | |
106 | typedef struct {\r | |
107 | EFI_FIRMWARE_VOLUME_HEADER *FvHeader;\r | |
108 | UINT8 PeimState[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];\r | |
109 | EFI_PEI_FILE_HANDLE FvFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];\r | |
110 | BOOLEAN ScanFv;\r | |
111 | } PEI_CORE_FV_HANDLE;\r | |
112 | \r | |
113 | #define CACHE_SETION_MAX_NUMBER 0x10\r | |
114 | typedef struct {\r | |
115 | EFI_COMMON_SECTION_HEADER* Section[CACHE_SETION_MAX_NUMBER];\r | |
116 | VOID* SectionData[CACHE_SETION_MAX_NUMBER];\r | |
117 | UINTN SectionSize[CACHE_SETION_MAX_NUMBER];\r | |
118 | UINTN AllSectionCount;\r | |
119 | UINTN SectionIndex;\r | |
120 | } CACHE_SECTION_DATA;\r | |
121 | \r | |
122 | \r | |
123 | #define PEI_CORE_HANDLE_SIGNATURE SIGNATURE_32('P','e','i','C')\r | |
124 | \r | |
125 | ///\r | |
126 | /// Pei Core private data structure instance\r | |
127 | ///\r | |
128 | typedef struct{\r | |
129 | UINTN Signature;\r | |
130 | EFI_PEI_SERVICES *PS; // Point to ServiceTableShadow\r | |
131 | PEI_PPI_DATABASE PpiData;\r | |
132 | UINTN FvCount;\r | |
133 | PEI_CORE_FV_HANDLE Fv[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];\r | |
134 | EFI_PEI_FILE_HANDLE CurrentFvFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];\r | |
135 | UINTN AprioriCount;\r | |
136 | UINTN CurrentPeimFvCount;\r | |
137 | UINTN CurrentPeimCount;\r | |
138 | EFI_PEI_FILE_HANDLE CurrentFileHandle;\r | |
139 | BOOLEAN PeimNeedingDispatch;\r | |
140 | BOOLEAN PeimDispatchOnThisPass;\r | |
141 | BOOLEAN PeimDispatcherReenter;\r | |
142 | UINTN AllFvCount;\r | |
143 | EFI_PEI_FV_HANDLE AllFv[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];\r | |
144 | EFI_PEI_HOB_POINTERS HobList;\r | |
145 | BOOLEAN SwitchStackSignal;\r | |
146 | BOOLEAN PeiMemoryInstalled;\r | |
147 | EFI_PHYSICAL_ADDRESS StackBase;\r | |
148 | UINT64 StackSize;\r | |
149 | VOID *CpuIo;\r | |
150 | EFI_PEI_SECURITY2_PPI *PrivateSecurityPpi;\r | |
151 | EFI_PEI_SERVICES ServiceTableShadow;\r | |
152 | EFI_PEI_PPI_DESCRIPTOR *XipLoadFile;\r | |
153 | EFI_PHYSICAL_ADDRESS PhysicalMemoryBegin;\r | |
154 | UINT64 PhysicalMemoryLength;\r | |
155 | EFI_PHYSICAL_ADDRESS FreePhysicalMemoryTop;\r | |
156 | VOID* ShadowedPeiCore;\r | |
157 | CACHE_SECTION_DATA CacheSection;\r | |
158 | } PEI_CORE_INSTANCE;\r | |
159 | \r | |
160 | ///\r | |
161 | /// Pei Core Instance Data Macros\r | |
162 | ///\r | |
163 | #define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \\r | |
164 | CR(a, PEI_CORE_INSTANCE, PS, PEI_CORE_HANDLE_SIGNATURE)\r | |
165 | \r | |
166 | /**\r | |
167 | Function Pointer type for PeiCore function.\r | |
168 | @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size \r | |
169 | and location of temporary RAM, the stack location and the BFV location.\r | |
170 | @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.\r | |
171 | An empty PPI list consists of a single descriptor with the end-tag\r | |
172 | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization\r | |
173 | phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such\r | |
174 | that both the PEI Foundation and any modules can leverage the associated service\r | |
175 | calls and/or code in these early PPIs\r | |
176 | @param OldCoreData Pointer to old core data that is used to initialize the\r | |
177 | core's data areas.\r | |
178 | **/\r | |
179 | typedef\r | |
180 | EFI_STATUS\r | |
181 | (EFIAPI *PEICORE_FUNCTION_POINTER)(\r | |
182 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r | |
183 | IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList,\r | |
184 | IN PEI_CORE_INSTANCE *OldCoreData\r | |
185 | );\r | |
186 | \r | |
187 | ///\r | |
188 | /// Union of temporarily used function pointers (to save stack space)\r | |
189 | ///\r | |
190 | typedef union {\r | |
191 | PEICORE_FUNCTION_POINTER PeiCore;\r | |
192 | EFI_PEIM_ENTRY_POINT2 PeimEntry;\r | |
193 | EFI_PEIM_NOTIFY_ENTRY_POINT PeimNotifyEntry;\r | |
194 | EFI_DXE_IPL_PPI *DxeIpl;\r | |
195 | EFI_PEI_PPI_DESCRIPTOR *PpiDescriptor;\r | |
196 | EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor;\r | |
197 | VOID *Raw;\r | |
198 | } PEI_CORE_TEMP_POINTERS;\r | |
199 | \r | |
200 | typedef struct {\r | |
201 | CONST EFI_SEC_PEI_HAND_OFF *SecCoreData;\r | |
202 | EFI_PEI_PPI_DESCRIPTOR *PpiList;\r | |
203 | VOID *Data;\r | |
204 | } PEI_CORE_PARAMETERS;\r | |
205 | \r | |
206 | //\r | |
207 | // PeiCore function\r | |
208 | //\r | |
209 | /**\r | |
210 | \r | |
211 | The entry routine to Pei Core, invoked by PeiMain during transition\r | |
212 | from SEC to PEI. After switching stack in the PEI core, it will restart\r | |
213 | with the old core data.\r | |
214 | \r | |
215 | \r | |
216 | @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size \r | |
217 | and location of temporary RAM, the stack location and the BFV location.\r | |
218 | @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.\r | |
219 | An empty PPI list consists of a single descriptor with the end-tag\r | |
220 | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization\r | |
221 | phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such\r | |
222 | that both the PEI Foundation and any modules can leverage the associated service\r | |
223 | calls and/or code in these early PPIs\r | |
224 | @param Data Pointer to old core data that is used to initialize the\r | |
225 | core's data areas.\r | |
226 | \r | |
227 | **/\r | |
228 | VOID\r | |
229 | EFIAPI\r | |
230 | PeiCore (\r | |
231 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r | |
232 | IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList,\r | |
233 | IN VOID *Data\r | |
234 | );\r | |
235 | \r | |
236 | //\r | |
237 | // Dispatcher support functions\r | |
238 | //\r | |
239 | \r | |
240 | /**\r | |
241 | \r | |
242 | This is the POSTFIX version of the dependency evaluator. When a\r | |
243 | PUSH [PPI GUID] is encountered, a pointer to the GUID is stored on\r | |
244 | the evaluation stack. When that entry is poped from the evaluation\r | |
245 | stack, the PPI is checked if it is installed. This method allows\r | |
246 | some time savings as not all PPIs must be checked for certain\r | |
247 | operation types (AND, OR).\r | |
248 | \r | |
249 | \r | |
250 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
251 | @param DependencyExpression Pointer to a dependency expression. The Grammar adheres to\r | |
252 | the BNF described above and is stored in postfix notation.\r | |
253 | \r | |
254 | @retval TRUE if it is a well-formed Grammar\r | |
255 | @retval FALSE if the dependency expression overflows the evaluation stack\r | |
256 | if the dependency expression underflows the evaluation stack\r | |
257 | if the dependency expression is not a well-formed Grammar.\r | |
258 | \r | |
259 | **/\r | |
260 | BOOLEAN\r | |
261 | PeimDispatchReadiness (\r | |
262 | IN EFI_PEI_SERVICES **PeiServices,\r | |
263 | IN VOID *DependencyExpression\r | |
264 | );\r | |
265 | \r | |
266 | /**\r | |
267 | Conduct PEIM dispatch.\r | |
268 | \r | |
269 | @param SecCoreData Pointer to the data structure containing SEC to PEI handoff data\r | |
270 | @param PrivateData Pointer to the private data passed in from caller\r | |
271 | \r | |
272 | **/\r | |
273 | VOID\r | |
274 | PeiDispatcher (\r | |
275 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r | |
276 | IN PEI_CORE_INSTANCE *PrivateData\r | |
277 | );\r | |
278 | \r | |
279 | /**\r | |
280 | Initialize the Dispatcher's data members\r | |
281 | \r | |
282 | @param PrivateData PeiCore's private data structure\r | |
283 | @param OldCoreData Old data from SecCore\r | |
284 | NULL if being run in non-permament memory mode.\r | |
285 | @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size\r | |
286 | and location of temporary RAM, the stack location and the BFV location.\r | |
287 | \r | |
288 | **/\r | |
289 | VOID\r | |
290 | InitializeDispatcherData (\r | |
291 | IN PEI_CORE_INSTANCE *PrivateData,\r | |
292 | IN PEI_CORE_INSTANCE *OldCoreData,\r | |
293 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData\r | |
294 | );\r | |
295 | \r | |
296 | /**\r | |
297 | This routine parses the Dependency Expression, if available, and\r | |
298 | decides if the module can be executed.\r | |
299 | \r | |
300 | \r | |
301 | @param Private PeiCore's private data structure\r | |
302 | @param FileHandle PEIM's file handle\r | |
303 | @param PeimCount The index of last dispatched PEIM.\r | |
304 | \r | |
305 | @retval TRUE Can be dispatched\r | |
306 | @retval FALSE Cannot be dispatched\r | |
307 | \r | |
308 | **/\r | |
309 | BOOLEAN\r | |
310 | DepexSatisfied (\r | |
311 | IN PEI_CORE_INSTANCE *Private,\r | |
312 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
313 | IN UINTN PeimCount\r | |
314 | );\r | |
315 | \r | |
316 | //\r | |
317 | // PPI support functions\r | |
318 | //\r | |
319 | /**\r | |
320 | \r | |
321 | Initialize PPI services.\r | |
322 | \r | |
323 | @param PrivateData Pointer to the PEI Core data.\r | |
324 | @param OldCoreData Pointer to old PEI Core data. \r | |
325 | NULL if being run in non-permament memory mode.\r | |
326 | \r | |
327 | **/\r | |
328 | VOID\r | |
329 | InitializePpiServices (\r | |
330 | IN PEI_CORE_INSTANCE *PrivateData,\r | |
331 | IN PEI_CORE_INSTANCE *OldCoreData\r | |
332 | );\r | |
333 | \r | |
334 | /**\r | |
335 | \r | |
336 | Migrate the Hob list from the CAR stack to PEI installed memory.\r | |
337 | \r | |
338 | @param PrivateData Pointer to PeiCore's private data structure.\r | |
339 | @param OldCheckingBottom Bottom of temporary memory range. All Ppi in this range\r | |
340 | will be fixup for PpiData and PpiDescriptor pointer.\r | |
341 | @param OldCheckingTop Top of temporary memory range. All Ppi in this range\r | |
342 | will be fixup for PpiData and PpiDescriptor.\r | |
343 | @param Fixup The address difference between\r | |
344 | the new Hob list and old Hob list.\r | |
345 | \r | |
346 | **/\r | |
347 | VOID\r | |
348 | ConvertPpiPointers (\r | |
349 | IN PEI_CORE_INSTANCE *PrivateData,\r | |
350 | IN UINTN OldCheckingBottom,\r | |
351 | IN UINTN OldCheckingTop,\r | |
352 | IN INTN Fixup\r | |
353 | );\r | |
354 | \r | |
355 | /**\r | |
356 | \r | |
357 | Install PPI services. It is implementation of EFI_PEI_SERVICE.InstallPpi.\r | |
358 | \r | |
359 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
360 | @param PpiList Pointer to ppi array that want to be installed.\r | |
361 | \r | |
362 | @retval EFI_SUCCESS if all PPIs in PpiList are successfully installed.\r | |
363 | @retval EFI_INVALID_PARAMETER if PpiList is NULL pointer\r | |
364 | if any PPI in PpiList is not valid\r | |
365 | @retval EFI_OUT_OF_RESOURCES if there is no more memory resource to install PPI\r | |
366 | \r | |
367 | **/\r | |
368 | EFI_STATUS\r | |
369 | EFIAPI\r | |
370 | PeiInstallPpi (\r | |
371 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
372 | IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList\r | |
373 | );\r | |
374 | \r | |
375 | /**\r | |
376 | \r | |
377 | Re-Install PPI services.\r | |
378 | \r | |
379 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
380 | @param OldPpi Pointer to the old PEI PPI Descriptors.\r | |
381 | @param NewPpi Pointer to the new PEI PPI Descriptors.\r | |
382 | \r | |
383 | @retval EFI_SUCCESS if the operation was successful\r | |
384 | @retval EFI_INVALID_PARAMETER if OldPpi or NewPpi is NULL\r | |
385 | if NewPpi is not valid\r | |
386 | @retval EFI_NOT_FOUND if the PPI was not in the database\r | |
387 | \r | |
388 | **/\r | |
389 | EFI_STATUS\r | |
390 | EFIAPI\r | |
391 | PeiReInstallPpi (\r | |
392 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
393 | IN CONST EFI_PEI_PPI_DESCRIPTOR *OldPpi,\r | |
394 | IN CONST EFI_PEI_PPI_DESCRIPTOR *NewPpi\r | |
395 | );\r | |
396 | \r | |
397 | /**\r | |
398 | \r | |
399 | Locate a given named PPI.\r | |
400 | \r | |
401 | \r | |
402 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
403 | @param Guid Pointer to GUID of the PPI.\r | |
404 | @param Instance Instance Number to discover.\r | |
405 | @param PpiDescriptor Pointer to reference the found descriptor. If not NULL,\r | |
406 | returns a pointer to the descriptor (includes flags, etc)\r | |
407 | @param Ppi Pointer to reference the found PPI\r | |
408 | \r | |
409 | @retval EFI_SUCCESS if the PPI is in the database\r | |
410 | @retval EFI_NOT_FOUND if the PPI is not in the database\r | |
411 | \r | |
412 | **/\r | |
413 | EFI_STATUS\r | |
414 | EFIAPI\r | |
415 | PeiLocatePpi (\r | |
416 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
417 | IN CONST EFI_GUID *Guid,\r | |
418 | IN UINTN Instance,\r | |
419 | IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,\r | |
420 | IN OUT VOID **Ppi\r | |
421 | );\r | |
422 | \r | |
423 | /**\r | |
424 | \r | |
425 | Install a notification for a given PPI.\r | |
426 | \r | |
427 | \r | |
428 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
429 | @param NotifyList Pointer to list of Descriptors to notify upon.\r | |
430 | \r | |
431 | @retval EFI_SUCCESS if successful\r | |
432 | @retval EFI_OUT_OF_RESOURCES if no space in the database\r | |
433 | @retval EFI_INVALID_PARAMETER if not a good decriptor\r | |
434 | \r | |
435 | **/\r | |
436 | EFI_STATUS\r | |
437 | EFIAPI\r | |
438 | PeiNotifyPpi (\r | |
439 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
440 | IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList\r | |
441 | );\r | |
442 | \r | |
443 | /**\r | |
444 | \r | |
445 | Process the Notify List at dispatch level.\r | |
446 | \r | |
447 | @param PrivateData PeiCore's private data structure.\r | |
448 | \r | |
449 | **/\r | |
450 | VOID\r | |
451 | ProcessNotifyList (\r | |
452 | IN PEI_CORE_INSTANCE *PrivateData\r | |
453 | );\r | |
454 | \r | |
455 | /**\r | |
456 | \r | |
457 | Dispatch notifications.\r | |
458 | \r | |
459 | @param PrivateData PeiCore's private data structure\r | |
460 | @param NotifyType Type of notify to fire.\r | |
461 | @param InstallStartIndex Install Beginning index.\r | |
462 | @param InstallStopIndex Install Ending index.\r | |
463 | @param NotifyStartIndex Notify Beginning index.\r | |
464 | @param NotifyStopIndex Notify Ending index.\r | |
465 | \r | |
466 | **/\r | |
467 | VOID\r | |
468 | DispatchNotify (\r | |
469 | IN PEI_CORE_INSTANCE *PrivateData,\r | |
470 | IN UINTN NotifyType,\r | |
471 | IN INTN InstallStartIndex,\r | |
472 | IN INTN InstallStopIndex,\r | |
473 | IN INTN NotifyStartIndex,\r | |
474 | IN INTN NotifyStopIndex\r | |
475 | );\r | |
476 | \r | |
477 | //\r | |
478 | // Boot mode support functions\r | |
479 | //\r | |
480 | /**\r | |
481 | This service enables PEIMs to ascertain the present value of the boot mode.\r | |
482 | \r | |
483 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
484 | @param BootMode A pointer to contain the value of the boot mode.\r | |
485 | \r | |
486 | @retval EFI_SUCCESS The boot mode was returned successfully.\r | |
487 | @retval EFI_INVALID_PARAMETER BootMode is NULL.\r | |
488 | \r | |
489 | **/\r | |
490 | EFI_STATUS\r | |
491 | EFIAPI\r | |
492 | PeiGetBootMode (\r | |
493 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
494 | IN OUT EFI_BOOT_MODE *BootMode\r | |
495 | );\r | |
496 | \r | |
497 | /**\r | |
498 | This service enables PEIMs to update the boot mode variable.\r | |
499 | \r | |
500 | \r | |
501 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
502 | @param BootMode The value of the boot mode to set.\r | |
503 | \r | |
504 | @return EFI_SUCCESS The value was successfully updated\r | |
505 | \r | |
506 | **/\r | |
507 | EFI_STATUS\r | |
508 | EFIAPI\r | |
509 | PeiSetBootMode (\r | |
510 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
511 | IN EFI_BOOT_MODE BootMode\r | |
512 | );\r | |
513 | \r | |
514 | //\r | |
515 | // Security support functions\r | |
516 | //\r | |
517 | /**\r | |
518 | \r | |
519 | Initialize the security services.\r | |
520 | \r | |
521 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
522 | @param OldCoreData Pointer to the old core data.\r | |
523 | NULL if being run in non-permament memory mode.\r | |
524 | \r | |
525 | **/\r | |
526 | VOID\r | |
527 | InitializeSecurityServices (\r | |
528 | IN EFI_PEI_SERVICES **PeiServices,\r | |
529 | IN PEI_CORE_INSTANCE *OldCoreData\r | |
530 | );\r | |
531 | \r | |
532 | /**\r | |
533 | Verify a Firmware volume.\r | |
534 | \r | |
535 | @param CurrentFvAddress Pointer to the current Firmware Volume under consideration\r | |
536 | \r | |
537 | @retval EFI_SUCCESS Firmware Volume is legal\r | |
538 | @retval EFI_SECURITY_VIOLATION Firmware Volume fails integrity test\r | |
539 | \r | |
540 | **/\r | |
541 | EFI_STATUS\r | |
542 | VerifyFv (\r | |
543 | IN EFI_FIRMWARE_VOLUME_HEADER *CurrentFvAddress\r | |
544 | );\r | |
545 | \r | |
546 | /**\r | |
547 | \r | |
548 | Provide a callout to the security verification service.\r | |
549 | \r | |
550 | \r | |
551 | @param PrivateData PeiCore's private data structure\r | |
552 | @param VolumeHandle Handle of FV\r | |
553 | @param FileHandle Handle of PEIM's ffs\r | |
554 | \r | |
555 | @retval EFI_SUCCESS Image is OK\r | |
556 | @retval EFI_SECURITY_VIOLATION Image is illegal\r | |
557 | \r | |
558 | **/\r | |
559 | EFI_STATUS\r | |
560 | VerifyPeim (\r | |
561 | IN PEI_CORE_INSTANCE *PrivateData,\r | |
562 | IN EFI_PEI_FV_HANDLE VolumeHandle,\r | |
563 | IN EFI_PEI_FILE_HANDLE FileHandle\r | |
564 | );\r | |
565 | \r | |
566 | /**\r | |
567 | \r | |
568 | Gets the pointer to the HOB List.\r | |
569 | \r | |
570 | \r | |
571 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
572 | @param HobList Pointer to the HOB List.\r | |
573 | \r | |
574 | @retval EFI_SUCCESS Get the pointer of HOB List\r | |
575 | @retval EFI_NOT_AVAILABLE_YET the HOB List is not yet published\r | |
576 | @retval EFI_INVALID_PARAMETER HobList is NULL (in debug mode)\r | |
577 | \r | |
578 | **/\r | |
579 | EFI_STATUS\r | |
580 | EFIAPI\r | |
581 | PeiGetHobList (\r | |
582 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
583 | IN OUT VOID **HobList\r | |
584 | );\r | |
585 | \r | |
586 | /**\r | |
587 | Add a new HOB to the HOB List.\r | |
588 | \r | |
589 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
590 | @param Type Type of the new HOB.\r | |
591 | @param Length Length of the new HOB to allocate.\r | |
592 | @param Hob Pointer to the new HOB.\r | |
593 | \r | |
594 | @return EFI_SUCCESS Success to create hob.\r | |
595 | @retval EFI_INVALID_PARAMETER if Hob is NULL\r | |
596 | @retval EFI_NOT_AVAILABLE_YET if HobList is still not available.\r | |
597 | @retval EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.\r | |
598 | \r | |
599 | **/\r | |
600 | EFI_STATUS\r | |
601 | EFIAPI\r | |
602 | PeiCreateHob (\r | |
603 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
604 | IN UINT16 Type,\r | |
605 | IN UINT16 Length,\r | |
606 | IN OUT VOID **Hob\r | |
607 | );\r | |
608 | \r | |
609 | /**\r | |
610 | \r | |
611 | Builds a Handoff Information Table HOB\r | |
612 | \r | |
613 | @param BootMode - Current Bootmode\r | |
614 | @param MemoryBegin - Start Memory Address.\r | |
615 | @param MemoryLength - Length of Memory.\r | |
616 | \r | |
617 | @return EFI_SUCCESS Always success to initialize HOB.\r | |
618 | \r | |
619 | **/\r | |
620 | EFI_STATUS\r | |
621 | PeiCoreBuildHobHandoffInfoTable (\r | |
622 | IN EFI_BOOT_MODE BootMode,\r | |
623 | IN EFI_PHYSICAL_ADDRESS MemoryBegin,\r | |
624 | IN UINT64 MemoryLength\r | |
625 | );\r | |
626 | \r | |
627 | \r | |
628 | //\r | |
629 | // FFS Fw Volume support functions\r | |
630 | //\r | |
631 | /**\r | |
632 | Given the input file pointer, search for the next matching file in the\r | |
633 | FFS volume as defined by SearchType. The search starts from FileHeader inside\r | |
634 | the Firmware Volume defined by FwVolHeader.\r | |
635 | \r | |
636 | \r | |
637 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
638 | @param SearchType Filter to find only files of this type.\r | |
639 | Type EFI_FV_FILETYPE_ALL causes no filtering to be done.\r | |
640 | @param FwVolHeader Pointer to the FV header of the volume to search.\r | |
641 | @param FileHeader Pointer to the current file from which to begin searching.\r | |
642 | This pointer will be updated upon return to reflect the file found.\r | |
643 | @retval EFI_NOT_FOUND No files matching the search criteria were found\r | |
644 | @retval EFI_SUCCESS Success to find next file in given volume\r | |
645 | \r | |
646 | **/\r | |
647 | EFI_STATUS\r | |
648 | EFIAPI\r | |
649 | PeiFfsFindNextFile (\r | |
650 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
651 | IN UINT8 SearchType,\r | |
652 | IN EFI_PEI_FV_HANDLE FwVolHeader,\r | |
653 | IN OUT EFI_PEI_FILE_HANDLE *FileHeader\r | |
654 | );\r | |
655 | \r | |
656 | /**\r | |
657 | Given the input file pointer, search for the next matching section in the\r | |
658 | FFS volume.\r | |
659 | \r | |
660 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
661 | @param SectionType Filter to find only sections of this type.\r | |
662 | @param FfsFileHeader Pointer to the current file to search.\r | |
663 | @param SectionData Pointer to the Section matching SectionType in FfsFileHeader.\r | |
664 | NULL if section not found\r | |
665 | \r | |
666 | @retval EFI_NOT_FOUND No files matching the search criteria were found\r | |
667 | @retval EFI_SUCCESS Success to find section data in given file\r | |
668 | \r | |
669 | **/\r | |
670 | EFI_STATUS\r | |
671 | EFIAPI\r | |
672 | PeiFfsFindSectionData (\r | |
673 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
674 | IN EFI_SECTION_TYPE SectionType,\r | |
675 | IN EFI_PEI_FILE_HANDLE FfsFileHeader,\r | |
676 | IN OUT VOID **SectionData\r | |
677 | );\r | |
678 | \r | |
679 | /**\r | |
680 | search the firmware volumes by index\r | |
681 | \r | |
682 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
683 | @param Instance Instance of FV to find\r | |
684 | @param FwVolHeader Pointer to found Volume.\r | |
685 | \r | |
686 | @retval EFI_INVALID_PARAMETER FwVolHeader is NULL\r | |
687 | @retval EFI_SUCCESS Firmware volume instance successfully found.\r | |
688 | \r | |
689 | **/\r | |
690 | EFI_STATUS\r | |
691 | EFIAPI\r | |
692 | PeiFvFindNextVolume (\r | |
693 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
694 | IN UINTN Instance,\r | |
695 | IN OUT EFI_PEI_FV_HANDLE *FwVolHeader\r | |
696 | );\r | |
697 | \r | |
698 | //\r | |
699 | // Memory support functions\r | |
700 | //\r | |
701 | /**\r | |
702 | \r | |
703 | Initialize the memory services.\r | |
704 | \r | |
705 | @param PrivateData PeiCore's private data structure\r | |
706 | @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size \r | |
707 | and location of temporary RAM, the stack location and the BFV location.\r | |
708 | @param OldCoreData Pointer to the PEI Core data.\r | |
709 | NULL if being run in non-permament memory mode.\r | |
710 | \r | |
711 | **/\r | |
712 | VOID\r | |
713 | InitializeMemoryServices (\r | |
714 | IN PEI_CORE_INSTANCE *PrivateData,\r | |
715 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r | |
716 | IN PEI_CORE_INSTANCE *OldCoreData\r | |
717 | );\r | |
718 | \r | |
719 | /**\r | |
720 | \r | |
721 | Install the permanent memory is now available.\r | |
722 | Creates HOB (PHIT and Stack).\r | |
723 | \r | |
724 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
725 | @param MemoryBegin Start of memory address.\r | |
726 | @param MemoryLength Length of memory.\r | |
727 | \r | |
728 | @return EFI_SUCCESS Always success.\r | |
729 | \r | |
730 | **/\r | |
731 | EFI_STATUS\r | |
732 | EFIAPI\r | |
733 | PeiInstallPeiMemory (\r | |
734 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
735 | IN EFI_PHYSICAL_ADDRESS MemoryBegin,\r | |
736 | IN UINT64 MemoryLength\r | |
737 | );\r | |
738 | \r | |
739 | /**\r | |
740 | \r | |
741 | Memory allocation service on permanent memory,\r | |
742 | not usable prior to the memory installation.\r | |
743 | \r | |
744 | \r | |
745 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
746 | @param MemoryType Type of memory to allocate.\r | |
747 | @param Pages Number of pages to allocate.\r | |
748 | @param Memory Pointer of memory allocated.\r | |
749 | \r | |
750 | @retval EFI_SUCCESS The allocation was successful\r | |
751 | @retval EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.\r | |
752 | @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available\r | |
753 | @retval EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement\r | |
754 | to allocate the number of pages.\r | |
755 | \r | |
756 | **/\r | |
757 | EFI_STATUS\r | |
758 | EFIAPI\r | |
759 | PeiAllocatePages (\r | |
760 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
761 | IN EFI_MEMORY_TYPE MemoryType,\r | |
762 | IN UINTN Pages,\r | |
763 | OUT EFI_PHYSICAL_ADDRESS *Memory\r | |
764 | );\r | |
765 | \r | |
766 | /**\r | |
767 | \r | |
768 | Memory allocation service on the CAR.\r | |
769 | \r | |
770 | \r | |
771 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
772 | @param Size Amount of memory required\r | |
773 | @param Buffer Address of pointer to the buffer\r | |
774 | \r | |
775 | @retval EFI_SUCCESS The allocation was successful\r | |
776 | @retval EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement\r | |
777 | to allocate the requested size.\r | |
778 | \r | |
779 | **/\r | |
780 | EFI_STATUS\r | |
781 | EFIAPI\r | |
782 | PeiAllocatePool (\r | |
783 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
784 | IN UINTN Size,\r | |
785 | OUT VOID **Buffer\r | |
786 | );\r | |
787 | \r | |
788 | /**\r | |
789 | \r | |
790 | Routine for load image file.\r | |
791 | \r | |
792 | \r | |
793 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
794 | @param FileHandle Pointer to the FFS file header of the image.\r | |
795 | @param EntryPoint Pointer to entry point of specified image file for output.\r | |
796 | @param AuthenticationState Pointer to attestation authentication state of image.\r | |
797 | \r | |
798 | @retval EFI_SUCCESS Image is successfully loaded.\r | |
799 | @retval EFI_NOT_FOUND Fail to locate necessary PPI\r | |
800 | @retval Others Fail to load file.\r | |
801 | \r | |
802 | **/\r | |
803 | EFI_STATUS\r | |
804 | PeiLoadImage (\r | |
805 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
806 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
807 | OUT EFI_PHYSICAL_ADDRESS *EntryPoint,\r | |
808 | OUT UINT32 *AuthenticationState\r | |
809 | );\r | |
810 | \r | |
811 | /**\r | |
812 | \r | |
813 | Core version of the Status Code reporter\r | |
814 | \r | |
815 | \r | |
816 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
817 | @param CodeType Type of Status Code.\r | |
818 | @param Value Value to output for Status Code.\r | |
819 | @param Instance Instance Number of this status code.\r | |
820 | @param CallerId ID of the caller of this status code.\r | |
821 | @param Data Optional data associated with this status code.\r | |
822 | \r | |
823 | @retval EFI_SUCCESS if status code is successfully reported\r | |
824 | @retval EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed\r | |
825 | \r | |
826 | **/\r | |
827 | EFI_STATUS\r | |
828 | EFIAPI\r | |
829 | PeiReportStatusCode (\r | |
830 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
831 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
832 | IN EFI_STATUS_CODE_VALUE Value,\r | |
833 | IN UINT32 Instance,\r | |
834 | IN CONST EFI_GUID *CallerId,\r | |
835 | IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL\r | |
836 | );\r | |
837 | \r | |
838 | /**\r | |
839 | \r | |
840 | Core version of the Reset System\r | |
841 | \r | |
842 | \r | |
843 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
844 | \r | |
845 | @retval EFI_NOT_AVAILABLE_YET PPI not available yet.\r | |
846 | @retval EFI_DEVICE_ERROR Did not reset system.\r | |
847 | Otherwise, resets the system.\r | |
848 | \r | |
849 | **/\r | |
850 | EFI_STATUS\r | |
851 | EFIAPI\r | |
852 | PeiResetSystem (\r | |
853 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
854 | );\r | |
855 | \r | |
856 | /**\r | |
857 | \r | |
858 | Initialize PeiCore Fv List.\r | |
859 | \r | |
860 | \r | |
861 | @param PrivateData - Pointer to PEI_CORE_INSTANCE.\r | |
862 | @param SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.\r | |
863 | \r | |
864 | **/\r | |
865 | VOID\r | |
866 | PeiInitializeFv (\r | |
867 | IN PEI_CORE_INSTANCE *PrivateData,\r | |
868 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData\r | |
869 | );\r | |
870 | \r | |
871 | /**\r | |
872 | Process Firmware Volum Information once FvInfoPPI install.\r | |
873 | \r | |
874 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
875 | @param NotifyDescriptor Address of the notification descriptor data structure.\r | |
876 | @param Ppi Address of the PPI that was installed.\r | |
877 | \r | |
878 | @retval EFI_SUCCESS if the interface could be successfully installed\r | |
879 | \r | |
880 | **/\r | |
881 | EFI_STATUS\r | |
882 | EFIAPI\r | |
883 | FirmwareVolmeInfoPpiNotifyCallback (\r | |
884 | IN EFI_PEI_SERVICES **PeiServices,\r | |
885 | IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r | |
886 | IN VOID *Ppi\r | |
887 | );\r | |
888 | \r | |
889 | /**\r | |
890 | \r | |
891 | Given the input VolumeHandle, search for the next matching name file.\r | |
892 | \r | |
893 | @param FileName File name to search.\r | |
894 | @param VolumeHandle The current FV to search.\r | |
895 | @param FileHandle Pointer to the file matching name in VolumeHandle.\r | |
896 | NULL if file not found\r | |
897 | \r | |
898 | @retval EFI_NOT_FOUND No files matching the search criteria were found\r | |
899 | @retval EFI_SUCCESS Success to search given file\r | |
900 | \r | |
901 | **/\r | |
902 | EFI_STATUS\r | |
903 | EFIAPI\r | |
904 | PeiFfsFindFileByName (\r | |
905 | IN CONST EFI_GUID *FileName,\r | |
906 | IN EFI_PEI_FV_HANDLE VolumeHandle,\r | |
907 | OUT EFI_PEI_FILE_HANDLE *FileHandle\r | |
908 | );\r | |
909 | \r | |
910 | /**\r | |
911 | \r | |
912 | Returns information about a specific file.\r | |
913 | \r | |
914 | \r | |
915 | @param FileHandle The handle to file.\r | |
916 | @param FileInfo Pointer to the file information.\r | |
917 | \r | |
918 | @retval EFI_INVALID_PARAMETER Invalid FileHandle or FileInfo.\r | |
919 | @retval EFI_SUCCESS Success to collect file info.\r | |
920 | \r | |
921 | **/\r | |
922 | EFI_STATUS\r | |
923 | EFIAPI\r | |
924 | PeiFfsGetFileInfo (\r | |
925 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
926 | OUT EFI_FV_FILE_INFO *FileInfo\r | |
927 | );\r | |
928 | \r | |
929 | /**\r | |
930 | \r | |
931 | Collect information of given Fv Volume.\r | |
932 | \r | |
933 | @param VolumeHandle The handle to Fv Volume.\r | |
934 | @param VolumeInfo The pointer to volume information.\r | |
935 | \r | |
936 | @retval EFI_INVALID_PARAMETER VolumeInfo is NULL\r | |
937 | @retval EFI_SUCCESS Success to collect fv info.\r | |
938 | **/\r | |
939 | EFI_STATUS\r | |
940 | EFIAPI\r | |
941 | PeiFfsGetVolumeInfo (\r | |
942 | IN EFI_PEI_FV_HANDLE VolumeHandle,\r | |
943 | OUT EFI_FV_INFO *VolumeInfo\r | |
944 | );\r | |
945 | \r | |
946 | /**\r | |
947 | This routine enable a PEIM to register itself to shadow when PEI Foundation\r | |
948 | discovery permanent memory.\r | |
949 | \r | |
950 | @param FileHandle File handle of a PEIM.\r | |
951 | \r | |
952 | @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.\r | |
953 | @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.\r | |
954 | @retval EFI_SUCCESS Successfully to register itself.\r | |
955 | \r | |
956 | **/\r | |
957 | EFI_STATUS\r | |
958 | EFIAPI\r | |
959 | PeiRegisterForShadow (\r | |
960 | IN EFI_PEI_FILE_HANDLE FileHandle\r | |
961 | );\r | |
962 | \r | |
963 | /**\r | |
964 | Given the input file pointer, search for the next matching file in the\r | |
965 | FFS volume as defined by SearchType. The search starts from FileHeader inside\r | |
966 | the Firmware Volume defined by FwVolHeader.\r | |
967 | \r | |
968 | \r | |
969 | @param FvHandle Pointer to the FV header of the volume to search\r | |
970 | @param FileName File name\r | |
971 | @param SearchType Filter to find only files of this type.\r | |
972 | Type EFI_FV_FILETYPE_ALL causes no filtering to be done.\r | |
973 | @param FileHandle This parameter must point to a valid FFS volume.\r | |
974 | @param AprioriFile Pointer to AprioriFile image in this FV if has\r | |
975 | \r | |
976 | @return EFI_NOT_FOUND No files matching the search criteria were found\r | |
977 | @retval EFI_SUCCESS Success to search given file\r | |
978 | \r | |
979 | **/\r | |
980 | EFI_STATUS\r | |
981 | PeiFindFileEx (\r | |
982 | IN CONST EFI_PEI_FV_HANDLE FvHandle,\r | |
983 | IN CONST EFI_GUID *FileName, OPTIONAL\r | |
984 | IN EFI_FV_FILETYPE SearchType,\r | |
985 | IN OUT EFI_PEI_FILE_HANDLE *FileHandle,\r | |
986 | IN OUT EFI_PEI_FV_HANDLE *AprioriFile OPTIONAL\r | |
987 | );\r | |
988 | \r | |
989 | /**\r | |
990 | Initialize image service that install PeiLoadFilePpi.\r | |
991 | \r | |
992 | @param PrivateData Pointer to PeiCore's private data structure PEI_CORE_INSTANCE.\r | |
993 | @param OldCoreData Pointer to Old PeiCore's private data.\r | |
994 | If NULL, PeiCore is entered at first time, stack/heap in temporary memory.\r | |
995 | If not NULL, PeiCore is entered at second time, stack/heap has been moved\r | |
996 | to permenent memory.\r | |
997 | \r | |
998 | **/\r | |
999 | VOID\r | |
1000 | InitializeImageServices (\r | |
1001 | IN PEI_CORE_INSTANCE *PrivateData,\r | |
1002 | IN PEI_CORE_INSTANCE *OldCoreData\r | |
1003 | );\r | |
1004 | \r | |
1005 | /**\r | |
1006 | Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob.\r | |
1007 | \r | |
1008 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
1009 | @param ParentFvHandle Fv handle to parent Fv image that contain this Fv file.\r | |
1010 | @param ParentFvFileHandle File handle of a Fv type file that contain this Fv image.\r | |
1011 | @param AuthenticationState Pointer to attestation authentication state of image.\r | |
1012 | If return 0, means pass security checking.\r | |
1013 | \r | |
1014 | @retval EFI_NOT_FOUND FV image can't be found.\r | |
1015 | @retval EFI_SUCCESS Successfully to process it.\r | |
1016 | \r | |
1017 | **/\r | |
1018 | EFI_STATUS\r | |
1019 | ProcessFvFile (\r | |
1020 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1021 | IN EFI_PEI_FV_HANDLE ParentFvHandle,\r | |
1022 | IN EFI_PEI_FILE_HANDLE ParentFvFileHandle,\r | |
1023 | OUT UINT32 *AuthenticationState\r | |
1024 | );\r | |
1025 | \r | |
1026 | /**\r | |
1027 | The wrapper function of PeiLoadImageLoadImage().\r | |
1028 | \r | |
1029 | @param This Pointer to EFI_PEI_LOAD_FILE_PPI.\r | |
1030 | @param FileHandle Pointer to the FFS file header of the image.\r | |
1031 | @param ImageAddressArg Pointer to PE/TE image.\r | |
1032 | @param ImageSizeArg Size of PE/TE image.\r | |
1033 | @param EntryPoint Pointer to entry point of specified image file for output.\r | |
1034 | @param AuthenticationState Pointer to attestation authentication state of image.\r | |
1035 | \r | |
1036 | @return Status of PeiLoadImageLoadImage().\r | |
1037 | \r | |
1038 | **/\r | |
1039 | EFI_STATUS\r | |
1040 | EFIAPI\r | |
1041 | PeiLoadImageLoadImageWrapper (\r | |
1042 | IN CONST EFI_PEI_LOAD_FILE_PPI *This,\r | |
1043 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
1044 | OUT EFI_PHYSICAL_ADDRESS *ImageAddressArg, OPTIONAL\r | |
1045 | OUT UINT64 *ImageSizeArg, OPTIONAL\r | |
1046 | OUT EFI_PHYSICAL_ADDRESS *EntryPoint,\r | |
1047 | OUT UINT32 *AuthenticationState\r | |
1048 | );\r | |
1049 | \r | |
1050 | /**\r | |
1051 | \r | |
1052 | Provide a callback for when the security PPI is installed.\r | |
1053 | \r | |
1054 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
1055 | @param NotifyDescriptor The descriptor for the notification event.\r | |
1056 | @param Ppi Pointer to the PPI in question.\r | |
1057 | \r | |
1058 | @return Always success\r | |
1059 | \r | |
1060 | **/\r | |
1061 | EFI_STATUS\r | |
1062 | EFIAPI\r | |
1063 | SecurityPpiNotifyCallback (\r | |
1064 | IN EFI_PEI_SERVICES **PeiServices,\r | |
1065 | IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r | |
1066 | IN VOID *Ppi\r | |
1067 | );\r | |
1068 | \r | |
1069 | #endif\r |