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