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