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