]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Core/Pei/PeiMain.h
adjust file list order in dsc file.
[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
d976bf31 237 IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList,\r
b1f6a7c6 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**/\r
b0d803fe 278VOID\r
192f6d4c 279PeiDispatcher (\r
5aae0aa7 280 IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r
b0d803fe 281 IN PEI_CORE_INSTANCE *PrivateData\r
ed66e1bc 282 );\r
192f6d4c 283\r
b1f6a7c6 284/**\r
285 Initialize the Dispatcher's data members\r
192f6d4c 286\r
b1f6a7c6 287 @param PrivateData PeiCore's private data structure\r
288 @param OldCoreData Old data from SecCore\r
289 NULL if being run in non-permament memory mode.\r
290 @param SecCoreData Points to a data structure containing information about the PEI core's operating\r
291 environment, such as the size and location of temporary RAM, the stack location and\r
292 the BFV location.\r
192f6d4c 293\r
b1f6a7c6 294**/\r
192f6d4c 295VOID\r
296InitializeDispatcherData (\r
b0d803fe 297 IN PEI_CORE_INSTANCE *PrivateData,\r
192f6d4c 298 IN PEI_CORE_INSTANCE *OldCoreData,\r
5aae0aa7 299 IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData\r
ed66e1bc 300 );\r
192f6d4c 301\r
b1f6a7c6 302/**\r
303 This routine parses the Dependency Expression, if available, and\r
304 decides if the module can be executed.\r
192f6d4c 305\r
192f6d4c 306\r
b1f6a7c6 307 @param Private PeiCore's private data structure\r
308 @param FileHandle PEIM's file handle\r
731bd38e 309 @param PeimCount The index of last dispatched PEIM.\r
192f6d4c 310\r
731bd38e 311 @retval TRUE Can be dispatched\r
312 @retval FALSE Cannot be dispatched\r
192f6d4c 313\r
b1f6a7c6 314**/\r
192f6d4c 315BOOLEAN\r
316DepexSatisfied (\r
b0d803fe 317 IN PEI_CORE_INSTANCE *Private,\r
318 IN EFI_PEI_FILE_HANDLE FileHandle,\r
319 IN UINTN PeimCount\r
ed66e1bc 320 );\r
192f6d4c 321\r
192f6d4c 322//\r
323// PPI support functions\r
324//\r
b1f6a7c6 325/**\r
326\r
327 Initialize PPI services.\r
328\r
b1f6a7c6 329 @param PrivateData Pointer to the PEI Core data.\r
330 @param OldCoreData Pointer to old PEI Core data. \r
331 NULL if being run in non-permament memory mode.\r
332\r
333**/\r
192f6d4c 334VOID\r
335InitializePpiServices (\r
b0d803fe 336 IN PEI_CORE_INSTANCE *PrivateData,\r
192f6d4c 337 IN PEI_CORE_INSTANCE *OldCoreData\r
ed66e1bc 338 );\r
192f6d4c 339\r
b1f6a7c6 340/**\r
192f6d4c 341\r
731bd38e 342 Migrate the Hob list from the CAR stack to PEI installed memory.\r
343\r
344 @param PrivateData Pointer to PeiCore's private data structure.\r
345 @param OldCheckingBottom Bottom of temporary memory range. All Ppi in this range\r
346 will be fixup for PpiData and PpiDescriptor pointer.\r
347 @param OldCheckingTop Top of temporary memory range. All Ppi in this range\r
348 will be fixup for PpiData and PpiDescriptor.\r
5c5a0601 349 @param Fixup The address difference between\r
350 the new Hob list and old Hob list.\r
192f6d4c 351\r
b1f6a7c6 352**/\r
192f6d4c 353VOID\r
354ConvertPpiPointers (\r
40f26b8f 355 IN PEI_CORE_INSTANCE *PrivateData,\r
356 IN UINTN OldCheckingBottom,\r
357 IN UINTN OldCheckingTop,\r
358 IN INTN Fixup\r
ed66e1bc 359 );\r
192f6d4c 360\r
b1f6a7c6 361/**\r
192f6d4c 362\r
731bd38e 363 Install PPI services. It is implementation of EFI_PEI_SERVICE.InstallPpi.\r
192f6d4c 364\r
15273993 365 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
366 @param PpiList Pointer to ppi array that want to be installed.\r
192f6d4c 367\r
15273993 368 @retval EFI_SUCCESS if all PPIs in PpiList are successfully installed.\r
369 @retval EFI_INVALID_PARAMETER if PpiList is NULL pointer\r
731bd38e 370 if any PPI in PpiList is not valid\r
15273993 371 @retval EFI_OUT_OF_RESOURCES if there is no more memory resource to install PPI\r
192f6d4c 372\r
b1f6a7c6 373**/\r
192f6d4c 374EFI_STATUS\r
375EFIAPI\r
376PeiInstallPpi (\r
0c2b5da8 377 IN CONST EFI_PEI_SERVICES **PeiServices,\r
378 IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList\r
ed66e1bc 379 );\r
192f6d4c 380\r
b1f6a7c6 381/**\r
192f6d4c 382\r
b1f6a7c6 383 Re-Install PPI services.\r
192f6d4c 384\r
1cc76977 385 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
386 @param OldPpi Pointer to the old PEI PPI Descriptors.\r
387 @param NewPpi Pointer to the new PEI PPI Descriptors.\r
192f6d4c 388\r
1cc76977 389 @retval EFI_SUCCESS if the operation was successful\r
390 @retval EFI_INVALID_PARAMETER if OldPpi or NewPpi is NULL\r
731bd38e 391 if NewPpi is not valid\r
1cc76977 392 @retval EFI_NOT_FOUND if the PPI was not in the database\r
192f6d4c 393\r
b1f6a7c6 394**/\r
192f6d4c 395EFI_STATUS\r
396EFIAPI\r
397PeiReInstallPpi (\r
0c2b5da8 398 IN CONST EFI_PEI_SERVICES **PeiServices,\r
399 IN CONST EFI_PEI_PPI_DESCRIPTOR *OldPpi,\r
400 IN CONST EFI_PEI_PPI_DESCRIPTOR *NewPpi\r
ed66e1bc 401 );\r
192f6d4c 402\r
b1f6a7c6 403/**\r
192f6d4c 404\r
b1f6a7c6 405 Locate a given named PPI.\r
192f6d4c 406\r
192f6d4c 407\r
1cc76977 408 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
409 @param Guid Pointer to GUID of the PPI.\r
410 @param Instance Instance Number to discover.\r
411 @param PpiDescriptor Pointer to reference the found descriptor. If not NULL,\r
b1f6a7c6 412 returns a pointer to the descriptor (includes flags, etc)\r
1cc76977 413 @param Ppi Pointer to reference the found PPI\r
192f6d4c 414\r
b1f6a7c6 415 @retval EFI_SUCCESS if the PPI is in the database\r
416 @retval EFI_NOT_FOUND if the PPI is not in the database\r
192f6d4c 417\r
b1f6a7c6 418**/\r
192f6d4c 419EFI_STATUS\r
420EFIAPI\r
421PeiLocatePpi (\r
1cc76977 422 IN CONST EFI_PEI_SERVICES **PeiServices,\r
423 IN CONST EFI_GUID *Guid,\r
192f6d4c 424 IN UINTN Instance,\r
425 IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,\r
426 IN OUT VOID **Ppi\r
ed66e1bc 427 );\r
192f6d4c 428\r
b1f6a7c6 429/**\r
192f6d4c 430\r
b1f6a7c6 431 Install a notification for a given PPI.\r
192f6d4c 432\r
192f6d4c 433\r
1cc76977 434 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
435 @param NotifyList Pointer to list of Descriptors to notify upon.\r
192f6d4c 436\r
b1f6a7c6 437 @retval EFI_SUCCESS if successful\r
438 @retval EFI_OUT_OF_RESOURCES if no space in the database\r
439 @retval EFI_INVALID_PARAMETER if not a good decriptor\r
192f6d4c 440\r
b1f6a7c6 441**/\r
192f6d4c 442EFI_STATUS\r
443EFIAPI\r
444PeiNotifyPpi (\r
0c2b5da8 445 IN CONST EFI_PEI_SERVICES **PeiServices,\r
446 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList\r
ed66e1bc 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
ed66e1bc 459 );\r
192f6d4c 460\r
b1f6a7c6 461/**\r
192f6d4c 462\r
b1f6a7c6 463 Dispatch notifications.\r
192f6d4c 464\r
b1f6a7c6 465 @param PrivateData PeiCore's private data structure\r
466 @param NotifyType Type of notify to fire.\r
467 @param InstallStartIndex Install Beginning index.\r
468 @param InstallStopIndex Install Ending index.\r
469 @param NotifyStartIndex Notify Beginning index.\r
470 @param NotifyStopIndex Notify Ending index.\r
192f6d4c 471\r
b1f6a7c6 472**/\r
192f6d4c 473VOID\r
474DispatchNotify (\r
b0d803fe 475 IN PEI_CORE_INSTANCE *PrivateData,\r
192f6d4c 476 IN UINTN NotifyType,\r
477 IN INTN InstallStartIndex,\r
478 IN INTN InstallStopIndex,\r
479 IN INTN NotifyStartIndex,\r
480 IN INTN NotifyStopIndex\r
ed66e1bc 481 );\r
192f6d4c 482\r
483//\r
484// Boot mode support functions\r
485//\r
b1f6a7c6 486/**\r
487 This service enables PEIMs to ascertain the present value of the boot mode.\r
488\r
1cc76977 489 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
b1f6a7c6 490 @param BootMode A pointer to contain the value of the boot mode.\r
491\r
492 @retval EFI_SUCCESS The boot mode was returned successfully.\r
493 @retval EFI_INVALID_PARAMETER BootMode is NULL.\r
494\r
495**/\r
192f6d4c 496EFI_STATUS\r
497EFIAPI\r
498PeiGetBootMode (\r
0c2b5da8 499 IN CONST EFI_PEI_SERVICES **PeiServices,\r
d976bf31 500 IN OUT EFI_BOOT_MODE *BootMode\r
ed66e1bc 501 );\r
192f6d4c 502\r
b1f6a7c6 503/**\r
504 This service enables PEIMs to update the boot mode variable.\r
192f6d4c 505\r
192f6d4c 506\r
1cc76977 507 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
508 @param BootMode The value of the boot mode to set.\r
192f6d4c 509\r
1cc76977 510 @return EFI_SUCCESS The value was successfully updated\r
192f6d4c 511\r
b1f6a7c6 512**/\r
192f6d4c 513EFI_STATUS\r
514EFIAPI\r
515PeiSetBootMode (\r
0c2b5da8 516 IN CONST EFI_PEI_SERVICES **PeiServices,\r
192f6d4c 517 IN EFI_BOOT_MODE BootMode\r
ed66e1bc 518 );\r
192f6d4c 519\r
520//\r
521// Security support functions\r
522//\r
b1f6a7c6 523/**\r
524\r
525 Initialize the security services.\r
526\r
1cc76977 527 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
40f26b8f 528 @param OldCoreData Pointer to the old core data.\r
b1f6a7c6 529 NULL if being run in non-permament memory mode.\r
530\r
531**/\r
192f6d4c 532VOID\r
533InitializeSecurityServices (\r
534 IN EFI_PEI_SERVICES **PeiServices,\r
535 IN PEI_CORE_INSTANCE *OldCoreData\r
ed66e1bc 536 );\r
192f6d4c 537\r
b1f6a7c6 538/**\r
d976bf31 539 Verify a Firmware volume.\r
192f6d4c 540\r
40f26b8f 541 @param CurrentFvAddress Pointer to the current Firmware Volume under consideration\r
192f6d4c 542\r
40f26b8f 543 @retval EFI_SUCCESS Firmware Volume is legal\r
544 @retval EFI_SECURITY_VIOLATION Firmware Volume fails integrity test\r
192f6d4c 545\r
b1f6a7c6 546**/\r
192f6d4c 547EFI_STATUS\r
548VerifyFv (\r
549 IN EFI_FIRMWARE_VOLUME_HEADER *CurrentFvAddress\r
ed66e1bc 550 );\r
192f6d4c 551\r
b1f6a7c6 552/**\r
192f6d4c 553\r
b1f6a7c6 554 Provide a callout to the security verification service.\r
192f6d4c 555\r
192f6d4c 556\r
b1f6a7c6 557 @param PrivateData PeiCore's private data structure\r
558 @param VolumeHandle Handle of FV\r
559 @param FileHandle Handle of PEIM's ffs\r
192f6d4c 560\r
b1f6a7c6 561 @retval EFI_SUCCESS Image is OK\r
562 @retval EFI_SECURITY_VIOLATION Image is illegal\r
192f6d4c 563\r
b1f6a7c6 564**/\r
192f6d4c 565EFI_STATUS\r
566VerifyPeim (\r
b0d803fe 567 IN PEI_CORE_INSTANCE *PrivateData,\r
568 IN EFI_PEI_FV_HANDLE VolumeHandle,\r
569 IN EFI_PEI_FILE_HANDLE FileHandle\r
ed66e1bc 570 );\r
192f6d4c 571\r
b1f6a7c6 572/**\r
192f6d4c 573\r
b1f6a7c6 574 Gets the pointer to the HOB List.\r
192f6d4c 575\r
192f6d4c 576\r
1cc76977 577 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
b1f6a7c6 578 @param HobList Pointer to the HOB List.\r
192f6d4c 579\r
b1f6a7c6 580 @retval EFI_SUCCESS Get the pointer of HOB List\r
581 @retval EFI_NOT_AVAILABLE_YET the HOB List is not yet published\r
582 @retval EFI_INVALID_PARAMETER HobList is NULL (in debug mode)\r
192f6d4c 583\r
b1f6a7c6 584**/\r
192f6d4c 585EFI_STATUS\r
586EFIAPI\r
587PeiGetHobList (\r
0c2b5da8 588 IN CONST EFI_PEI_SERVICES **PeiServices,\r
192f6d4c 589 IN OUT VOID **HobList\r
ed66e1bc 590 );\r
192f6d4c 591\r
b1f6a7c6 592/**\r
593 Add a new HOB to the HOB List.\r
192f6d4c 594\r
1cc76977 595 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
596 @param Type Type of the new HOB.\r
597 @param Length Length of the new HOB to allocate.\r
598 @param Hob Pointer to the new HOB.\r
192f6d4c 599\r
b1f6a7c6 600 @return EFI_SUCCESS Success to create hob.\r
601 @retval EFI_INVALID_PARAMETER if Hob is NULL\r
602 @retval EFI_NOT_AVAILABLE_YET if HobList is still not available.\r
603 @retval EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.\r
192f6d4c 604\r
b1f6a7c6 605**/\r
192f6d4c 606EFI_STATUS\r
607EFIAPI\r
608PeiCreateHob (\r
0c2b5da8 609 IN CONST EFI_PEI_SERVICES **PeiServices,\r
192f6d4c 610 IN UINT16 Type,\r
611 IN UINT16 Length,\r
612 IN OUT VOID **Hob\r
ed66e1bc 613 );\r
192f6d4c 614\r
b1f6a7c6 615/**\r
192f6d4c 616\r
b1f6a7c6 617 Builds a Handoff Information Table HOB\r
192f6d4c 618\r
b1f6a7c6 619 @param BootMode - Current Bootmode\r
620 @param MemoryBegin - Start Memory Address.\r
621 @param MemoryLength - Length of Memory.\r
192f6d4c 622\r
b1f6a7c6 623 @return EFI_SUCCESS Always success to initialize HOB.\r
192f6d4c 624\r
b1f6a7c6 625**/\r
192f6d4c 626EFI_STATUS\r
627PeiCoreBuildHobHandoffInfoTable (\r
628 IN EFI_BOOT_MODE BootMode,\r
629 IN EFI_PHYSICAL_ADDRESS MemoryBegin,\r
630 IN UINT64 MemoryLength\r
ed66e1bc 631 );\r
192f6d4c 632\r
633\r
634//\r
635// FFS Fw Volume support functions\r
636//\r
b1f6a7c6 637/**\r
638 Given the input file pointer, search for the next matching file in the\r
639 FFS volume as defined by SearchType. The search starts from FileHeader inside\r
640 the Firmware Volume defined by FwVolHeader.\r
641\r
642\r
1cc76977 643 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
b1f6a7c6 644 @param SearchType Filter to find only files of this type.\r
645 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.\r
15273993 646 @param FwVolHeader Pointer to the FV header of the volume to search.\r
647 @param FileHeader Pointer to the current file from which to begin searching.\r
b1f6a7c6 648 This pointer will be updated upon return to reflect the file found.\r
649 @retval EFI_NOT_FOUND No files matching the search criteria were found\r
650 @retval EFI_SUCCESS Success to find next file in given volume\r
651\r
652**/\r
192f6d4c 653EFI_STATUS\r
654EFIAPI\r
655PeiFfsFindNextFile (\r
0c2b5da8 656 IN CONST EFI_PEI_SERVICES **PeiServices,\r
192f6d4c 657 IN UINT8 SearchType,\r
0c2b5da8 658 IN EFI_PEI_FV_HANDLE FwVolHeader,\r
659 IN OUT EFI_PEI_FILE_HANDLE *FileHeader\r
ed66e1bc 660 );\r
192f6d4c 661\r
b1f6a7c6 662/**\r
663 Given the input file pointer, search for the next matching section in the\r
664 FFS volume.\r
192f6d4c 665\r
1cc76977 666 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
b1f6a7c6 667 @param SectionType Filter to find only sections of this type.\r
15273993 668 @param FfsFileHeader Pointer to the current file to search.\r
b1f6a7c6 669 @param SectionData Pointer to the Section matching SectionType in FfsFileHeader.\r
670 NULL if section not found\r
192f6d4c 671\r
b1f6a7c6 672 @retval EFI_NOT_FOUND No files matching the search criteria were found\r
673 @retval EFI_SUCCESS Success to find section data in given file\r
192f6d4c 674\r
b1f6a7c6 675**/\r
192f6d4c 676EFI_STATUS\r
677EFIAPI\r
678PeiFfsFindSectionData (\r
b0d803fe 679 IN CONST EFI_PEI_SERVICES **PeiServices,\r
192f6d4c 680 IN EFI_SECTION_TYPE SectionType,\r
0c2b5da8 681 IN EFI_PEI_FILE_HANDLE FfsFileHeader,\r
192f6d4c 682 IN OUT VOID **SectionData\r
ed66e1bc 683 );\r
192f6d4c 684\r
b1f6a7c6 685/**\r
686 search the firmware volumes by index\r
192f6d4c 687\r
15273993 688 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
689 @param Instance Instance of FV to find\r
690 @param FwVolHeader Pointer to found Volume.\r
192f6d4c 691\r
15273993 692 @retval EFI_INVALID_PARAMETER FwVolHeader is NULL\r
693 @retval EFI_SUCCESS Firmware volume instance successfully found.\r
192f6d4c 694\r
b1f6a7c6 695**/\r
192f6d4c 696EFI_STATUS\r
697EFIAPI\r
698PeiFvFindNextVolume (\r
15273993 699 IN CONST EFI_PEI_SERVICES **PeiServices,\r
192f6d4c 700 IN UINTN Instance,\r
0c2b5da8 701 IN OUT EFI_PEI_FV_HANDLE *FwVolHeader\r
ed66e1bc 702 );\r
192f6d4c 703\r
704//\r
705// Memory support functions\r
706//\r
b1f6a7c6 707/**\r
708\r
709 Initialize the memory services.\r
710\r
1cc76977 711 @param PrivateData PeiCore's private data structure\r
b1f6a7c6 712 @param SecCoreData Points to a data structure containing information about the PEI core's operating\r
713 environment, such as the size and location of temporary RAM, the stack location and\r
714 the BFV location.\r
715 @param OldCoreData Pointer to the PEI Core data.\r
716 NULL if being run in non-permament memory mode.\r
717\r
718**/\r
192f6d4c 719VOID\r
720InitializeMemoryServices (\r
b0d803fe 721 IN PEI_CORE_INSTANCE *PrivateData,\r
5aae0aa7 722 IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r
192f6d4c 723 IN PEI_CORE_INSTANCE *OldCoreData\r
ed66e1bc 724 );\r
192f6d4c 725\r
b1f6a7c6 726/**\r
192f6d4c 727\r
b1f6a7c6 728 Install the permanent memory is now available.\r
729 Creates HOB (PHIT and Stack).\r
192f6d4c 730\r
1cc76977 731 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
732 @param MemoryBegin Start of memory address.\r
733 @param MemoryLength Length of memory.\r
192f6d4c 734\r
b1f6a7c6 735 @return EFI_SUCCESS Always success.\r
192f6d4c 736\r
b1f6a7c6 737**/\r
192f6d4c 738EFI_STATUS\r
739EFIAPI\r
740PeiInstallPeiMemory (\r
0c2b5da8 741 IN CONST EFI_PEI_SERVICES **PeiServices,\r
192f6d4c 742 IN EFI_PHYSICAL_ADDRESS MemoryBegin,\r
743 IN UINT64 MemoryLength\r
ed66e1bc 744 );\r
192f6d4c 745\r
b1f6a7c6 746/**\r
192f6d4c 747\r
b1f6a7c6 748 Memory allocation service on permanent memory,\r
749 not usable prior to the memory installation.\r
192f6d4c 750\r
192f6d4c 751\r
1cc76977 752 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
753 @param MemoryType Type of memory to allocate.\r
754 @param Pages Number of pages to allocate.\r
755 @param Memory Pointer of memory allocated.\r
192f6d4c 756\r
b1f6a7c6 757 @retval EFI_SUCCESS The allocation was successful\r
758 @retval EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.\r
759 @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available\r
760 @retval EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement\r
761 to allocate the number of pages.\r
192f6d4c 762\r
b1f6a7c6 763**/\r
192f6d4c 764EFI_STATUS\r
765EFIAPI\r
766PeiAllocatePages (\r
0c2b5da8 767 IN CONST EFI_PEI_SERVICES **PeiServices,\r
192f6d4c 768 IN EFI_MEMORY_TYPE MemoryType,\r
769 IN UINTN Pages,\r
770 OUT EFI_PHYSICAL_ADDRESS *Memory\r
ed66e1bc 771 );\r
192f6d4c 772\r
b1f6a7c6 773/**\r
192f6d4c 774\r
b1f6a7c6 775 Memory allocation service on the CAR.\r
192f6d4c 776\r
192f6d4c 777\r
1cc76977 778 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
779 @param Size Amount of memory required\r
780 @param Buffer Address of pointer to the buffer\r
192f6d4c 781\r
b1f6a7c6 782 @retval EFI_SUCCESS The allocation was successful\r
783 @retval EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement\r
784 to allocate the requested size.\r
192f6d4c 785\r
b1f6a7c6 786**/\r
192f6d4c 787EFI_STATUS\r
788EFIAPI\r
789PeiAllocatePool (\r
0c2b5da8 790 IN CONST EFI_PEI_SERVICES **PeiServices,\r
192f6d4c 791 IN UINTN Size,\r
792 OUT VOID **Buffer\r
ed66e1bc 793 );\r
192f6d4c 794\r
b1f6a7c6 795/**\r
192f6d4c 796\r
b1f6a7c6 797 Routine for load image file.\r
192f6d4c 798\r
192f6d4c 799\r
1cc76977 800 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
801 @param FileHandle Pointer to the FFS file header of the image.\r
802 @param EntryPoint Pointer to entry point of specified image file for output.\r
803 @param AuthenticationState Pointer to attestation authentication state of image.\r
192f6d4c 804\r
1cc76977 805 @retval EFI_SUCCESS Image is successfully loaded.\r
806 @retval EFI_NOT_FOUND Fail to locate necessary PPI\r
807 @retval Others Fail to load file.\r
192f6d4c 808\r
b1f6a7c6 809**/\r
192f6d4c 810EFI_STATUS\r
811PeiLoadImage (\r
6c7a807a 812 IN CONST EFI_PEI_SERVICES **PeiServices,\r
b0d803fe 813 IN EFI_PEI_FILE_HANDLE FileHandle,\r
814 OUT EFI_PHYSICAL_ADDRESS *EntryPoint,\r
815 OUT UINT32 *AuthenticationState\r
ed66e1bc 816 );\r
192f6d4c 817\r
b1f6a7c6 818/**\r
192f6d4c 819\r
b1f6a7c6 820 Core version of the Status Code reporter\r
192f6d4c 821\r
192f6d4c 822\r
1cc76977 823 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
824 @param CodeType Type of Status Code.\r
825 @param Value Value to output for Status Code.\r
826 @param Instance Instance Number of this status code.\r
827 @param CallerId ID of the caller of this status code.\r
828 @param Data Optional data associated with this status code.\r
192f6d4c 829\r
b1f6a7c6 830 @retval EFI_SUCCESS if status code is successfully reported\r
831 @retval EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed\r
192f6d4c 832\r
b1f6a7c6 833**/\r
192f6d4c 834EFI_STATUS\r
835EFIAPI\r
836PeiReportStatusCode (\r
0c2b5da8 837 IN CONST EFI_PEI_SERVICES **PeiServices,\r
192f6d4c 838 IN EFI_STATUS_CODE_TYPE CodeType,\r
839 IN EFI_STATUS_CODE_VALUE Value,\r
840 IN UINT32 Instance,\r
0c2b5da8 841 IN CONST EFI_GUID *CallerId,\r
842 IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL\r
ed66e1bc 843 );\r
192f6d4c 844\r
b1f6a7c6 845/**\r
192f6d4c 846\r
b1f6a7c6 847 Core version of the Reset System\r
192f6d4c 848\r
192f6d4c 849\r
1cc76977 850 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
192f6d4c 851\r
b1f6a7c6 852 @retval EFI_NOT_AVAILABLE_YET PPI not available yet.\r
853 @retval EFI_DEVICE_ERROR Did not reset system.\r
854 Otherwise, resets the system.\r
192f6d4c 855\r
b1f6a7c6 856**/\r
192f6d4c 857EFI_STATUS\r
858EFIAPI\r
859PeiResetSystem (\r
b0d803fe 860 IN CONST EFI_PEI_SERVICES **PeiServices\r
ed66e1bc 861 );\r
192f6d4c 862\r
b1f6a7c6 863/**\r
192f6d4c 864\r
b1f6a7c6 865 Initialize PeiCore Fv List.\r
192f6d4c 866\r
192f6d4c 867\r
b1f6a7c6 868 @param PrivateData - Pointer to PEI_CORE_INSTANCE.\r
869 @param SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.\r
192f6d4c 870\r
b1f6a7c6 871**/\r
50cb16d9 872VOID\r
b0d803fe 873PeiInitializeFv (\r
874 IN PEI_CORE_INSTANCE *PrivateData,\r
875 IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData\r
ed66e1bc 876 );\r
b0d803fe 877\r
b1f6a7c6 878/**\r
879 Process Firmware Volum Information once FvInfoPPI install.\r
b0d803fe 880\r
1cc76977 881 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
882 @param NotifyDescriptor Address of the notification descriptor data structure.\r
883 @param Ppi Address of the PPI that was installed.\r
50cb16d9 884\r
b1f6a7c6 885 @retval EFI_SUCCESS if the interface could be successfully installed\r
b0d803fe 886\r
b1f6a7c6 887**/\r
b0d803fe 888EFI_STATUS\r
889EFIAPI\r
890FirmwareVolmeInfoPpiNotifyCallback (\r
891 IN EFI_PEI_SERVICES **PeiServices,\r
892 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r
893 IN VOID *Ppi\r
ed66e1bc 894 );\r
b0d803fe 895\r
b1f6a7c6 896/**\r
50cb16d9 897\r
b1f6a7c6 898 Given the input VolumeHandle, search for the next matching name file.\r
b0d803fe 899\r
1cc76977 900 @param FileName File name to search.\r
901 @param VolumeHandle The current FV to search.\r
902 @param FileHandle Pointer to the file matching name in VolumeHandle.\r
903 NULL if file not found\r
b0d803fe 904\r
15273993 905 @retval EFI_NOT_FOUND No files matching the search criteria were found\r
906 @retval EFI_SUCCESS Success to search given file\r
b0d803fe 907\r
b1f6a7c6 908**/\r
b0d803fe 909EFI_STATUS\r
50cb16d9 910EFIAPI\r
b0d803fe 911PeiFfsFindFileByName (\r
912 IN CONST EFI_GUID *FileName,\r
913 IN EFI_PEI_FV_HANDLE VolumeHandle,\r
914 OUT EFI_PEI_FILE_HANDLE *FileHandle\r
ed66e1bc 915 );\r
b0d803fe 916\r
b1f6a7c6 917/**\r
b0d803fe 918\r
b1f6a7c6 919 Returns information about a specific file.\r
b0d803fe 920\r
b0d803fe 921\r
1cc76977 922 @param FileHandle The handle to file.\r
923 @param FileInfo Pointer to the file information.\r
b0d803fe 924\r
b1f6a7c6 925 @retval EFI_INVALID_PARAMETER Invalid FileHandle or FileInfo.\r
926 @retval EFI_SUCCESS Success to collect file info.\r
b0d803fe 927\r
b1f6a7c6 928**/\r
b0d803fe 929EFI_STATUS\r
50cb16d9 930EFIAPI\r
b0d803fe 931PeiFfsGetFileInfo (\r
932 IN EFI_PEI_FILE_HANDLE FileHandle,\r
933 OUT EFI_FV_FILE_INFO *FileInfo\r
ed66e1bc 934 );\r
b0d803fe 935\r
b1f6a7c6 936/**\r
b0d803fe 937\r
b1f6a7c6 938 Collect information of given Fv Volume.\r
b0d803fe 939\r
1cc76977 940 @param VolumeHandle The handle to Fv Volume.\r
941 @param VolumeInfo The pointer to volume information.\r
b0d803fe 942\r
b1f6a7c6 943 @retval EFI_INVALID_PARAMETER VolumeInfo is NULL\r
944 @retval EFI_SUCCESS Success to collect fv info.\r
945**/\r
b0d803fe 946EFI_STATUS\r
50cb16d9 947EFIAPI\r
b0d803fe 948PeiFfsGetVolumeInfo (\r
949 IN EFI_PEI_FV_HANDLE VolumeHandle,\r
950 OUT EFI_FV_INFO *VolumeInfo\r
ed66e1bc 951 );\r
b0d803fe 952\r
14e8823a 953/**\r
954 This routine enable a PEIM to register itself to shadow when PEI Foundation\r
955 discovery permanent memory.\r
956\r
b1f6a7c6 957 @param FileHandle File handle of a PEIM.\r
50cb16d9 958\r
b1f6a7c6 959 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.\r
960 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.\r
961 @retval EFI_SUCCESS Successfully to register itself.\r
14e8823a 962\r
50cb16d9 963**/\r
14e8823a 964EFI_STATUS\r
965EFIAPI\r
966PeiRegisterForShadow (\r
967 IN EFI_PEI_FILE_HANDLE FileHandle\r
ed66e1bc 968 );\r
14e8823a 969\r
b1f6a7c6 970/**\r
971 Given the input file pointer, search for the next matching file in the\r
972 FFS volume as defined by SearchType. The search starts from FileHeader inside\r
973 the Firmware Volume defined by FwVolHeader.\r
974\r
975\r
976 @param FvHandle Pointer to the FV header of the volume to search\r
977 @param FileName File name\r
978 @param SearchType Filter to find only files of this type.\r
979 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.\r
980 @param FileHandle This parameter must point to a valid FFS volume.\r
981 @param AprioriFile Pointer to AprioriFile image in this FV if has\r
982\r
983 @return EFI_NOT_FOUND No files matching the search criteria were found\r
984 @retval EFI_SUCCESS Success to search given file\r
985\r
986**/\r
b0d803fe 987EFI_STATUS\r
988PeiFindFileEx (\r
989 IN CONST EFI_PEI_FV_HANDLE FvHandle,\r
990 IN CONST EFI_GUID *FileName, OPTIONAL\r
991 IN EFI_FV_FILETYPE SearchType,\r
992 IN OUT EFI_PEI_FILE_HANDLE *FileHandle,\r
993 IN OUT EFI_PEI_FV_HANDLE *AprioriFile OPTIONAL\r
ed66e1bc 994 );\r
b0d803fe 995\r
b1f6a7c6 996/**\r
15273993 997 Initialize image service that install PeiLoadFilePpi.\r
b0d803fe 998\r
15273993 999 @param PrivateData Pointer to PeiCore's private data structure PEI_CORE_INSTANCE.\r
1000 @param OldCoreData Pointer to Old PeiCore's private data.\r
1001 If NULL, PeiCore is entered at first time, stack/heap in temporary memory.\r
1002 If not NULL, PeiCore is entered at second time, stack/heap has been moved\r
1003 to permenent memory.\r
b0d803fe 1004\r
b1f6a7c6 1005**/\r
1006VOID\r
1007InitializeImageServices (\r
1008 IN PEI_CORE_INSTANCE *PrivateData,\r
1009 IN PEI_CORE_INSTANCE *OldCoreData\r
ed66e1bc 1010 );\r
b0d803fe 1011\r
288f9b38
LG
1012/**\r
1013 Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob.\r
1014\r
1cc76977 1015 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
d976bf31 1016 @param FvFileHandle File handle of a Fv type file.\r
288f9b38 1017 @param AuthenticationState Pointer to attestation authentication state of image.\r
731bd38e 1018 If return 0, means pass security checking.\r
50cb16d9 1019\r
b1f6a7c6 1020 @retval EFI_NOT_FOUND FV image can't be found.\r
1021 @retval EFI_SUCCESS Successfully to process it.\r
288f9b38
LG
1022\r
1023**/\r
1024EFI_STATUS\r
1025ProcessFvFile (\r
6c7a807a 1026 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1027 IN EFI_PEI_FILE_HANDLE FvFileHandle,\r
1028 OUT UINT32 *AuthenticationState\r
288f9b38
LG
1029 );\r
1030\r
192f6d4c 1031#endif\r