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