TianoCore EDK2 master
Loading...
Searching...
No Matches
DxeMain.c
Go to the documentation of this file.
1
9#include "DxeMain.h"
10
11//
12// DXE Core Global Variables for Protocols from PEI
13//
14EFI_HANDLE mDecompressHandle = NULL;
15
16//
17// DXE Core globals for Architecture Protocols
18//
26
27//
28// DXE Core globals for optional protocol dependencies
29//
30EFI_SMM_BASE2_PROTOCOL *gSmmBase2 = NULL;
31
32//
33// DXE Core Global used to update core loaded image protocol handle
34//
35EFI_GUID *gDxeCoreFileName;
36EFI_LOADED_IMAGE_PROTOCOL *gDxeCoreLoadedImage;
37
38//
39// DXE Core Module Variables
40//
41EFI_BOOT_SERVICES mBootServices = {
42 {
43 EFI_BOOT_SERVICES_SIGNATURE, // Signature
44 EFI_BOOT_SERVICES_REVISION, // Revision
45 sizeof (EFI_BOOT_SERVICES), // HeaderSize
46 0, // CRC32
47 0 // Reserved
48 },
49 (EFI_RAISE_TPL)CoreRaiseTpl, // RaiseTPL
50 (EFI_RESTORE_TPL)CoreRestoreTpl, // RestoreTPL
51 (EFI_ALLOCATE_PAGES)CoreAllocatePages, // AllocatePages
52 (EFI_FREE_PAGES)CoreFreePages, // FreePages
53 (EFI_GET_MEMORY_MAP)CoreGetMemoryMap, // GetMemoryMap
54 (EFI_ALLOCATE_POOL)CoreAllocatePool, // AllocatePool
55 (EFI_FREE_POOL)CoreFreePool, // FreePool
56 (EFI_CREATE_EVENT)CoreCreateEvent, // CreateEvent
57 (EFI_SET_TIMER)CoreSetTimer, // SetTimer
58 (EFI_WAIT_FOR_EVENT)CoreWaitForEvent, // WaitForEvent
59 (EFI_SIGNAL_EVENT)CoreSignalEvent, // SignalEvent
60 (EFI_CLOSE_EVENT)CoreCloseEvent, // CloseEvent
61 (EFI_CHECK_EVENT)CoreCheckEvent, // CheckEvent
65 (EFI_HANDLE_PROTOCOL)CoreHandleProtocol, // HandleProtocol
66 (VOID *)NULL, // Reserved
68 (EFI_LOCATE_HANDLE)CoreLocateHandle, // LocateHandle
71 (EFI_IMAGE_LOAD)CoreLoadImage, // LoadImage
72 (EFI_IMAGE_START)CoreStartImage, // StartImage
73 (EFI_EXIT)CoreExit, // Exit
74 (EFI_IMAGE_UNLOAD)CoreUnloadImage, // UnloadImage
77 (EFI_STALL)CoreStall, // Stall
81 (EFI_OPEN_PROTOCOL)CoreOpenProtocol, // OpenProtocol
82 (EFI_CLOSE_PROTOCOL)CoreCloseProtocol, // CloseProtocol
86 (EFI_LOCATE_PROTOCOL)CoreLocateProtocol, // LocateProtocol
90 (EFI_COPY_MEM)CopyMem, // CopyMem
91 (EFI_SET_MEM)SetMem, // SetMem
93};
94
95EFI_DXE_SERVICES mDxeServices = {
96 {
97 DXE_SERVICES_SIGNATURE, // Signature
98 DXE_SERVICES_REVISION, // Revision
99 sizeof (DXE_SERVICES), // HeaderSize
100 0, // CRC32
101 0 // Reserved
102 },
103 (EFI_ADD_MEMORY_SPACE)CoreAddMemorySpace, // AddMemorySpace
105 (EFI_FREE_MEMORY_SPACE)CoreFreeMemorySpace, // FreeMemorySpace
110 (EFI_ADD_IO_SPACE)CoreAddIoSpace, // AddIoSpace
111 (EFI_ALLOCATE_IO_SPACE)CoreAllocateIoSpace, // AllocateIoSpace
112 (EFI_FREE_IO_SPACE)CoreFreeIoSpace, // FreeIoSpace
113 (EFI_REMOVE_IO_SPACE)CoreRemoveIoSpace, // RemoveIoSpace
115 (EFI_GET_IO_SPACE_MAP)CoreGetIoSpaceMap, // GetIoSpaceMap
116 (EFI_DISPATCH)CoreDispatcher, // Dispatch
117 (EFI_SCHEDULE)CoreSchedule, // Schedule
118 (EFI_TRUST)CoreTrust, // Trust
121};
122
123EFI_SYSTEM_TABLE mEfiSystemTableTemplate = {
124 {
125 EFI_SYSTEM_TABLE_SIGNATURE, // Signature
126 EFI_SYSTEM_TABLE_REVISION, // Revision
127 sizeof (EFI_SYSTEM_TABLE), // HeaderSize
128 0, // CRC32
129 0 // Reserved
130 },
131 NULL, // FirmwareVendor
132 0, // FirmwareRevision
133 NULL, // ConsoleInHandle
134 NULL, // ConIn
135 NULL, // ConsoleOutHandle
136 NULL, // ConOut
137 NULL, // StandardErrorHandle
138 NULL, // StdErr
139 NULL, // RuntimeServices
140 &mBootServices, // BootServices
141 0, // NumberOfConfigurationTableEntries
142 NULL // ConfigurationTable
143};
144
145EFI_RUNTIME_SERVICES mEfiRuntimeServicesTableTemplate = {
146 {
147 EFI_RUNTIME_SERVICES_SIGNATURE, // Signature
148 EFI_RUNTIME_SERVICES_REVISION, // Revision
149 sizeof (EFI_RUNTIME_SERVICES), // HeaderSize
150 0, // CRC32
151 0 // Reserved
152 },
162 (EFI_GET_NEXT_HIGH_MONO_COUNT)CoreEfiNotAvailableYetArg1, // GetNextHighMonotonicCount
167};
168
169EFI_RUNTIME_ARCH_PROTOCOL gRuntimeTemplate = {
170 INITIALIZE_LIST_HEAD_VARIABLE (gRuntimeTemplate.ImageHead),
171 INITIALIZE_LIST_HEAD_VARIABLE (gRuntimeTemplate.EventHead),
172
173 //
174 // Make sure Size != sizeof (EFI_MEMORY_DESCRIPTOR). This will
175 // prevent people from having pointer math bugs in their code.
176 // now you have to use *DescriptorSize to make things work.
177 //
178 sizeof (EFI_MEMORY_DESCRIPTOR) + sizeof (UINT64) - (sizeof (EFI_MEMORY_DESCRIPTOR) % sizeof (UINT64)),
180 0,
181 NULL,
182 NULL,
183 FALSE,
184 FALSE
185};
186
187EFI_RUNTIME_ARCH_PROTOCOL *gRuntime = &gRuntimeTemplate;
188
189//
190// DXE Core Global Variables for the EFI System Table, Boot Services Table,
191// DXE Services Table, and Runtime Services Table
192//
193EFI_DXE_SERVICES *gDxeCoreDS = &mDxeServices;
194EFI_SYSTEM_TABLE *gDxeCoreST = NULL;
195
196//
197// For debug initialize gDxeCoreRT to template. gDxeCoreRT must be allocated from RT memory
198// but gDxeCoreRT is used for ASSERT () and DEBUG () type macros so lets give it
199// a value that will not cause debug infrastructure to crash early on.
200//
201EFI_RUNTIME_SERVICES *gDxeCoreRT = &mEfiRuntimeServicesTableTemplate;
202EFI_HANDLE gDxeCoreImageHandle = NULL;
203
204BOOLEAN gMemoryMapTerminated = FALSE;
205
206//
207// EFI Decompress Protocol
208//
209EFI_DECOMPRESS_PROTOCOL gEfiDecompress = {
212};
213
214//
215// For Loading modules at fixed address feature, the configuration table is to cache the top address below which to load
216// Runtime code&boot time code
217//
218GLOBAL_REMOVE_IF_UNREFERENCED EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE gLoadModuleAtFixAddressConfigurationTable = { 0, 0 };
219
220// Main entry point to the DXE Core
221//
222
231VOID
232EFIAPI
234 IN VOID *HobStart
235 )
236{
237 EFI_STATUS Status;
238 EFI_PHYSICAL_ADDRESS MemoryBaseAddress;
239 UINT64 MemoryLength;
240 PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
241 UINTN Index;
242 EFI_HOB_GUID_TYPE *GuidHob;
243 EFI_VECTOR_HANDOFF_INFO *VectorInfoList;
244 EFI_VECTOR_HANDOFF_INFO *VectorInfo;
245 VOID *EntryPoint;
246
247 //
248 // Setup the default exception handlers
249 //
250 VectorInfoList = NULL;
251 GuidHob = GetNextGuidHob (&gEfiVectorHandoffInfoPpiGuid, HobStart);
252 if (GuidHob != NULL) {
253 VectorInfoList = (EFI_VECTOR_HANDOFF_INFO *)(GET_GUID_HOB_DATA (GuidHob));
254 }
255
256 Status = InitializeCpuExceptionHandlers (VectorInfoList);
257 ASSERT_EFI_ERROR (Status);
258
259 //
260 // Setup Stack Guard
261 //
262 if (PcdGetBool (PcdCpuStackGuard)) {
263 Status = InitializeSeparateExceptionStacks (NULL, NULL);
264 ASSERT_EFI_ERROR (Status);
265 }
266
267 //
268 // Initialize Debug Agent to support source level debug in DXE phase
269 //
270 InitializeDebugAgent (DEBUG_AGENT_INIT_DXE_CORE, HobStart, NULL);
271
272 //
273 // Initialize Memory Services
274 //
275 CoreInitializeMemoryServices (&HobStart, &MemoryBaseAddress, &MemoryLength);
276
277 MemoryProfileInit (HobStart);
278
279 //
280 // Start the Handle Services.
281 //
283 ASSERT_EFI_ERROR (Status);
284
285 //
286 // Start the Image Services.
287 //
288 Status = CoreInitializeImageServices (HobStart);
289 ASSERT_EFI_ERROR (Status);
290
291 //
292 // Initialize the Global Coherency Domain Services
293 //
294 Status = CoreInitializeGcdServices (&HobStart, MemoryBaseAddress, MemoryLength);
295 ASSERT_EFI_ERROR (Status);
296
297 //
298 // Allocate the EFI System Table and EFI Runtime Service Table from EfiRuntimeServicesData
299 // Use the templates to initialize the contents of the EFI System Table and EFI Runtime Services Table
300 //
301 gDxeCoreST = AllocateRuntimeCopyPool (sizeof (EFI_SYSTEM_TABLE), &mEfiSystemTableTemplate);
302 ASSERT (gDxeCoreST != NULL);
303
304 gDxeCoreRT = AllocateRuntimeCopyPool (sizeof (EFI_RUNTIME_SERVICES), &mEfiRuntimeServicesTableTemplate);
305 ASSERT (gDxeCoreRT != NULL);
306
307 gDxeCoreST->RuntimeServices = gDxeCoreRT;
308
309 //
310 // Update DXE Core Loaded Image Protocol with allocated UEFI System Table
311 //
312 gDxeCoreLoadedImage->SystemTable = gDxeCoreST;
313
314 //
315 // Call constructor for all libraries
316 //
317 ProcessLibraryConstructorList (gDxeCoreImageHandle, gDxeCoreST);
318 PERF_CROSSMODULE_END ("PEI");
320
321 //
322 // Log MemoryBaseAddress and MemoryLength again (from
323 // CoreInitializeMemoryServices()), now that library constructors have
324 // executed.
325 //
326 DEBUG ((
327 DEBUG_INFO,
328 "%a: MemoryBaseAddress=0x%Lx MemoryLength=0x%Lx\n",
329 __func__,
330 MemoryBaseAddress,
331 MemoryLength
332 ));
333
334 //
335 // Report DXE Core image information to the PE/COFF Extra Action Library
336 //
337 ZeroMem (&ImageContext, sizeof (ImageContext));
338 ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)gDxeCoreLoadedImage->ImageBase;
339 ImageContext.PdbPointer = PeCoffLoaderGetPdbPointer ((VOID *)(UINTN)ImageContext.ImageAddress);
340 ImageContext.SizeOfHeaders = PeCoffGetSizeOfHeaders ((VOID *)(UINTN)ImageContext.ImageAddress);
341 Status = PeCoffLoaderGetEntryPoint ((VOID *)(UINTN)ImageContext.ImageAddress, &EntryPoint);
342 if (Status == EFI_SUCCESS) {
343 ImageContext.EntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)EntryPoint;
344 }
345
346 ImageContext.Handle = (VOID *)(UINTN)gDxeCoreLoadedImage->ImageBase;
349
350 //
351 // Install the DXE Services Table into the EFI System Tables's Configuration Table
352 //
353 Status = CoreInstallConfigurationTable (&gEfiDxeServicesTableGuid, gDxeCoreDS);
354 ASSERT_EFI_ERROR (Status);
355
356 //
357 // Install the HOB List into the EFI System Tables's Configuration Table
358 //
359 Status = CoreInstallConfigurationTable (&gEfiHobListGuid, HobStart);
360 ASSERT_EFI_ERROR (Status);
361
362 //
363 // Install Memory Type Information Table into the EFI System Tables's Configuration Table
364 //
365 Status = CoreInstallConfigurationTable (&gEfiMemoryTypeInformationGuid, &gMemoryTypeInformation);
366 ASSERT_EFI_ERROR (Status);
367
368 //
369 // If Loading modules At fixed address feature is enabled, install Load moduels at fixed address
370 // Configuration Table so that user could easily to retrieve the top address to load Dxe and PEI
371 // Code and Tseg base to load SMM driver.
372 //
373 if (PcdGet64 (PcdLoadModuleAtFixAddressEnable) != 0) {
374 Status = CoreInstallConfigurationTable (&gLoadFixedAddressConfigurationTableGuid, &gLoadModuleAtFixAddressConfigurationTable);
375 ASSERT_EFI_ERROR (Status);
376 }
377
378 //
379 // Report Status Code here for DXE_ENTRY_POINT once it is available
380 //
383 (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_ENTRY_POINT)
384 );
385
386 //
387 // Create the aligned system table pointer structure that is used by external
388 // debuggers to locate the system table... Also, install debug image info
389 // configuration table.
390 //
393 EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL,
394 gDxeCoreLoadedImage,
395 gDxeCoreImageHandle
396 );
397
398 DEBUG ((DEBUG_INFO | DEBUG_LOAD, "HOBLIST address in DXE = 0x%p\n", HobStart));
399
402
403 for (Hob.Raw = HobStart; !END_OF_HOB_LIST (Hob); Hob.Raw = GET_NEXT_HOB (Hob)) {
404 if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_MEMORY_ALLOCATION) {
405 DEBUG ((
406 DEBUG_INFO | DEBUG_LOAD,
407 "Memory Allocation 0x%08x 0x%0lx - 0x%0lx\n", \
408 Hob.MemoryAllocation->AllocDescriptor.MemoryType, \
409 Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress, \
410 Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress + Hob.MemoryAllocation->AllocDescriptor.MemoryLength - 1
411 ));
412 }
413 }
414
415 for (Hob.Raw = HobStart; !END_OF_HOB_LIST (Hob); Hob.Raw = GET_NEXT_HOB (Hob)) {
416 if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV) {
417 DEBUG ((
418 DEBUG_INFO | DEBUG_LOAD,
419 "FV Hob 0x%0lx - 0x%0lx\n",
420 Hob.FirmwareVolume->BaseAddress,
421 Hob.FirmwareVolume->BaseAddress + Hob.FirmwareVolume->Length - 1
422 ));
423 } else if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV2) {
424 DEBUG ((
425 DEBUG_INFO | DEBUG_LOAD,
426 "FV2 Hob 0x%0lx - 0x%0lx\n",
427 Hob.FirmwareVolume2->BaseAddress,
428 Hob.FirmwareVolume2->BaseAddress + Hob.FirmwareVolume2->Length - 1
429 ));
430 DEBUG ((
431 DEBUG_INFO | DEBUG_LOAD,
432 " %g - %g\n",
433 &Hob.FirmwareVolume2->FvName,
434 &Hob.FirmwareVolume2->FileName
435 ));
436 } else if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV3) {
437 DEBUG ((
438 DEBUG_INFO | DEBUG_LOAD,
439 "FV3 Hob 0x%0lx - 0x%0lx - 0x%x - 0x%x\n",
440 Hob.FirmwareVolume3->BaseAddress,
441 Hob.FirmwareVolume3->BaseAddress + Hob.FirmwareVolume3->Length - 1,
442 Hob.FirmwareVolume3->AuthenticationStatus,
443 Hob.FirmwareVolume3->ExtractedFv
444 ));
445 if (Hob.FirmwareVolume3->ExtractedFv) {
446 DEBUG ((
447 DEBUG_INFO | DEBUG_LOAD,
448 " %g - %g\n",
449 &Hob.FirmwareVolume3->FvName,
450 &Hob.FirmwareVolume3->FileName
451 ));
452 }
453 }
454 }
455
457
458 //
459 // Initialize the Event Services
460 //
461 Status = CoreInitializeEventServices ();
462 ASSERT_EFI_ERROR (Status);
463
465
468
469 //
470 // Get persisted vector hand-off info from GUIDeed HOB again due to HobStart may be updated,
471 // and install configuration table
472 //
473 GuidHob = GetNextGuidHob (&gEfiVectorHandoffInfoPpiGuid, HobStart);
474 if (GuidHob != NULL) {
475 VectorInfoList = (EFI_VECTOR_HANDOFF_INFO *)(GET_GUID_HOB_DATA (GuidHob));
476 VectorInfo = VectorInfoList;
477 Index = 1;
478 while (VectorInfo->Attribute != EFI_VECTOR_HANDOFF_LAST_ENTRY) {
479 VectorInfo++;
480 Index++;
481 }
482
483 VectorInfo = AllocateCopyPool (sizeof (EFI_VECTOR_HANDOFF_INFO) * Index, (VOID *)VectorInfoList);
484 ASSERT (VectorInfo != NULL);
485 Status = CoreInstallConfigurationTable (&gEfiVectorHandoffTableGuid, (VOID *)VectorInfo);
486 ASSERT_EFI_ERROR (Status);
487 }
488
489 //
490 // Get the Protocols that were passed in from PEI to DXE through GUIDed HOBs
491 //
492 // These Protocols are not architectural. This implementation is sharing code between
493 // PEI and DXE in order to save FLASH space. These Protocols could also be implemented
494 // as part of the DXE Core. However, that would also require the DXE Core to be ported
495 // each time a different CPU is used, a different Decompression algorithm is used, or a
496 // different Image type is used. By placing these Protocols in PEI, the DXE Core remains
497 // generic, and only PEI and the Arch Protocols need to be ported from Platform to Platform,
498 // and from CPU to CPU.
499 //
500
501 //
502 // Publish the EFI, Tiano, and Custom Decompress protocols for use by other DXE components
503 //
505 &mDecompressHandle,
506 &gEfiDecompressProtocolGuid,
507 &gEfiDecompress,
508 NULL
509 );
510 ASSERT_EFI_ERROR (Status);
511
512 //
513 // Register for the GUIDs of the Architectural Protocols, so the rest of the
514 // EFI Boot Services and EFI Runtime Services tables can be filled in.
515 // Also register for the GUIDs of optional protocols.
516 //
518
519 //
520 // Produce Firmware Volume Protocols, one for each FV in the HOB list.
521 //
522 Status = FwVolBlockDriverInit (gDxeCoreImageHandle, gDxeCoreST);
523 ASSERT_EFI_ERROR (Status);
524
525 Status = FwVolDriverInit (gDxeCoreImageHandle, gDxeCoreST);
526 ASSERT_EFI_ERROR (Status);
527
528 //
529 // Produce the Section Extraction Protocol
530 //
531 Status = InitializeSectionExtraction (gDxeCoreImageHandle, gDxeCoreST);
532 ASSERT_EFI_ERROR (Status);
533
534 //
535 // Initialize the DXE Dispatcher
536 //
538
539 //
540 // Invoke the DXE Dispatcher
541 //
543
544 //
545 // Display Architectural protocols that were not loaded if this is DEBUG build
546 //
550
551 //
552 // Display any drivers that were not dispatched because dependency expression
553 // evaluated to false if this is a debug build
554 //
558
559 //
560 // Assert if the Architectural Protocols are not present.
561 //
562 Status = CoreAllEfiServicesAvailable ();
563 if (EFI_ERROR (Status)) {
564 //
565 // Report Status code that some Architectural Protocols are not present.
566 //
568 EFI_ERROR_CODE | EFI_ERROR_MAJOR,
569 (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_EC_NO_ARCH)
570 );
571 }
572
573 ASSERT_EFI_ERROR (Status);
574
575 //
576 // Report Status code before transfer control to BDS
577 //
580 (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_HANDOFF_TO_NEXT)
581 );
582
583 //
584 // Transfer control to the BDS Architectural Protocol
585 //
586 gBds->Entry (gBds);
587
588 //
589 // BDS should never return
590 //
591 ASSERT (FALSE);
592 CpuDeadLoop ();
593
594 UNREACHABLE ();
595}
596
607EFIAPI
609 UINTN Arg1
610 )
611{
612 //
613 // This function should never be executed. If it does, then the architectural protocols
614 // have not been designed correctly. The CpuBreakpoint () is commented out for now until the
615 // DXE Core and all the Architectural Protocols are complete.
616 //
617
619}
620
631EFIAPI
633 UINTN Arg1,
634 UINTN Arg2
635 )
636{
637 //
638 // This function should never be executed. If it does, then the architectural protocols
639 // have not been designed correctly. The CpuBreakpoint () is commented out for now until the
640 // DXE Core and all the Architectural Protocols are complete.
641 //
642
644}
645
657EFIAPI
659 UINTN Arg1,
660 UINTN Arg2,
661 UINTN Arg3
662 )
663{
664 //
665 // This function should never be executed. If it does, then the architectural protocols
666 // have not been designed correctly. The CpuBreakpoint () is commented out for now until the
667 // DXE Core and all the Architectural Protocols are complete.
668 //
669
671}
672
685EFIAPI
687 UINTN Arg1,
688 UINTN Arg2,
689 UINTN Arg3,
690 UINTN Arg4
691 )
692{
693 //
694 // This function should never be executed. If it does, then the architectural protocols
695 // have not been designed correctly. The CpuBreakpoint () is commented out for now until the
696 // DXE Core and all the Architectural Protocols are complete.
697 //
698
700}
701
715EFIAPI
717 UINTN Arg1,
718 UINTN Arg2,
719 UINTN Arg3,
720 UINTN Arg4,
721 UINTN Arg5
722 )
723{
724 //
725 // This function should never be executed. If it does, then the architectural protocols
726 // have not been designed correctly. The CpuBreakpoint () is commented out for now until the
727 // DXE Core and all the Architectural Protocols are complete.
728 //
729
731}
732
740VOID
743 )
744{
745 UINT32 Crc;
746
747 Hdr->CRC32 = 0;
748
749 //
750 // If gBS->CalculateCrce32 () == CoreEfiNotAvailableYet () then
751 // Crc will come back as zero if we set it to zero here
752 //
753 Crc = 0;
754 gBS->CalculateCrc32 ((UINT8 *)Hdr, Hdr->HeaderSize, &Crc);
755 Hdr->CRC32 = Crc;
756}
757
769EFIAPI
771 IN EFI_HANDLE ImageHandle,
772 IN UINTN MapKey
773 )
774{
775 EFI_STATUS Status;
776
777 //
778 // Notify other drivers of their last chance to use boot services
779 // before the memory map is terminated.
780 //
781 CoreNotifySignalList (&gEfiEventBeforeExitBootServicesGuid);
782
783 //
784 // Disable Timer
785 //
786 gTimer->SetTimerPeriod (gTimer, 0);
787
788 //
789 // Terminate memory services if the MapKey matches
790 //
791 Status = CoreTerminateMemoryMap (MapKey);
792 if (EFI_ERROR (Status)) {
793 //
794 // Notify other drivers that ExitBootServices fail
795 //
796 CoreNotifySignalList (&gEventExitBootServicesFailedGuid);
797 return Status;
798 }
799
800 gMemoryMapTerminated = TRUE;
801
802 //
803 // Notify other drivers that we are exiting boot services.
804 //
805 CoreNotifySignalList (&gEfiEventExitBootServicesGuid);
806
807 //
808 // Report that ExitBootServices() has been called
809 //
812 (EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_BS_PC_EXIT_BOOT_SERVICES)
813 );
814
816
817 //
818 // Disable interrupt of Debug timer.
819 //
821
822 //
823 // Disable CPU Interrupts
824 //
825 gCpu->DisableInterrupt (gCpu);
826
827 //
828 // Clear the non-runtime values of the EFI System Table
829 //
830 gDxeCoreST->BootServices = NULL;
831 gDxeCoreST->ConIn = NULL;
832 gDxeCoreST->ConsoleInHandle = NULL;
833 gDxeCoreST->ConOut = NULL;
834 gDxeCoreST->ConsoleOutHandle = NULL;
835 gDxeCoreST->StdErr = NULL;
836 gDxeCoreST->StandardErrorHandle = NULL;
837
838 //
839 // Recompute the 32-bit CRC of the EFI System Table
840 //
841 CalculateEfiHdrCrc (&gDxeCoreST->Hdr);
842
843 //
844 // Zero out the Boot Service Table
845 //
846 ZeroMem (gBS, sizeof (EFI_BOOT_SERVICES));
847 gBS = NULL;
848
849 //
850 // Update the AtRuntime field in Runtiem AP.
851 //
852 gRuntime->AtRuntime = TRUE;
853
854 return Status;
855}
856
897EFIAPI
900 IN VOID *Source,
901 IN UINT32 SourceSize,
902 OUT UINT32 *DestinationSize,
903 OUT UINT32 *ScratchSize
904 )
905{
906 if ((Source == NULL) || (DestinationSize == NULL) || (ScratchSize == NULL)) {
907 return EFI_INVALID_PARAMETER;
908 }
909
910 return UefiDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);
911}
912
948EFIAPI
951 IN VOID *Source,
952 IN UINT32 SourceSize,
953 IN OUT VOID *Destination,
954 IN UINT32 DestinationSize,
955 IN OUT VOID *Scratch,
956 IN UINT32 ScratchSize
957 )
958{
959 EFI_STATUS Status;
960 UINT32 TestDestinationSize;
961 UINT32 TestScratchSize;
962
963 if ((Source == NULL) || (Destination == NULL) || (Scratch == NULL)) {
964 return EFI_INVALID_PARAMETER;
965 }
966
967 Status = UefiDecompressGetInfo (Source, SourceSize, &TestDestinationSize, &TestScratchSize);
968 if (EFI_ERROR (Status)) {
969 return Status;
970 }
971
972 if ((ScratchSize < TestScratchSize) || (DestinationSize < TestDestinationSize)) {
974 }
975
976 return UefiDecompress (Source, Destination, Scratch);
977}
UINT64 UINTN
VOID *EFIAPI GetNextGuidHob(IN CONST EFI_GUID *Guid, IN CONST VOID *HobStart)
Definition: HobLib.c:176
VOID EFIAPI CpuDeadLoop(VOID)
Definition: CpuDeadLoop.c:25
#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead)
Definition: BaseLib.h:2904
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)
BOOLEAN EFIAPI SaveAndSetDebugTimerInterrupt(IN BOOLEAN EnableStatus)
VOID EFIAPI InitializeDebugAgent(IN UINT32 InitFlag, IN VOID *Context OPTIONAL, IN DEBUG_AGENT_CONTINUE Function OPTIONAL)
VOID EFIAPI PeCoffLoaderRelocateImageExtraAction(IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext)
EFI_STATUS EFIAPI CoreExitBootServices(IN EFI_HANDLE ImageHandle, IN UINTN MapKey)
Definition: DxeMain.c:770
EFI_TIMER_ARCH_PROTOCOL * gTimer
Definition: DxeMain.c:23
EFI_STATUS EFIAPI CoreEfiNotAvailableYetArg5(UINTN Arg1, UINTN Arg2, UINTN Arg3, UINTN Arg4, UINTN Arg5)
Definition: DxeMain.c:716
EFI_STATUS EFIAPI CoreEfiNotAvailableYetArg1(UINTN Arg1)
Definition: DxeMain.c:608
EFI_STATUS EFIAPI CoreEfiNotAvailableYetArg4(UINTN Arg1, UINTN Arg2, UINTN Arg3, UINTN Arg4)
Definition: DxeMain.c:686
EFI_STATUS EFIAPI DxeMainUefiDecompress(IN EFI_DECOMPRESS_PROTOCOL *This, IN VOID *Source, IN UINT32 SourceSize, IN OUT VOID *Destination, IN UINT32 DestinationSize, IN OUT VOID *Scratch, IN UINT32 ScratchSize)
Definition: DxeMain.c:949
EFI_STATUS EFIAPI DxeMainUefiDecompressGetInfo(IN EFI_DECOMPRESS_PROTOCOL *This, IN VOID *Source, IN UINT32 SourceSize, OUT UINT32 *DestinationSize, OUT UINT32 *ScratchSize)
Definition: DxeMain.c:898
EFI_STATUS EFIAPI CoreEfiNotAvailableYetArg2(UINTN Arg1, UINTN Arg2)
Definition: DxeMain.c:632
VOID EFIAPI DxeMain(IN VOID *HobStart)
Definition: DxeMain.c:233
VOID CalculateEfiHdrCrc(IN OUT EFI_TABLE_HEADER *Hdr)
Definition: DxeMain.c:741
EFI_STATUS EFIAPI CoreEfiNotAvailableYetArg3(UINTN Arg1, UINTN Arg2, UINTN Arg3)
Definition: DxeMain.c:658
EFI_METRONOME_ARCH_PROTOCOL * gMetronome
Definition: DxeMain.c:22
EFI_STATUS EFIAPI CoreFreeIoSpace(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
Definition: Gcd.c:1931
EFI_STATUS EFIAPI FwVolDriverInit(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: FwVol.c:712
EFI_STATUS EFIAPI CoreUninstallProtocolInterface(IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, IN VOID *Interface)
Definition: Handle.c:805
EFI_STATUS EFIAPI CoreGetIoSpaceDescriptor(IN EFI_PHYSICAL_ADDRESS BaseAddress, OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor)
Definition: Gcd.c:1995
EFI_STATUS EFIAPI CoreOpenProtocol(IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, OUT VOID **Interface OPTIONAL, IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ControllerHandle, IN UINT32 Attributes)
Definition: Handle.c:1078
EFI_STATUS CoreInitializeEventServices(VOID)
Definition: Event.c:120
EFI_STATUS EFIAPI CoreAllocatePages(IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN NumberOfPages, IN OUT EFI_PHYSICAL_ADDRESS *Memory)
VOID CoreDisplayMissingArchProtocols(VOID)
EFI_STATUS EFIAPI CoreHandleProtocol(IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, OUT VOID **Interface)
Definition: Handle.c:1040
VOID CoreNewDebugImageInfoEntry(IN UINT32 ImageInfoType, IN EFI_LOADED_IMAGE_PROTOCOL *LoadedImage, IN EFI_HANDLE ImageHandle)
VOID MemoryProtectionExitBootServicesCallback(VOID)
EFI_STATUS CoreInitializeHandleServices(VOID)
Definition: Handle.c:89
EFI_STATUS EFIAPI CoreInstallConfigurationTable(IN EFI_GUID *Guid, IN VOID *Table)
EFI_STATUS EFIAPI CoreDisconnectController(IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE DriverImageHandle OPTIONAL, IN EFI_HANDLE ChildHandle OPTIONAL)
VOID CoreInitializeDebugImageInfoTable(VOID)
EFI_STATUS EFIAPI CoreCheckEvent(IN EFI_EVENT UserEvent)
Definition: Event.c:573
EFI_STATUS EFIAPI CoreSetTimer(IN EFI_EVENT UserEvent, IN EFI_TIMER_DELAY Type, IN UINT64 TriggerTime)
Definition: Timer.c:236
EFI_STATUS EFIAPI CoreGetIoSpaceMap(OUT UINTN *NumberOfDescriptors, OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap)
Definition: Gcd.c:2047
EFI_STATUS EFIAPI CoreFreePages(IN EFI_PHYSICAL_ADDRESS Memory, IN UINTN NumberOfPages)
Definition: Page.c:1737
EFI_STATUS EFIAPI CoreGetMemorySpaceDescriptor(IN EFI_PHYSICAL_ADDRESS BaseAddress, OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor)
Definition: Gcd.c:1617
EFI_STATUS EFIAPI InitializeSectionExtraction(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI CoreLocateProtocol(IN EFI_GUID *Protocol, IN VOID *Registration OPTIONAL, OUT VOID **Interface)
Definition: Locate.c:575
EFI_STATUS EFIAPI CoreAddMemorySpace(IN EFI_GCD_MEMORY_TYPE GcdMemoryType, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Capabilities)
Definition: Gcd.c:1478
VOID EFIAPI CoreInitializeMemoryAttributesTable(VOID)
EFI_STATUS CoreInitializeMemoryServices(IN VOID **HobStart, OUT EFI_PHYSICAL_ADDRESS *MemoryBaseAddress, OUT UINT64 *MemoryLength)
Definition: Gcd.c:2236
EFI_STATUS EFIAPI CoreProtocolsPerHandle(IN EFI_HANDLE UserHandle, OUT EFI_GUID ***ProtocolBuffer, OUT UINTN *ProtocolBufferCount)
Definition: Handle.c:1550
EFI_STATUS EFIAPI CoreFreeMemorySpace(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
Definition: Gcd.c:1551
EFI_STATUS EFIAPI CoreRemoveMemorySpace(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
Definition: Gcd.c:1573
EFI_STATUS EFIAPI CoreReinstallProtocolInterface(IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, IN VOID *OldInterface, IN VOID *NewInterface)
Definition: Notify.c:173
EFI_TPL EFIAPI CoreRaiseTpl(IN EFI_TPL NewTpl)
Definition: Tpl.c:57
EFI_STATUS CoreInitializeGcdServices(IN OUT VOID **HobStart, IN EFI_PHYSICAL_ADDRESS MemoryBaseAddress, IN UINT64 MemoryLength)
Definition: Gcd.c:2574
EFI_STATUS EFIAPI CoreLocateHandleBuffer(IN EFI_LOCATE_SEARCH_TYPE SearchType, IN EFI_GUID *Protocol OPTIONAL, IN VOID *SearchKey OPTIONAL, IN OUT UINTN *NumberHandles, OUT EFI_HANDLE **Buffer)
Definition: Locate.c:667
EFI_STATUS EFIAPI CoreLocateDevicePath(IN EFI_GUID *Protocol, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, OUT EFI_HANDLE *Device)
Definition: Locate.c:448
EFI_STATUS EFIAPI CoreSetMemorySpaceCapabilities(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Capabilities)
Definition: Gcd.c:1711
EFI_STATUS EFIAPI CoreProcessFirmwareVolume(IN VOID *FvHeader, IN UINTN Size, OUT EFI_HANDLE *FVProtocolHandle)
Definition: FwVolBlock.c:676
EFI_STATUS EFIAPI CoreAddIoSpace(IN EFI_GCD_IO_TYPE GcdIoType, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
Definition: Gcd.c:1846
VOID MemoryProfileInstallProtocol(VOID)
EFI_STATUS EFIAPI CoreInstallProtocolInterface(IN OUT EFI_HANDLE *UserHandle, IN EFI_GUID *Protocol, IN EFI_INTERFACE_TYPE InterfaceType, IN VOID *Interface)
Definition: Handle.c:398
EFI_STATUS EFIAPI CoreInstallMultipleProtocolInterfaces(IN OUT EFI_HANDLE *Handle,...)
Definition: Handle.c:630
EFI_STATUS EFIAPI CoreSetMemorySpaceAttributes(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Attributes)
Definition: Gcd.c:1680
EFI_STATUS EFIAPI CoreConnectController(IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE *DriverImageHandle OPTIONAL, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL, IN BOOLEAN Recursive)
Definition: DriverSupport.c:44
EFI_STATUS EFIAPI CoreSignalEvent(IN EFI_EVENT UserEvent)
Definition: Event.c:514
EFI_STATUS EFIAPI CoreGetMemoryMap(IN OUT UINTN *MemoryMapSize, IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap, OUT UINTN *MapKey, OUT UINTN *DescriptorSize, OUT UINT32 *DescriptorVersion)
Definition: Page.c:1881
EFI_STATUS EFIAPI CoreStall(IN UINTN Microseconds)
Definition: Stall.c:49
EFI_STATUS EFIAPI CoreStartImage(IN EFI_HANDLE ImageHandle, OUT UINTN *ExitDataSize, OUT CHAR16 **ExitData OPTIONAL)
Definition: Image.c:1602
VOID CoreNotifySignalList(IN EFI_GUID *EventGroup)
Definition: Event.c:238
EFI_STATUS EFIAPI CoreGetMemorySpaceMap(OUT UINTN *NumberOfDescriptors, OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap)
Definition: Gcd.c:1737
EFI_STATUS EFIAPI CoreExit(IN EFI_HANDLE ImageHandle, IN EFI_STATUS Status, IN UINTN ExitDataSize, IN CHAR16 *ExitData OPTIONAL)
Definition: Image.c:1830
EFI_BDS_ARCH_PROTOCOL * gBds
Definition: DxeMain.c:24
EFI_STATUS EFIAPI CoreCloseProtocol(IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, IN EFI_HANDLE AgentHandle, IN EFI_HANDLE ControllerHandle)
Definition: Handle.c:1345
EFI_STATUS CoreInitializeImageServices(IN VOID *HobStart)
Definition: Image.c:184
EFI_STATUS EFIAPI FwVolBlockDriverInit(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: FwVolBlock.c:613
EFI_STATUS EFIAPI CoreRegisterProtocolNotify(IN EFI_GUID *Protocol, IN EFI_EVENT Event, OUT VOID **Registration)
Definition: Notify.c:99
EFI_STATUS EFIAPI CoreLocateHandle(IN EFI_LOCATE_SEARCH_TYPE SearchType, IN EFI_GUID *Protocol OPTIONAL, IN VOID *SearchKey OPTIONAL, IN OUT UINTN *BufferSize, OUT EFI_HANDLE *Buffer)
Definition: Locate.c:269
VOID MemoryProfileInit(IN VOID *HobStart)
EFI_STATUS EFIAPI CoreSetWatchdogTimer(IN UINTN Timeout, IN UINT64 WatchdogCode, IN UINTN DataSize, IN CHAR16 *WatchdogData OPTIONAL)
VOID EFIAPI CoreInitializeMemoryProtection(VOID)
VOID CoreNotifyOnProtocolInstallation(VOID)
EFI_STATUS EFIAPI CoreCreateEventEx(IN UINT32 Type, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL, IN CONST VOID *NotifyContext OPTIONAL, IN CONST EFI_GUID *EventGroup OPTIONAL, OUT EFI_EVENT *Event)
Definition: Event.c:312
EFI_STATUS EFIAPI CoreCloseEvent(IN EFI_EVENT UserEvent)
Definition: Event.c:700
EFI_STATUS EFIAPI CoreAllocateIoSpace(IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType, IN EFI_GCD_IO_TYPE GcdIoType, IN UINTN Alignment, IN UINT64 Length, IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress, IN EFI_HANDLE ImageHandle, IN EFI_HANDLE DeviceHandle OPTIONAL)
Definition: Gcd.c:1884
EFI_STATUS CoreAllEfiServicesAvailable(VOID)
EFI_STATUS EFIAPI CoreRemoveIoSpace(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
Definition: Gcd.c:1953
EFI_STATUS EFIAPI CoreWaitForEvent(IN UINTN NumberOfEvents, IN EFI_EVENT *UserEvents, OUT UINTN *UserIndex)
Definition: Event.c:642
EFI_STATUS EFIAPI CoreAllocatePool(IN EFI_MEMORY_TYPE PoolType, IN UINTN Size, OUT VOID **Buffer)
Definition: Pool.c:267
EFI_STATUS EFIAPI CoreLoadImage(IN BOOLEAN BootPolicy, IN EFI_HANDLE ParentImageHandle, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN VOID *SourceBuffer OPTIONAL, IN UINTN SourceSize, OUT EFI_HANDLE *ImageHandle)
Definition: Image.c:1541
EFI_STATUS EFIAPI CoreOpenProtocolInformation(IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer, OUT UINTN *EntryCount)
Definition: Handle.c:1436
EFI_STATUS CoreTerminateMemoryMap(IN UINTN MapKey)
Definition: Page.c:2260
EFI_STATUS EFIAPI CoreUninstallMultipleProtocolInterfaces(IN EFI_HANDLE Handle,...)
Definition: Handle.c:931
VOID EFIAPI CoreRestoreTpl(IN EFI_TPL NewTpl)
Definition: Tpl.c:95
EFI_STATUS EFIAPI CoreUnloadImage(IN EFI_HANDLE ImageHandle)
Definition: Image.c:1919
EFI_STATUS EFIAPI CoreCreateEvent(IN UINT32 Type, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL, IN VOID *NotifyContext OPTIONAL, OUT EFI_EVENT *Event)
Definition: Event.c:279
EFI_STATUS EFIAPI CoreAllocateMemorySpace(IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType, IN EFI_GCD_MEMORY_TYPE GcdMemoryType, IN UINTN Alignment, IN UINT64 Length, IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress, IN EFI_HANDLE ImageHandle, IN EFI_HANDLE DeviceHandle OPTIONAL)
Definition: Gcd.c:1429
EFI_STATUS EFIAPI CoreFreePool(IN VOID *Buffer)
Definition: Pool.c:591
VOID *EFIAPI AllocateRuntimeCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
VOID CoreDisplayDiscoveredNotDispatched(VOID)
Definition: Dispatcher.c:1471
EFI_STATUS EFIAPI CoreSchedule(IN EFI_HANDLE FirmwareVolumeHandle, IN EFI_GUID *DriverName)
Definition: Dispatcher.c:301
EFI_STATUS EFIAPI CoreDispatcher(VOID)
Definition: Dispatcher.c:400
EFI_STATUS EFIAPI CoreTrust(IN EFI_HANDLE FirmwareVolumeHandle, IN EFI_GUID *DriverName)
Definition: Dispatcher.c:351
VOID CoreInitializeDispatcher(VOID)
Definition: Dispatcher.c:1444
#define NULL
Definition: Base.h:319
#define UNREACHABLE()
Definition: Base.h:77
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define RETURN_INVALID_PARAMETER
Definition: Base.h:1076
#define GLOBAL_REMOVE_IF_UNREFERENCED
Definition: Base.h:48
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define DEBUG_CODE_BEGIN()
Definition: DebugLib.h:564
#define DEBUG(Expression)
Definition: DebugLib.h:434
#define DEBUG_CODE_END()
Definition: DebugLib.h:578
#define REPORT_STATUS_CODE(Type, Value)
#define PcdGet64(TokenName)
Definition: PcdLib.h:375
#define PcdGetBool(TokenName)
Definition: PcdLib.h:401
RETURN_STATUS EFIAPI PeCoffLoaderImageReadFromMemory(IN VOID *FileHandle, IN UINTN FileOffset, IN OUT UINTN *ReadSize, OUT VOID *Buffer)
Definition: BasePeCoff.c:1992
#define PERF_CROSSMODULE_BEGIN(MeasurementString)
#define PERF_CROSSMODULE_END(MeasurementString)
EFI_STATUS(EFIAPI * EFI_SET_MEMORY_SPACE_CAPABILITIES)(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Capabilities)
Definition: PiDxeCis.h:414
EFI_STATUS(EFIAPI * EFI_SCHEDULE)(IN EFI_HANDLE FirmwareVolumeHandle, IN CONST EFI_GUID *FileName)
Definition: PiDxeCis.h:641
EFI_STATUS(EFIAPI * EFI_FREE_IO_SPACE)(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
Definition: PiDxeCis.h:530
EFI_STATUS(EFIAPI * EFI_GET_MEMORY_SPACE_MAP)(OUT UINTN *NumberOfDescriptors, OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap)
Definition: PiDxeCis.h:437
EFI_STATUS(EFIAPI * EFI_PROCESS_FIRMWARE_VOLUME)(IN CONST VOID *FirmwareVolumeHeader, IN UINTN Size, OUT EFI_HANDLE *FirmwareVolumeHandle)
Definition: PiDxeCis.h:684
EFI_STATUS(EFIAPI * EFI_SET_MEMORY_SPACE_ATTRIBUTES)(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Attributes)
Definition: PiDxeCis.h:389
EFI_STATUS(EFIAPI * EFI_ADD_MEMORY_SPACE)(IN EFI_GCD_MEMORY_TYPE GcdMemoryType, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Capabilities)
Definition: PiDxeCis.h:245
EFI_STATUS(EFIAPI * EFI_REMOVE_IO_SPACE)(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
Definition: PiDxeCis.h:560
EFI_STATUS(EFIAPI * EFI_GET_IO_SPACE_MAP)(OUT UINTN *NumberOfDescriptors, OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap)
Definition: PiDxeCis.h:601
EFI_STATUS(EFIAPI * EFI_DISPATCH)(VOID)
Definition: PiDxeCis.h:624
EFI_STATUS(EFIAPI * EFI_FREE_MEMORY_SPACE)(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
Definition: PiDxeCis.h:314
EFI_STATUS(EFIAPI * EFI_REMOVE_MEMORY_SPACE)(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
Definition: PiDxeCis.h:342
EFI_STATUS(EFIAPI * EFI_ALLOCATE_MEMORY_SPACE)(IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType, IN EFI_GCD_MEMORY_TYPE GcdMemoryType, IN UINTN Alignment, IN UINT64 Length, IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress, IN EFI_HANDLE ImageHandle, IN EFI_HANDLE DeviceHandle OPTIONAL)
Definition: PiDxeCis.h:284
EFI_STATUS(EFIAPI * EFI_TRUST)(IN EFI_HANDLE FirmwareVolumeHandle, IN CONST EFI_GUID *FileName)
Definition: PiDxeCis.h:659
EFI_STATUS(EFIAPI * EFI_ALLOCATE_IO_SPACE)(IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType, IN EFI_GCD_IO_TYPE GcdIoType, IN UINTN Alignment, IN UINT64 Length, IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress, IN EFI_HANDLE ImageHandle, IN EFI_HANDLE DeviceHandle OPTIONAL)
Definition: PiDxeCis.h:500
EFI_STATUS(EFIAPI * EFI_ADD_IO_SPACE)(IN EFI_GCD_IO_TYPE GcdIoType, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
Definition: PiDxeCis.h:468
EFI_STATUS(EFIAPI * EFI_GET_IO_SPACE_DESCRIPTOR)(IN EFI_PHYSICAL_ADDRESS BaseAddress, OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor)
Definition: PiDxeCis.h:579
EFI_STATUS(EFIAPI * EFI_GET_MEMORY_SPACE_DESCRIPTOR)(IN EFI_PHYSICAL_ADDRESS BaseAddress, OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor)
Definition: PiDxeCis.h:361
#define EFI_NOT_AVAILABLE_YET
Definition: PiMultiPhase.h:54
#define EFI_SW_DXE_CORE_PC_ENTRY_POINT
Definition: PiStatusCode.h:777
#define EFI_PROGRESS_CODE
Definition: PiStatusCode.h:43
#define EFI_SW_DXE_CORE_EC_NO_ARCH
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
RETURN_STATUS EFIAPI UefiDecompress(IN CONST VOID *Source, IN OUT VOID *Destination, IN OUT VOID *Scratch OPTIONAL)
RETURN_STATUS EFIAPI UefiDecompressGetInfo(IN CONST VOID *Source, IN UINT32 SourceSize, OUT UINT32 *DestinationSize, OUT UINT32 *ScratchSize)
EFI_STATUS(EFIAPI * EFI_CLOSE_PROTOCOL)(IN EFI_HANDLE Handle, IN EFI_GUID *Protocol, IN EFI_HANDLE AgentHandle, IN EFI_HANDLE ControllerHandle)
Definition: UefiSpec.h:1409
EFI_STATUS(EFIAPI * EFI_OPEN_PROTOCOL_INFORMATION)(IN EFI_HANDLE Handle, IN EFI_GUID *Protocol, OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer, OUT UINTN *EntryCount)
Definition: UefiSpec.h:1443
EFI_STATUS(EFIAPI * EFI_CONNECT_CONTROLLER)(IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE *DriverImageHandle OPTIONAL, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL, IN BOOLEAN Recursive)
Definition: UefiSpec.h:364
EFI_STATUS(EFIAPI * EFI_IMAGE_START)(IN EFI_HANDLE ImageHandle, OUT UINTN *ExitDataSize, OUT CHAR16 **ExitData OPTIONAL)
Definition: UefiSpec.h:965
EFI_STATUS(EFIAPI * EFI_CALCULATE_CRC32)(IN VOID *Data, IN UINTN DataSize, OUT UINT32 *Crc32)
Definition: UefiSpec.h:1148
EFI_STATUS(EFIAPI * EFI_GET_VARIABLE)(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT UINT32 *Attributes OPTIONAL, IN OUT UINTN *DataSize, OUT VOID *Data OPTIONAL)
Definition: UefiSpec.h:696
EFI_STATUS(EFIAPI * EFI_ALLOCATE_POOL)(IN EFI_MEMORY_TYPE PoolType, IN UINTN Size, OUT VOID **Buffer)
Definition: UefiSpec.h:285
EFI_STATUS(EFIAPI * EFI_GET_NEXT_HIGH_MONO_COUNT)(OUT UINT32 *HighCount)
Definition: UefiSpec.h:1127
EFI_STATUS(EFIAPI * EFI_IMAGE_LOAD)(IN BOOLEAN BootPolicy, IN EFI_HANDLE ParentImageHandle, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL, IN VOID *SourceBuffer OPTIONAL, IN UINTN SourceSize, OUT EFI_HANDLE *ImageHandle)
Definition: UefiSpec.h:940
EFI_STATUS(EFIAPI * EFI_LOCATE_DEVICE_PATH)(IN EFI_GUID *Protocol, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, OUT EFI_HANDLE *Device)
Definition: UefiSpec.h:1571
EFI_STATUS(EFIAPI * EFI_IMAGE_UNLOAD)(IN EFI_HANDLE ImageHandle)
Definition: UefiSpec.h:1011
EFI_STATUS(EFIAPI * EFI_EXIT)(IN EFI_HANDLE ImageHandle, IN EFI_STATUS ExitStatus, IN UINTN ExitDataSize, IN CHAR16 *ExitData OPTIONAL)
Definition: UefiSpec.h:993
VOID(EFIAPI * EFI_RESTORE_TPL)(IN EFI_TPL OldTpl)
Definition: UefiSpec.h:662
EFI_STATUS(EFIAPI * EFI_INSTALL_CONFIGURATION_TABLE)(IN EFI_GUID *Guid, IN VOID *Table)
Definition: UefiSpec.h:1592
EFI_STATUS(EFIAPI * EFI_PROTOCOLS_PER_HANDLE)(IN EFI_HANDLE Handle, OUT EFI_GUID ***ProtocolBuffer, OUT UINTN *ProtocolBufferCount)
Definition: UefiSpec.h:1473
EFI_STATUS(EFIAPI * EFI_GET_MEMORY_MAP)(IN OUT UINTN *MemoryMapSize, OUT EFI_MEMORY_DESCRIPTOR *MemoryMap, OUT UINTN *MapKey, OUT UINTN *DescriptorSize, OUT UINT32 *DescriptorVersion)
Definition: UefiSpec.h:256
EFI_STATUS(EFIAPI * EFI_CREATE_EVENT)(IN UINT32 Type, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL, IN VOID *NotifyContext OPTIONAL, OUT EFI_EVENT *Event)
Definition: UefiSpec.h:486
EFI_STATUS(EFIAPI * EFI_SET_TIME)(IN EFI_TIME *Time)
Definition: UefiSpec.h:856
EFI_STATUS(EFIAPI * EFI_DISCONNECT_CONTROLLER)(IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE DriverImageHandle OPTIONAL, IN EFI_HANDLE ChildHandle OPTIONAL)
Definition: UefiSpec.h:397
EFI_STATUS(EFIAPI * EFI_STALL)(IN UINTN Microseconds)
Definition: UefiSpec.h:1043
EFI_STATUS(EFIAPI * EFI_CONVERT_POINTER)(IN UINTN DebugDisposition, IN OUT VOID **Address)
Definition: UefiSpec.h:428
EFI_STATUS(EFIAPI * EFI_CREATE_EVENT_EX)(IN UINT32 Type, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL, IN CONST VOID *NotifyContext OPTIONAL, IN CONST EFI_GUID *EventGroup OPTIONAL, OUT EFI_EVENT *Event)
Definition: UefiSpec.h:515
EFI_STATUS(EFIAPI * EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES)(IN EFI_HANDLE Handle,...)
Definition: UefiSpec.h:1313
EFI_STATUS(EFIAPI * EFI_SET_VARIABLE)(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
Definition: UefiSpec.h:781
EFI_STATUS(EFIAPI * EFI_QUERY_VARIABLE_INFO)(IN UINT32 Attributes, OUT UINT64 *MaximumVariableStorageSize, OUT UINT64 *RemainingVariableStorageSize, OUT UINT64 *MaximumVariableSize)
Definition: UefiSpec.h:1821
EFI_STATUS(EFIAPI * EFI_INSTALL_PROTOCOL_INTERFACE)(IN OUT EFI_HANDLE *Handle, IN EFI_GUID *Protocol, IN EFI_INTERFACE_TYPE InterfaceType, IN VOID *Interface)
Definition: UefiSpec.h:1218
VOID(EFIAPI * EFI_COPY_MEM)(IN VOID *Destination, IN VOID *Source, IN UINTN Length)
Definition: UefiSpec.h:1164
EFI_STATUS(EFIAPI * EFI_LOCATE_PROTOCOL)(IN EFI_GUID *Protocol, IN VOID *Registration OPTIONAL, OUT VOID **Interface)
Definition: UefiSpec.h:1645
EFI_STATUS(EFIAPI * EFI_HANDLE_PROTOCOL)(IN EFI_HANDLE Handle, IN EFI_GUID *Protocol, OUT VOID **Interface)
Definition: UefiSpec.h:1335
EFI_STATUS(EFIAPI * EFI_EXIT_BOOT_SERVICES)(IN EFI_HANDLE ImageHandle, IN UINTN MapKey)
Definition: UefiSpec.h:1027
EFI_STATUS(EFIAPI * EFI_LOCATE_HANDLE)(IN EFI_LOCATE_SEARCH_TYPE SearchType, IN EFI_GUID *Protocol OPTIONAL, IN VOID *SearchKey OPTIONAL, IN OUT UINTN *BufferSize, OUT EFI_HANDLE *Buffer)
Definition: UefiSpec.h:1545
EFI_STATUS(EFIAPI * EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES)(IN OUT EFI_HANDLE *Handle,...)
Definition: UefiSpec.h:1243
EFI_STATUS(EFIAPI * EFI_UPDATE_CAPSULE)(IN EFI_CAPSULE_HEADER **CapsuleHeaderArray, IN UINTN CapsuleCount, IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL)
Definition: UefiSpec.h:1756
EFI_STATUS(EFIAPI * EFI_GET_NEXT_MONOTONIC_COUNT)(OUT UINT64 *Count)
Definition: UefiSpec.h:1108
EFI_TPL(EFIAPI * EFI_RAISE_TPL)(IN EFI_TPL NewTpl)
Definition: UefiSpec.h:650
EFI_STATUS(EFIAPI * EFI_REINSTALL_PROTOCOL_INTERFACE)(IN EFI_HANDLE Handle, IN EFI_GUID *Protocol, IN VOID *OldInterface, IN VOID *NewInterface)
Definition: UefiSpec.h:1268
EFI_STATUS(EFIAPI * EFI_SET_WATCHDOG_TIMER)(IN UINTN Timeout, IN UINT64 WatchdogCode, IN UINTN DataSize, IN CHAR16 *WatchdogData OPTIONAL)
Definition: UefiSpec.h:1065
EFI_STATUS(EFIAPI * EFI_SIGNAL_EVENT)(IN EFI_EVENT Event)
Definition: UefiSpec.h:576
EFI_STATUS(EFIAPI * EFI_WAIT_FOR_EVENT)(IN UINTN NumberOfEvents, IN EFI_EVENT *Event, OUT UINTN *Index)
Definition: UefiSpec.h:596
VOID(EFIAPI * EFI_SET_MEM)(IN VOID *Buffer, IN UINTN Size, IN UINT8 Value)
Definition: UefiSpec.h:1180
EFI_STATUS(EFIAPI * EFI_UNINSTALL_PROTOCOL_INTERFACE)(IN EFI_HANDLE Handle, IN EFI_GUID *Protocol, IN VOID *Interface)
Definition: UefiSpec.h:1294
EFI_STATUS(EFIAPI * EFI_FREE_PAGES)(IN EFI_PHYSICAL_ADDRESS Memory, IN UINTN Pages)
Definition: UefiSpec.h:224
EFI_STATUS(EFIAPI * EFI_CLOSE_EVENT)(IN EFI_EVENT Event)
Definition: UefiSpec.h:612
EFI_STATUS(EFIAPI * EFI_GET_TIME)(OUT EFI_TIME *Time, OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL)
Definition: UefiSpec.h:836
#define EFI_MEMORY_DESCRIPTOR_VERSION
Definition: UefiSpec.h:138
VOID(EFIAPI * EFI_RESET_SYSTEM)(IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus, IN UINTN DataSize, IN VOID *ResetData OPTIONAL)
Definition: UefiSpec.h:1089
EFI_STATUS(EFIAPI * EFI_SET_VIRTUAL_ADDRESS_MAP)(IN UINTN MemoryMapSize, IN UINTN DescriptorSize, IN UINT32 DescriptorVersion, IN EFI_MEMORY_DESCRIPTOR *VirtualMap)
Definition: UefiSpec.h:330
EFI_STATUS(EFIAPI * EFI_SET_WAKEUP_TIME)(IN BOOLEAN Enable, IN EFI_TIME *Time OPTIONAL)
Definition: UefiSpec.h:903
EFI_STATUS(EFIAPI * EFI_ALLOCATE_PAGES)(IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, IN OUT EFI_PHYSICAL_ADDRESS *Memory)
Definition: UefiSpec.h:203
EFI_STATUS(EFIAPI * EFI_FREE_POOL)(IN VOID *Buffer)
Definition: UefiSpec.h:302
EFI_STATUS(EFIAPI * EFI_QUERY_CAPSULE_CAPABILITIES)(IN EFI_CAPSULE_HEADER **CapsuleHeaderArray, IN UINTN CapsuleCount, OUT UINT64 *MaximumCapsuleSize, OUT EFI_RESET_TYPE *ResetType)
Definition: UefiSpec.h:1790
EFI_STATUS(EFIAPI * EFI_CHECK_EVENT)(IN EFI_EVENT Event)
Definition: UefiSpec.h:628
EFI_STATUS(EFIAPI * EFI_LOCATE_HANDLE_BUFFER)(IN EFI_LOCATE_SEARCH_TYPE SearchType, IN EFI_GUID *Protocol OPTIONAL, IN VOID *SearchKey OPTIONAL, OUT UINTN *NoHandles, OUT EFI_HANDLE **Buffer)
Definition: UefiSpec.h:1618
EFI_STATUS(EFIAPI * EFI_GET_WAKEUP_TIME)(OUT BOOLEAN *Enabled, OUT BOOLEAN *Pending, OUT EFI_TIME *Time)
Definition: UefiSpec.h:879
EFI_STATUS(EFIAPI * EFI_GET_NEXT_VARIABLE_NAME)(IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName, IN OUT EFI_GUID *VendorGuid)
Definition: UefiSpec.h:736
EFI_STATUS(EFIAPI * EFI_OPEN_PROTOCOL)(IN EFI_HANDLE Handle, IN EFI_GUID *Protocol, OUT VOID **Interface OPTIONAL, IN EFI_HANDLE AgentHandle, IN EFI_HANDLE ControllerHandle, IN UINT32 Attributes)
Definition: UefiSpec.h:1377
EFI_STATUS(EFIAPI * EFI_SET_TIMER)(IN EFI_EVENT Event, IN EFI_TIMER_DELAY Type, IN UINT64 TriggerTime)
Definition: UefiSpec.h:560
EFI_STATUS(EFIAPI * EFI_REGISTER_PROTOCOL_NOTIFY)(IN EFI_GUID *Protocol, IN EFI_EVENT Event, OUT VOID **Registration)
Definition: UefiSpec.h:1496
EFI_LIST_ENTRY EventHead
A list of type EFI_RUNTIME_EVENT_ENTRY.
Definition: Runtime.h:109
EFI_LIST_ENTRY ImageHead
A list of type EFI_RUNTIME_IMAGE_ENTRY.
Definition: Runtime.h:108
BOOLEAN AtRuntime
Boolean that is TRUE if ExitBootServices () has been called.
Definition: Runtime.h:117
EFI_PHYSICAL_ADDRESS BaseAddress
Definition: PiHob.h:383
UINT32 AuthenticationStatus
Definition: PiHob.h:418
EFI_PHYSICAL_ADDRESS BaseAddress
Definition: PiHob.h:410
EFI_PHYSICAL_ADDRESS BaseAddress
Definition: PiHob.h:364
EFI_PHYSICAL_ADDRESS MemoryBaseAddress
Definition: PiHob.h:119
EFI_MEMORY_TYPE MemoryType
Definition: PiHob.h:131
EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor
Definition: PiHob.h:153
EFI_SYSTEM_TABLE * SystemTable
the image's EFI system table pointer.
Definition: LoadedImage.h:48
VOID * ImageBase
The base address at which the image was loaded.
Definition: LoadedImage.h:67
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * StdErr
Definition: UefiSpec.h:2075
EFI_BOOT_SERVICES * BootServices
Definition: UefiSpec.h:2083
EFI_HANDLE ConsoleInHandle
Definition: UefiSpec.h:2048
EFI_HANDLE ConsoleOutHandle
Definition: UefiSpec.h:2059
EFI_RUNTIME_SERVICES * RuntimeServices
Definition: UefiSpec.h:2079
EFI_HANDLE StandardErrorHandle
Definition: UefiSpec.h:2070
EFI_SIMPLE_TEXT_INPUT_PROTOCOL * ConIn
Definition: UefiSpec.h:2053
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut
Definition: UefiSpec.h:2064
EFI_TABLE_HEADER Hdr
Definition: UefiSpec.h:2032
Definition: Base.h:213
PE_COFF_LOADER_READ_FILE ImageRead
Definition: PeCoffLib.h:100
PHYSICAL_ADDRESS EntryPoint
Definition: PeCoffLib.h:95
PHYSICAL_ADDRESS ImageAddress
Definition: PeCoffLib.h:79