X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EdkModulePkg%2FCore%2FDxe%2FDxeMain%2FDxeMain.c;h=b590538feaefc04d03c758070b9b9ce72a28e39c;hp=5e5b95af38bb9e3085cc6dfc665f8950f5190b6b;hb=92dda53e9fe6568c9204ffd97f146710bdde3369;hpb=217f1d11c3767575a5c26f89cedb765caaeecc4f diff --git a/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c b/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c index 5e5b95af38..b590538fea 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? @@ -324,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 @@ -886,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. @@ -926,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 // @@ -964,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; }