TianoCore EDK2 master
Loading...
Searching...
No Matches
PeiMain.c
Go to the documentation of this file.
1
9#include "PeiMain.h"
10
11EFI_PEI_PPI_DESCRIPTOR mMemoryDiscoveredPpi = {
12 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
13 &gEfiPeiMemoryDiscoveredPpiGuid,
14 NULL
15};
16EFI_PEI_PPI_DESCRIPTOR mMigrateTempRamPpi = {
17 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
18 &gEdkiiPeiMigrateTempRamPpiGuid,
19 NULL
20};
21
26 {
29 sizeof (EFI_PEI_SERVICES),
30 0,
31 0
32 },
37
40
43
47
53
56
59
68};
69
79 IN PEI_CORE_INSTANCE *PrivateData
80 )
81{
82 EFI_PEI_FILE_HANDLE PeiCoreFileHandle;
83 EFI_PHYSICAL_ADDRESS EntryPoint;
84 EFI_STATUS Status;
85 UINT32 AuthenticationState;
86 UINTN Index;
87 EFI_PEI_CORE_FV_LOCATION_PPI *PeiCoreFvLocationPpi;
88 UINTN PeiCoreFvIndex;
89
90 PeiCoreFileHandle = NULL;
91 //
92 // Default PeiCore is in BFV
93 //
94 PeiCoreFvIndex = 0;
95 //
96 // Find the PEI Core either from EFI_PEI_CORE_FV_LOCATION_PPI indicated FV or BFV
97 //
98 Status = PeiServicesLocatePpi (
99 &gEfiPeiCoreFvLocationPpiGuid,
100 0,
101 NULL,
102 (VOID **)&PeiCoreFvLocationPpi
103 );
104 if (!EFI_ERROR (Status) && (PeiCoreFvLocationPpi->PeiCoreFvLocation != NULL)) {
105 //
106 // If PeiCoreFvLocation present, the PEI Core should be found from indicated FV
107 //
108 for (Index = 0; Index < PrivateData->FvCount; Index++) {
109 if (PrivateData->Fv[Index].FvHandle == PeiCoreFvLocationPpi->PeiCoreFvLocation) {
110 PeiCoreFvIndex = Index;
111 break;
112 }
113 }
114
115 ASSERT (Index < PrivateData->FvCount);
116 }
117
118 //
119 // Find PEI Core from the given FV index
120 //
121 Status = PrivateData->Fv[PeiCoreFvIndex].FvPpi->FindFileByType (
122 PrivateData->Fv[PeiCoreFvIndex].FvPpi,
123 EFI_FV_FILETYPE_PEI_CORE,
124 PrivateData->Fv[PeiCoreFvIndex].FvHandle,
125 &PeiCoreFileHandle
126 );
127 ASSERT_EFI_ERROR (Status);
128
129 //
130 // Shadow PEI Core into memory so it will run faster
131 //
132 Status = PeiLoadImage (
134 *((EFI_PEI_FILE_HANDLE *)&PeiCoreFileHandle),
135 PEIM_STATE_REGISTER_FOR_SHADOW,
136 &EntryPoint,
137 &AuthenticationState
138 );
139 ASSERT_EFI_ERROR (Status);
140
141 //
142 // Compute the PeiCore's function address after shadowed PeiCore.
143 // _ModuleEntryPoint is PeiCore main function entry
144 //
145 return (PEICORE_FUNCTION_POINTER)((UINTN)EntryPoint + (UINTN)PeiCore - (UINTN)_ModuleEntryPoint);
146}
147
167VOID
168EFIAPI
170 IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreDataPtr,
172 IN VOID *Data
173 )
174{
175 PEI_CORE_INSTANCE PrivateData;
176 EFI_SEC_PEI_HAND_OFF *SecCoreData;
177 EFI_SEC_PEI_HAND_OFF NewSecCoreData;
178 EFI_STATUS Status;
180 PEI_CORE_INSTANCE *OldCoreData;
181 EFI_PEI_CPU_IO_PPI *CpuIo;
182 EFI_PEI_PCI_CFG2_PPI *PciCfg;
183 EFI_HOB_HANDOFF_INFO_TABLE *HandoffInformationTable;
184 EFI_PEI_TEMPORARY_RAM_DONE_PPI *TemporaryRamDonePpi;
185 UINTN Index;
186
187 //
188 // Retrieve context passed into PEI Core
189 //
190 OldCoreData = (PEI_CORE_INSTANCE *)Data;
191 SecCoreData = (EFI_SEC_PEI_HAND_OFF *)SecCoreDataPtr;
192
193 //
194 // Perform PEI Core phase specific actions.
195 //
196 if (OldCoreData == NULL) {
197 //
198 // If OldCoreData is NULL, means current is the first entry into the PEI Core before memory is available.
199 //
200 ZeroMem (&PrivateData, sizeof (PEI_CORE_INSTANCE));
201 PrivateData.Signature = PEI_CORE_HANDLE_SIGNATURE;
202 CopyMem (&PrivateData.ServiceTableShadow, &gPs, sizeof (gPs));
203 } else {
204 //
205 // Memory is available to the PEI Core. See if the PEI Core has been shadowed to memory yet.
206 //
207 if (OldCoreData->ShadowedPeiCore == NULL) {
208 //
209 // Fixup the PeiCore's private data
210 //
211 OldCoreData->Ps = &OldCoreData->ServiceTableShadow;
212 OldCoreData->CpuIo = &OldCoreData->ServiceTableShadow.CpuIo;
213 if (OldCoreData->HeapOffsetPositive) {
214 OldCoreData->HobList.Raw = (VOID *)(OldCoreData->HobList.Raw + OldCoreData->HeapOffset);
215 if (OldCoreData->UnknownFvInfo != NULL) {
216 OldCoreData->UnknownFvInfo = (PEI_CORE_UNKNOW_FORMAT_FV_INFO *)((UINT8 *)OldCoreData->UnknownFvInfo + OldCoreData->HeapOffset);
217 }
218
219 if (OldCoreData->CurrentFvFileHandles != NULL) {
220 OldCoreData->CurrentFvFileHandles = (EFI_PEI_FILE_HANDLE *)((UINT8 *)OldCoreData->CurrentFvFileHandles + OldCoreData->HeapOffset);
221 }
222
223 if (OldCoreData->PpiData.PpiList.PpiPtrs != NULL) {
224 OldCoreData->PpiData.PpiList.PpiPtrs = (PEI_PPI_LIST_POINTERS *)((UINT8 *)OldCoreData->PpiData.PpiList.PpiPtrs + OldCoreData->HeapOffset);
225 }
226
227 if (OldCoreData->PpiData.CallbackNotifyList.NotifyPtrs != NULL) {
228 OldCoreData->PpiData.CallbackNotifyList.NotifyPtrs = (PEI_PPI_LIST_POINTERS *)((UINT8 *)OldCoreData->PpiData.CallbackNotifyList.NotifyPtrs + OldCoreData->HeapOffset);
229 }
230
231 if (OldCoreData->PpiData.DispatchNotifyList.NotifyPtrs != NULL) {
232 OldCoreData->PpiData.DispatchNotifyList.NotifyPtrs = (PEI_PPI_LIST_POINTERS *)((UINT8 *)OldCoreData->PpiData.DispatchNotifyList.NotifyPtrs + OldCoreData->HeapOffset);
233 }
234
235 OldCoreData->Fv = (PEI_CORE_FV_HANDLE *)((UINT8 *)OldCoreData->Fv + OldCoreData->HeapOffset);
236 for (Index = 0; Index < OldCoreData->FvCount; Index++) {
237 if (OldCoreData->Fv[Index].PeimState != NULL) {
238 OldCoreData->Fv[Index].PeimState = (UINT8 *)OldCoreData->Fv[Index].PeimState + OldCoreData->HeapOffset;
239 }
240
241 if (OldCoreData->Fv[Index].FvFileHandles != NULL) {
242 OldCoreData->Fv[Index].FvFileHandles = (EFI_PEI_FILE_HANDLE *)((UINT8 *)OldCoreData->Fv[Index].FvFileHandles + OldCoreData->HeapOffset);
243 }
244 }
245
246 OldCoreData->TempFileGuid = (EFI_GUID *)((UINT8 *)OldCoreData->TempFileGuid + OldCoreData->HeapOffset);
247 OldCoreData->TempFileHandles = (EFI_PEI_FILE_HANDLE *)((UINT8 *)OldCoreData->TempFileHandles + OldCoreData->HeapOffset);
248 } else {
249 OldCoreData->HobList.Raw = (VOID *)(OldCoreData->HobList.Raw - OldCoreData->HeapOffset);
250 if (OldCoreData->UnknownFvInfo != NULL) {
251 OldCoreData->UnknownFvInfo = (PEI_CORE_UNKNOW_FORMAT_FV_INFO *)((UINT8 *)OldCoreData->UnknownFvInfo - OldCoreData->HeapOffset);
252 }
253
254 if (OldCoreData->CurrentFvFileHandles != NULL) {
255 OldCoreData->CurrentFvFileHandles = (EFI_PEI_FILE_HANDLE *)((UINT8 *)OldCoreData->CurrentFvFileHandles - OldCoreData->HeapOffset);
256 }
257
258 if (OldCoreData->PpiData.PpiList.PpiPtrs != NULL) {
259 OldCoreData->PpiData.PpiList.PpiPtrs = (PEI_PPI_LIST_POINTERS *)((UINT8 *)OldCoreData->PpiData.PpiList.PpiPtrs - OldCoreData->HeapOffset);
260 }
261
262 if (OldCoreData->PpiData.CallbackNotifyList.NotifyPtrs != NULL) {
263 OldCoreData->PpiData.CallbackNotifyList.NotifyPtrs = (PEI_PPI_LIST_POINTERS *)((UINT8 *)OldCoreData->PpiData.CallbackNotifyList.NotifyPtrs - OldCoreData->HeapOffset);
264 }
265
266 if (OldCoreData->PpiData.DispatchNotifyList.NotifyPtrs != NULL) {
267 OldCoreData->PpiData.DispatchNotifyList.NotifyPtrs = (PEI_PPI_LIST_POINTERS *)((UINT8 *)OldCoreData->PpiData.DispatchNotifyList.NotifyPtrs - OldCoreData->HeapOffset);
268 }
269
270 OldCoreData->Fv = (PEI_CORE_FV_HANDLE *)((UINT8 *)OldCoreData->Fv - OldCoreData->HeapOffset);
271 for (Index = 0; Index < OldCoreData->FvCount; Index++) {
272 if (OldCoreData->Fv[Index].PeimState != NULL) {
273 OldCoreData->Fv[Index].PeimState = (UINT8 *)OldCoreData->Fv[Index].PeimState - OldCoreData->HeapOffset;
274 }
275
276 if (OldCoreData->Fv[Index].FvFileHandles != NULL) {
277 OldCoreData->Fv[Index].FvFileHandles = (EFI_PEI_FILE_HANDLE *)((UINT8 *)OldCoreData->Fv[Index].FvFileHandles - OldCoreData->HeapOffset);
278 }
279 }
280
281 OldCoreData->TempFileGuid = (EFI_GUID *)((UINT8 *)OldCoreData->TempFileGuid - OldCoreData->HeapOffset);
282 OldCoreData->TempFileHandles = (EFI_PEI_FILE_HANDLE *)((UINT8 *)OldCoreData->TempFileHandles - OldCoreData->HeapOffset);
283 }
284
285 // Force relocating the dispatch table
286 OldCoreData->DelayedDispatchTable = NULL;
287
288 //
289 // Fixup for PeiService's address
290 //
292
293 //
294 // Initialize libraries that the PEI Core is linked against
295 //
296 ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES **)&OldCoreData->Ps);
297
298 //
299 // Update HandOffHob for new installed permanent memory
300 //
301 HandoffInformationTable = OldCoreData->HobList.HandoffInformationTable;
302 if (OldCoreData->HeapOffsetPositive) {
303 HandoffInformationTable->EfiEndOfHobList = HandoffInformationTable->EfiEndOfHobList + OldCoreData->HeapOffset;
304 } else {
305 HandoffInformationTable->EfiEndOfHobList = HandoffInformationTable->EfiEndOfHobList - OldCoreData->HeapOffset;
306 }
307
308 HandoffInformationTable->EfiMemoryTop = OldCoreData->PhysicalMemoryBegin + OldCoreData->PhysicalMemoryLength;
309 HandoffInformationTable->EfiMemoryBottom = OldCoreData->PhysicalMemoryBegin;
310 HandoffInformationTable->EfiFreeMemoryTop = OldCoreData->FreePhysicalMemoryTop;
311 HandoffInformationTable->EfiFreeMemoryBottom = HandoffInformationTable->EfiEndOfHobList + sizeof (EFI_HOB_GENERIC_HEADER);
312
313 //
314 // We need convert MemoryBaseAddress in memory allocation HOBs
315 //
316 ConvertMemoryAllocationHobs (OldCoreData);
317
318 //
319 // We need convert the PPI descriptor's pointer
320 //
321 ConvertPpiPointers (SecCoreData, OldCoreData);
322
323 //
324 // After the whole temporary memory is migrated, then we can allocate page in
325 // permanent memory.
326 //
327 OldCoreData->PeiMemoryInstalled = TRUE;
328
329 if (PcdGetBool (PcdMigrateTemporaryRamFirmwareVolumes)) {
330 DEBUG ((DEBUG_VERBOSE, "Early Migration - PPI lists before temporary RAM evacuation:\n"));
331 DumpPpiList (OldCoreData);
332
333 //
334 // Migrate installed content from Temporary RAM to Permanent RAM at this
335 // stage when PEI core still runs from a cached location.
336 // FVs that doesn't contain PEI_CORE should be migrated here.
337 //
338 EvacuateTempRam (OldCoreData, SecCoreData);
339
340 DEBUG ((DEBUG_VERBOSE, "Early Migration - PPI lists after temporary RAM evacuation:\n"));
341 DumpPpiList (OldCoreData);
342 }
343
344 //
345 // Indicate that PeiCore reenter
346 //
347 OldCoreData->PeimDispatcherReenter = TRUE;
348
349 if ((PcdGet64 (PcdLoadModuleAtFixAddressEnable) != 0) && (OldCoreData->HobList.HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME)) {
350 //
351 // if Loading Module at Fixed Address is enabled, allocate the PEI code memory range usage bit map array.
352 // Every bit in the array indicate the status of the corresponding memory page available or not
353 //
354 OldCoreData->PeiCodeMemoryRangeUsageBitMap = AllocateZeroPool (((PcdGet32 (PcdLoadFixAddressPeiCodePageNumber)>>6) + 1)*sizeof (UINT64));
355 }
356
357 //
358 // Shadow PEI Core. When permanent memory is available, shadow
359 // PEI Core and PEIMs to get high performance.
360 //
361 OldCoreData->ShadowedPeiCore = (PEICORE_FUNCTION_POINTER)(UINTN)PeiCore;
362 if (PcdGetBool (PcdMigrateTemporaryRamFirmwareVolumes) ||
363 ((HandoffInformationTable->BootMode == BOOT_ON_S3_RESUME) && PcdGetBool (PcdShadowPeimOnS3Boot)) ||
364 ((HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME) && PcdGetBool (PcdShadowPeimOnBoot)))
365 {
366 OldCoreData->ShadowedPeiCore = ShadowPeiCore (OldCoreData);
367 }
368
369 //
370 // PEI Core has now been shadowed to memory. Restart PEI Core in memory.
371 //
372 OldCoreData->ShadowedPeiCore (SecCoreData, PpiList, OldCoreData);
373
374 //
375 // Should never reach here.
376 //
377 ASSERT (FALSE);
378 CpuDeadLoop ();
379
380 UNREACHABLE ();
381 }
382
383 //
384 // Memory is available to the PEI Core and the PEI Core has been shadowed to memory.
385 //
386 CopyMem (&NewSecCoreData, SecCoreDataPtr, sizeof (NewSecCoreData));
387 SecCoreData = &NewSecCoreData;
388
389 CopyMem (&PrivateData, OldCoreData, sizeof (PrivateData));
390
391 CpuIo = (VOID *)PrivateData.ServiceTableShadow.CpuIo;
392 PciCfg = (VOID *)PrivateData.ServiceTableShadow.PciCfg;
393
394 CopyMem (&PrivateData.ServiceTableShadow, &gPs, sizeof (gPs));
395
396 PrivateData.ServiceTableShadow.CpuIo = CpuIo;
397 PrivateData.ServiceTableShadow.PciCfg = PciCfg;
398 }
399
400 //
401 // Cache a pointer to the PEI Services Table that is either in temporary memory or permanent memory
402 //
403 PrivateData.Ps = &PrivateData.ServiceTableShadow;
404
405 //
406 // Save PeiServicePointer so that it can be retrieved anywhere.
407 //
409
410 //
411 // Initialize libraries that the PEI Core is linked against
412 //
413 ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES **)&PrivateData.Ps);
414
415 //
416 // Initialize PEI Core Services
417 //
418 InitializeMemoryServices (&PrivateData, SecCoreData, OldCoreData);
419
420 //
421 // Update performance measurements
422 //
423 if (OldCoreData == NULL) {
424 PERF_EVENT ("SEC"); // Means the end of SEC phase.
425
426 //
427 // If first pass, start performance measurement.
428 //
430 PERF_INMODULE_BEGIN ("PreMem");
431 } else {
432 PERF_INMODULE_END ("PreMem");
433 PERF_INMODULE_BEGIN ("PostMem");
434 }
435
436 //
437 // Complete PEI Core Service initialization
438 //
439 InitializeSecurityServices (&PrivateData.Ps, OldCoreData);
440 InitializeDispatcherData (&PrivateData, OldCoreData, SecCoreData);
441 InitializeImageServices (&PrivateData, OldCoreData);
442
443 //
444 // Perform PEI Core Phase specific actions
445 //
446 if (OldCoreData == NULL) {
447 //
448 // Report Status Code EFI_SW_PC_INIT
449 //
452 (EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT)
453 );
454
455 //
456 // If SEC provided the PpiList, process it.
457 //
458 if (PpiList != NULL) {
459 ProcessPpiListFromSec ((CONST EFI_PEI_SERVICES **)&PrivateData.Ps, PpiList);
460 }
461 } else {
462 if (PcdGetBool (PcdMigrateTemporaryRamFirmwareVolumes)) {
463 //
464 // When PcdMigrateTemporaryRamFirmwareVolumes is TRUE, alway shadow all
465 // PEIMs no matter the condition of PcdShadowPeimOnBoot and PcdShadowPeimOnS3Boot
466 //
467 DEBUG ((DEBUG_VERBOSE, "PPI lists before temporary RAM evacuation:\n"));
468 DumpPpiList (&PrivateData);
469
470 //
471 // Migrate installed content from Temporary RAM to Permanent RAM
472 // FVs containing PEI_CORE should be migrated here.
473 //
474 EvacuateTempRam (&PrivateData, SecCoreData);
475
476 Status = PeiServicesInstallPpi (&mMigrateTempRamPpi);
477 ASSERT_EFI_ERROR (Status);
478
479 DEBUG ((DEBUG_VERBOSE, "PPI lists after temporary RAM evacuation:\n"));
480 DumpPpiList (&PrivateData);
481 }
482
483 //
484 // Try to locate Temporary RAM Done Ppi.
485 //
486 Status = PeiServicesLocatePpi (
487 &gEfiTemporaryRamDonePpiGuid,
488 0,
489 NULL,
490 (VOID **)&TemporaryRamDonePpi
491 );
492 if (!EFI_ERROR (Status)) {
493 //
494 // Disable the use of Temporary RAM after the transition from Temporary RAM to Permanent RAM is complete.
495 //
496 TemporaryRamDonePpi->TemporaryRamDone ();
497 }
498
499 //
500 // Alert any listeners that there is permanent memory available
501 //
502 PERF_INMODULE_BEGIN ("DisMem");
503 Status = PeiServicesInstallPpi (&mMemoryDiscoveredPpi);
504
505 //
506 // Process the Notify list and dispatch any notifies for the Memory Discovered PPI
507 //
508 ProcessDispatchNotifyList (&PrivateData);
509
510 PERF_INMODULE_END ("DisMem");
511 }
512
513 //
514 // Call PEIM dispatcher
515 //
516 PeiDispatcher (SecCoreData, &PrivateData);
517
518 if (PrivateData.HobList.HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME) {
519 //
520 // Check if InstallPeiMemory service was called on non-S3 resume boot path.
521 //
522 ASSERT (PrivateData.PeiMemoryInstalled == TRUE);
523 }
524
525 //
526 // Measure PEI Core execution time.
527 //
528 PERF_INMODULE_END ("PostMem");
529
530 //
531 // Lookup DXE IPL PPI
532 //
533 Status = PeiServicesLocatePpi (
534 &gEfiDxeIplPpiGuid,
535 0,
536 NULL,
537 (VOID **)&TempPtr.DxeIpl
538 );
539 ASSERT_EFI_ERROR (Status);
540
541 if (EFI_ERROR (Status)) {
542 //
543 // Report status code to indicate DXE IPL PPI could not be found.
544 //
546 EFI_ERROR_CODE | EFI_ERROR_MAJOR,
547 (EFI_SOFTWARE_PEI_CORE | EFI_SW_PEI_CORE_EC_DXEIPL_NOT_FOUND)
548 );
549 CpuDeadLoop ();
550 }
551
552 //
553 // Enter DxeIpl to load Dxe core.
554 //
555 DEBUG ((DEBUG_INFO, "DXE IPL Entry\n"));
556 Status = TempPtr.DxeIpl->Entry (
557 TempPtr.DxeIpl,
558 &PrivateData.Ps,
559 PrivateData.HobList
560 );
561 //
562 // Should never reach here.
563 //
564 ASSERT_EFI_ERROR (Status);
565 CpuDeadLoop ();
566
567 UNREACHABLE ();
568}
UINT64 UINTN
VOID EFIAPI SetPeiServicesTablePointer(IN CONST EFI_PEI_SERVICES **PeiServicesTablePointer)
CONST EFI_PEI_SERVICES **EFIAPI GetPeiServicesTablePointer(VOID)
VOID EFIAPI CpuDeadLoop(VOID)
Definition: CpuDeadLoop.c:25
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI SetMem(OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value)
Definition: SetMemWrapper.c:38
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS EFIAPI PeiGetBootMode(IN CONST EFI_PEI_SERVICES **PeiServices, IN OUT EFI_BOOT_MODE *BootMode)
Definition: BootMode.c:27
EFI_STATUS EFIAPI PeiSetBootMode(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_BOOT_MODE BootMode)
Definition: BootMode.c:60
VOID InitializeImageServices(IN PEI_CORE_INSTANCE *PrivateData, IN PEI_CORE_INSTANCE *OldCoreData)
Definition: Image.c:963
EFI_STATUS PeiLoadImage(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_FILE_HANDLE FileHandle, IN UINT8 PeimState, OUT EFI_PHYSICAL_ADDRESS *EntryPoint, OUT UINT32 *AuthenticationState)
Definition: Image.c:885
EFI_PEI_PCI_CFG2_PPI gPeiDefaultPciCfg2Ppi
Definition: PciCfg2.c:20
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
EFI_STATUS EFIAPI PeiServicesLocatePpi(IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
EFI_STATUS EFIAPI PeiServicesInstallPpi(IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList)
EFI_PEI_CPU_IO_PPI gPeiDefaultCpuIoPpi
Definition: CpuIo.c:20
VOID PeiDispatcher(IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, IN PEI_CORE_INSTANCE *Private)
Definition: Dispatcher.c:1777
VOID InitializeDispatcherData(IN PEI_CORE_INSTANCE *PrivateData, IN PEI_CORE_INSTANCE *OldCoreData, IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData)
Definition: Dispatcher.c:2132
EFI_STATUS EFIAPI PeiRegisterForShadow(IN EFI_PEI_FILE_HANDLE FileHandle)
Definition: Dispatcher.c:2223
EFI_STATUS EFIAPI EvacuateTempRam(IN PEI_CORE_INSTANCE *Private, IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData)
Definition: Dispatcher.c:1537
EFI_STATUS EFIAPI PeiFfsGetVolumeInfo(IN EFI_PEI_FV_HANDLE VolumeHandle, OUT EFI_FV_INFO *VolumeInfo)
Definition: FwVol.c:1307
EFI_STATUS EFIAPI PeiFfsFindFileByName(IN CONST EFI_GUID *FileName, IN EFI_PEI_FV_HANDLE VolumeHandle, OUT EFI_PEI_FILE_HANDLE *FileHandle)
Definition: FwVol.c:1188
EFI_STATUS EFIAPI PeiFfsFindSectionData3(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_SECTION_TYPE SectionType, IN UINTN SectionInstance, IN EFI_PEI_FILE_HANDLE FileHandle, OUT VOID **SectionData, OUT UINT32 *AuthenticationStatus)
Definition: FwVol.c:1067
EFI_STATUS EFIAPI PeiFfsGetFileInfo(IN EFI_PEI_FILE_HANDLE FileHandle, OUT EFI_FV_FILE_INFO *FileInfo)
Definition: FwVol.c:1221
EFI_STATUS EFIAPI PeiFfsGetFileInfo2(IN EFI_PEI_FILE_HANDLE FileHandle, OUT EFI_FV_FILE_INFO2 *FileInfo)
Definition: FwVol.c:1256
EFI_STATUS EFIAPI PeiFfsFindNextVolume(IN CONST EFI_PEI_SERVICES **PeiServices, IN UINTN Instance, IN OUT EFI_PEI_FV_HANDLE *VolumeHandle)
Definition: FwVol.c:1147
EFI_STATUS EFIAPI PeiFfsFindSectionData(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_SECTION_TYPE SectionType, IN EFI_PEI_FILE_HANDLE FileHandle, OUT VOID **SectionData)
Definition: FwVol.c:1034
EFI_STATUS EFIAPI PeiFfsFindNextFile(IN CONST EFI_PEI_SERVICES **PeiServices, IN UINT8 SearchType, IN EFI_PEI_FV_HANDLE FvHandle, IN OUT EFI_PEI_FILE_HANDLE *FileHandle)
Definition: FwVol.c:1114
EFI_STATUS EFIAPI PeiGetHobList(IN CONST EFI_PEI_SERVICES **PeiServices, IN OUT VOID **HobList)
Definition: Hob.c:25
EFI_STATUS EFIAPI PeiCreateHob(IN CONST EFI_PEI_SERVICES **PeiServices, IN UINT16 Type, IN UINT16 Length, IN OUT VOID **Hob)
Definition: Hob.c:66
#define NULL
Definition: Base.h:319
#define UNREACHABLE()
Definition: Base.h:77
#define CONST
Definition: Base.h:259
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define DEBUG(Expression)
Definition: DebugLib.h:434
#define REPORT_STATUS_CODE(Type, Value)
EFI_STATUS EFIAPI PeiInstallPeiMemory(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_PHYSICAL_ADDRESS MemoryBegin, IN UINT64 MemoryLength)
VOID ConvertMemoryAllocationHobs(IN PEI_CORE_INSTANCE *PrivateData)
EFI_STATUS EFIAPI PeiFreePages(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_PHYSICAL_ADDRESS Memory, IN UINTN Pages)
EFI_STATUS EFIAPI PeiAllocatePages(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, OUT EFI_PHYSICAL_ADDRESS *Memory)
VOID InitializeMemoryServices(IN PEI_CORE_INSTANCE *PrivateData, IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, IN PEI_CORE_INSTANCE *OldCoreData)
EFI_STATUS EFIAPI PeiAllocatePool(IN CONST EFI_PEI_SERVICES **PeiServices, IN UINTN Size, OUT VOID **Buffer)
#define PcdGet64(TokenName)
Definition: PcdLib.h:375
#define PcdGet32(TokenName)
Definition: PcdLib.h:362
#define PcdGetBool(TokenName)
Definition: PcdLib.h:401
VOID EFIAPI PeiCore(IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreDataPtr, IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList, IN VOID *Data)
Definition: PeiMain.c:169
PEICORE_FUNCTION_POINTER ShadowPeiCore(IN PEI_CORE_INSTANCE *PrivateData)
Definition: PeiMain.c:78
EFI_PEI_SERVICES gPs
Definition: PeiMain.c:25
EFI_STATUS EFIAPI PeiLocatePpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
Definition: Ppi.c:662
VOID EFIAPI PeiResetSystem2(IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus, IN UINTN DataSize, IN VOID *ResetData OPTIONAL)
Definition: Reset.c:80
EFI_STATUS(EFIAPI * PEICORE_FUNCTION_POINTER)(IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList, IN PEI_CORE_INSTANCE *OldCoreData)
Definition: PeiMain.h:203
VOID InitializeSecurityServices(IN EFI_PEI_SERVICES **PeiServices, IN PEI_CORE_INSTANCE *OldCoreData)
Definition: Security.c:26
EFI_STATUS EFIAPI PeiInstallPpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList)
Definition: Ppi.c:563
VOID ProcessDispatchNotifyList(IN PEI_CORE_INSTANCE *PrivateData)
Definition: Ppi.c:890
EFI_STATUS EFIAPI PeiReInstallPpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_PPI_DESCRIPTOR *OldPpi, IN CONST EFI_PEI_PPI_DESCRIPTOR *NewPpi)
Definition: Ppi.c:590
EFI_STATUS EFIAPI PeiResetSystem(IN CONST EFI_PEI_SERVICES **PeiServices)
Definition: Reset.c:25
VOID DumpPpiList(IN PEI_CORE_INSTANCE *PrivateData)
Definition: Ppi.c:365
VOID ConvertPpiPointers(IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, IN PEI_CORE_INSTANCE *PrivateData)
Definition: Ppi.c:161
VOID ProcessPpiListFromSec(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList)
Definition: Ppi.c:1021
EFI_STATUS EFIAPI PeiNotifyPpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList)
Definition: Ppi.c:874
EFI_STATUS EFIAPI PeiReportStatusCode(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, IN CONST EFI_GUID *CallerId, IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL)
Definition: StatusCode.c:29
#define PERF_INMODULE_BEGIN(MeasurementString)
#define PERF_CROSSMODULE_BEGIN(MeasurementString)
#define PERF_INMODULE_END(MeasurementString)
#define PERF_EVENT(EventString)
struct _EFI_PEI_SERVICES EFI_PEI_SERVICES
Definition: PiPeiCis.h:31
VOID(EFIAPI * EFI_PEI_COPY_MEM)(IN VOID *Destination, IN VOID *Source, IN UINTN Length)
Definition: PiPeiCis.h:524
#define PEI_SERVICES_REVISION
Definition: PiPeiCis.h:866
#define PEI_SERVICES_SIGNATURE
Definition: PiPeiCis.h:859
VOID * EFI_PEI_FILE_HANDLE
Definition: PiPeiCis.h:26
VOID(EFIAPI * EFI_PEI_SET_MEM)(IN VOID *Buffer, IN UINTN Size, IN UINT8 Value)
Definition: PiPeiCis.h:540
#define EFI_PROGRESS_CODE
Definition: PiStatusCode.h:43
#define EFI_SW_PC_INIT
Definition: PiStatusCode.h:728
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
EFI_PEI_SERVICES * Ps
Definition: PeiMain.h:242
PEI_CORE_UNKNOW_FORMAT_FV_INFO * UnknownFvInfo
Definition: PeiMain.h:265
EFI_PEI_FILE_HANDLE * CurrentFvFileHandles
Definition: PeiMain.h:272
PEI_CORE_FV_HANDLE * Fv
Definition: PeiMain.h:259
EFI_BOOT_MODE BootMode
Definition: PiHob.h:74
EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom
Definition: PiHob.h:92
EFI_PHYSICAL_ADDRESS EfiMemoryTop
Definition: PiHob.h:79
EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop
Definition: PiHob.h:88
EFI_PHYSICAL_ADDRESS EfiMemoryBottom
Definition: PiHob.h:83
EFI_PHYSICAL_ADDRESS EfiEndOfHobList
Definition: PiHob.h:96
Definition: Base.h:213
PEI_PPI_LIST_POINTERS * NotifyPtrs
Definition: PeiMain.h:93
PEI_PPI_LIST_POINTERS * NotifyPtrs
Definition: PeiMain.h:103
PEI_CALLBACK_NOTIFY_LIST CallbackNotifyList
Definition: PeiMain.h:118
PEI_DISPATCH_NOTIFY_LIST DispatchNotifyList
Definition: PeiMain.h:122
PEI_PPI_LIST PpiList
Definition: PeiMain.h:114
PEI_PPI_LIST_POINTERS * PpiPtrs
Definition: PeiMain.h:84