X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EdkModulePkg%2FCore%2FDxe%2FDxeMain%2FDxeMain.c;h=9252d85ebf40842db9f12f730ec30b092acb9b6c;hp=9b8402b5619511b302493399386d8ae03d8c7dfa;hb=84e73ac219356983b29e3866017189a36c82b323;hpb=36122070ec3bde97d90ad1c4773a24ae6507c9cb diff --git a/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c b/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c index 9b8402b561..9252d85ebf 100644 --- a/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c +++ b/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c @@ -21,127 +21,6 @@ Abstract: #include -VOID -EFIAPI -DxeMain ( - IN VOID *HobStart - ); - -EFI_STATUS -EFIAPI -CoreEfiNotAvailableYetArg0 ( - VOID - ); - -EFI_STATUS -EFIAPI -CoreEfiNotAvailableYetArg1 ( - UINTN Arg1 - ); - -EFI_STATUS -EFIAPI -CoreEfiNotAvailableYetArg2 ( - UINTN Arg1, - UINTN Arg2 - ); - -EFI_STATUS -EFIAPI -CoreEfiNotAvailableYetArg3 ( - UINTN Arg1, - UINTN Arg2, - UINTN Arg3 - ); - -EFI_STATUS -EFIAPI -CoreEfiNotAvailableYetArg4 ( - UINTN Arg1, - UINTN Arg2, - UINTN Arg3, - UINTN Arg4 - ); - -EFI_STATUS -EFIAPI -CoreEfiNotAvailableYetArg5 ( - UINTN Arg1, - UINTN Arg2, - UINTN Arg3, - UINTN Arg4, - UINTN Arg5 - ); - -EFI_STATUS -CoreGetPeiProtocol ( - IN EFI_GUID *ProtocolGuid, - IN VOID **Interface - ); - -EFI_STATUS -DxeMainUefiDecompressGetInfo ( - IN EFI_DECOMPRESS_PROTOCOL *This, - IN VOID *Source, - IN UINT32 SourceSize, - OUT UINT32 *DestinationSize, - OUT UINT32 *ScratchSize - ); - -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 - ); - -EFI_STATUS -DxeMainTianoDecompressGetInfo ( - IN EFI_TIANO_DECOMPRESS_PROTOCOL *This, - IN VOID *Source, - IN UINT32 SourceSize, - OUT UINT32 *DestinationSize, - OUT UINT32 *ScratchSize - ); - -EFI_STATUS -EFIAPI -DxeMainTianoDecompress ( - IN EFI_TIANO_DECOMPRESS_PROTOCOL *This, - IN VOID *Source, - IN UINT32 SourceSize, - IN OUT VOID *Destination, - IN UINT32 DestinationSize, - IN OUT VOID *Scratch, - IN UINT32 ScratchSize - ); - -EFI_STATUS -DxeMainCustomDecompressGetInfo ( - IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *This, - IN VOID *Source, - IN UINT32 SourceSize, - OUT UINT32 *DestinationSize, - OUT UINT32 *ScratchSize - ); - -EFI_STATUS -EFIAPI -DxeMainCustomDecompress ( - IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *This, - IN VOID *Source, - IN UINT32 SourceSize, - IN OUT VOID *Destination, - IN UINT32 DestinationSize, - IN OUT VOID *Scratch, - IN UINT32 ScratchSize - ); - // // DXE Core Global Variables for Protocols from PEI // @@ -157,7 +36,7 @@ EFI_METRONOME_ARCH_PROTOCOL *gMetronome = NULL; EFI_TIMER_ARCH_PROTOCOL *gTimer = NULL; EFI_BDS_ARCH_PROTOCOL *gBds = NULL; EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *gWatchdogTimer = NULL; -EFI_RUNTIME_ARCH_PROTOCOL *gRuntime = NULL; + // // BugBug: I'n not runtime, but is the PPI? @@ -307,9 +186,16 @@ EFI_RUNTIME_SERVICES mEfiRuntimeServicesTableTemplate = { (EFI_GET_NEXT_HIGH_MONO_COUNT) CoreEfiNotAvailableYetArg1, // GetNextHighMonotonicCount (EFI_RESET_SYSTEM) CoreEfiNotAvailableYetArg4 // ResetSystem #if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000)) + // + // This Tiano extension was removed when UEFI 2.0 support was added. + // It's now just a protocol. + // , (EFI_REPORT_STATUS_CODE) CoreEfiNotAvailableYetArg5 // ReportStatusCode #elif (EFI_SPECIFICATION_VERSION >= 0x00020000) + // + // New runtime services added by UEFI 2.0 + // , (EFI_UPDATE_CAPSULE) CoreEfiNotAvailableYetArg3, // UpdateCapsule (EFI_QUERY_CAPSULE_CAPABILITIES) CoreEfiNotAvailableYetArg4, // QueryCapsuleCapabilities @@ -317,6 +203,26 @@ EFI_RUNTIME_SERVICES mEfiRuntimeServicesTableTemplate = { #endif }; +EFI_RUNTIME_ARCH_PROTOCOL gRuntimeTemplate = { + INITIALIZE_LIST_HEAD_VARIABLE (gRuntimeTemplate.ImageHead), + INITIALIZE_LIST_HEAD_VARIABLE (gRuntimeTemplate.EventHead), + + // + // Make sure Size != sizeof (EFI_MEMORY_DESCRIPTOR). This will + // prevent people from having pointer math bugs in their code. + // now you have to use *DescriptorSize to make things work. + // + sizeof (EFI_MEMORY_DESCRIPTOR) + sizeof (UINT64) - (sizeof (EFI_MEMORY_DESCRIPTOR) % sizeof (UINT64)), + EFI_MEMORY_DESCRIPTOR_VERSION, + 0, + NULL, + NULL, + FALSE, + FALSE +}; + +EFI_RUNTIME_ARCH_PROTOCOL *gRuntime = &gRuntimeTemplate; + // // DXE Core Global Variables for the EFI System Table, Boot Services Table, // DXE Services Table, and Runtime Services Table @@ -387,12 +293,6 @@ Returns: EFI_PHYSICAL_ADDRESS MemoryBaseAddress; UINT64 MemoryLength; -#ifdef EFI_DXE_PERFORMANCE - UINT64 Tick; - - GetTimerValue (&Tick); -#endif - mHobStart = HobStart; // @@ -422,6 +322,8 @@ Returns: // Call constructor for all libraries // ProcessLibraryConstructorList (gDxeCoreImageHandle, gST); + PERF_END (0,PEI_TOK, NULL, 0) ; + PERF_START (0,DXE_TOK, NULL, 0) ; // // Initialize the Global Coherency Domain Services @@ -448,10 +350,14 @@ Returns: ASSERT_EFI_ERROR (Status); // - // Initialize the ReportStatusCode with PEI version, if availible + // Initialize the ReportStatusCode with PEI version, if available // CoreGetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **)&gStatusCode->ReportStatusCode); #if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000)) + // + // This Tiano extension was removed when UEFI 2.0 support was added. + // It's now just a protocol. + // gRT->ReportStatusCode = gStatusCode->ReportStatusCode; #endif @@ -546,9 +452,9 @@ Returns: // // Display Architectural protocols that were not loaded if this is DEBUG build // - DEBUG_CODE ( + DEBUG_CODE_BEGIN (); CoreDisplayMissingArchProtocols (); - ); + DEBUG_CODE_END (); // // Assert if the Architectural Protocols are not present. @@ -563,9 +469,9 @@ Returns: // Display any drivers that were not dispatched because dependency expression // evaluated to false if this is a debug build // - DEBUG_CODE ( + DEBUG_CODE_BEGIN (); CoreDisplayDiscoveredNotDispatched (); - ); + DEBUG_CODE_END (); // // Transfer control to the BDS Architectural Protocol @@ -879,11 +785,11 @@ CoreExitBootServices ( Routine Description: - EFI 1.0 API to terminate Boot Services + Terminates all boot services. Arguments: - ImageHandle - Handle that represents the identity of the calling image + ImageHandle - Handle that identifies the exiting image. MapKey -Key to the latest memory map. @@ -919,16 +825,6 @@ Returns: // gCpu->DisableInterrupt (gCpu); - // - // Register Runtime events with the Runtime Architectural Protocol - // - CoreShutdownEventServices (); - - // - // Register Runtime images with the Runtime Architectural Protocol - // - CoreShutdownImageServices (); - // // Report that ExitBootServices() has been called // @@ -957,7 +853,12 @@ Returns: // SetMem (gBS, sizeof (EFI_BOOT_SERVICES), 0); gBS = NULL; - + + // + // Update the AtRuntime field in Runtiem AP. + // + gRuntime->AtRuntime = TRUE; + return Status; }