X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FCore%2FDxe%2FDxeMain%2FDxeMain.c;h=d8c7cd02491cfcd6a715dcbd1ef01a72c4c26a14;hp=1e600a9877e8b468373f16e23501d364ade0219c;hb=e4c83a4f9cad7f2c362727cdeb3f5daf297ec270;hpb=db405d1b8948cdfdd3719e5d94af5eb8a9526e62 diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c index 1e600a9877..d8c7cd0249 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c +++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c @@ -1,8 +1,8 @@ /** @file - DXE Core Main Entry Point -Copyright (c) 2006 - 2008, Intel Corporation -All rights reserved. This program and the accompanying materials + +Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include "DxeMain.h" // // DXE Core Global Variables for Protocols from PEI @@ -23,22 +23,17 @@ EFI_HANDLE mDecompressHandle = NULL; // DXE Core globals for Architecture Protocols // EFI_SECURITY_ARCH_PROTOCOL *gSecurity = NULL; +EFI_SECURITY2_ARCH_PROTOCOL *gSecurity2 = NULL; EFI_CPU_ARCH_PROTOCOL *gCpu = NULL; 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; - // -// BugBug: I'n not runtime, but is the PPI? +// DXE Core globals for optional protocol dependencies // -EFI_STATUS_CODE_PROTOCOL gStatusCodeInstance = { - NULL -}; - -EFI_STATUS_CODE_PROTOCOL *gStatusCode = &gStatusCodeInstance; - +EFI_SMM_BASE2_PROTOCOL *gSmmBase2 = NULL; // // DXE Core Global used to update core loaded image protocol handle @@ -46,12 +41,9 @@ EFI_STATUS_CODE_PROTOCOL *gStatusCode = &gStatusCodeInstance; EFI_GUID *gDxeCoreFileName; EFI_LOADED_IMAGE_PROTOCOL *gDxeCoreLoadedImage; - - // // DXE Core Module Variables // - EFI_BOOT_SERVICES mBootServices = { { EFI_BOOT_SERVICES_SIGNATURE, // Signature @@ -203,7 +195,6 @@ 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 // -EFI_BOOT_SERVICES *gDxeCoreBS = &mBootServices; EFI_DXE_SERVICES *gDxeCoreDS = &mDxeServices; EFI_SYSTEM_TABLE *gDxeCoreST = NULL; @@ -215,7 +206,6 @@ EFI_SYSTEM_TABLE *gDxeCoreST = NULL; EFI_RUNTIME_SERVICES *gDxeCoreRT = &mEfiRuntimeServicesTableTemplate; EFI_HANDLE gDxeCoreImageHandle = NULL; -VOID *mHobStart; // // EFI Decompress Protocol @@ -226,16 +216,20 @@ EFI_DECOMPRESS_PROTOCOL gEfiDecompress = { }; // +// For Loading modules at fixed address feature, the configuration table is to cache the top address below which to load +// Runtime code&boot time code +// +GLOBAL_REMOVE_IF_UNREFERENCED EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE gLoadModuleAtFixAddressConfigurationTable = {0, 0}; + // Main entry point to the DXE Core // /** Main entry point to DXE Core. - @param HobStart Pointer to the beginning of the HOB List from - PEI + @param HobStart Pointer to the beginning of the HOB List from PEI. - @return This function should never return + @return This function should never return. **/ VOID @@ -244,11 +238,30 @@ DxeMain ( IN VOID *HobStart ) { - EFI_STATUS Status; - EFI_PHYSICAL_ADDRESS MemoryBaseAddress; - UINT64 MemoryLength; - - mHobStart = HobStart; + EFI_STATUS Status; + EFI_PHYSICAL_ADDRESS MemoryBaseAddress; + UINT64 MemoryLength; + PE_COFF_LOADER_IMAGE_CONTEXT ImageContext; + UINTN Index; + EFI_HOB_GUID_TYPE *GuidHob; + EFI_VECTOR_HANDOFF_INFO *VectorInfoList; + EFI_VECTOR_HANDOFF_INFO *VectorInfo; + + // + // Setup the default exception handlers + // + VectorInfoList = NULL; + GuidHob = GetNextGuidHob (&gEfiVectorHandoffInfoPpiGuid, HobStart); + if (GuidHob != NULL) { + VectorInfoList = (EFI_VECTOR_HANDOFF_INFO *) (GET_GUID_HOB_DATA(GuidHob)); + } + Status = InitializeCpuExceptionHandlers (VectorInfoList); + ASSERT_EFI_ERROR (Status); + + // + // Initialize Debug Agent to support source level debug in DXE phase + // + InitializeDebugAgent (DEBUG_AGENT_INIT_DXE_CORE, HobStart, NULL); // // Initialize Memory Services @@ -259,10 +272,10 @@ DxeMain ( // Allocate the EFI System Table and EFI Runtime Service Table from EfiRuntimeServicesData // Use the templates to initialize the contents of the EFI System Table and EFI Runtime Services Table // - gDxeCoreST = CoreAllocateRuntimeCopyPool (sizeof (EFI_SYSTEM_TABLE), &mEfiSystemTableTemplate); + gDxeCoreST = AllocateRuntimeCopyPool (sizeof (EFI_SYSTEM_TABLE), &mEfiSystemTableTemplate); ASSERT (gDxeCoreST != NULL); - gDxeCoreRT = CoreAllocateRuntimeCopyPool (sizeof (EFI_RUNTIME_SERVICES), &mEfiRuntimeServicesTableTemplate); + gDxeCoreRT = AllocateRuntimeCopyPool (sizeof (EFI_RUNTIME_SERVICES), &mEfiRuntimeServicesTableTemplate); ASSERT (gDxeCoreRT != NULL); gDxeCoreST->RuntimeServices = gDxeCoreRT; @@ -277,8 +290,15 @@ DxeMain ( // Call constructor for all libraries // ProcessLibraryConstructorList (gDxeCoreImageHandle, gDxeCoreST); - PERF_END (0,PEI_TOK, NULL, 0) ; - PERF_START (0,DXE_TOK, NULL, 0) ; + PERF_END (NULL,"PEI", NULL, 0) ; + PERF_START (NULL,"DXE", NULL, 0) ; + + // + // Report DXE Core image information to the PE/COFF Extra Action Library + // + ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)gDxeCoreLoadedImage->ImageBase; + ImageContext.PdbPointer = PeCoffLoaderGetPdbPointer ((VOID*) (UINTN) ImageContext.ImageAddress); + PeCoffLoaderRelocateImageExtraAction (&ImageContext); // // Initialize the Global Coherency Domain Services @@ -287,10 +307,6 @@ DxeMain ( ASSERT_EFI_ERROR (Status); // - // The HobStart is relocated in gcd service init. Sync mHobStart varible. - // - mHobStart = HobStart; - // Install the DXE Services Table into the EFI System Tables's Configuration Table // Status = CoreInstallConfigurationTable (&gEfiDxeServicesTableGuid, gDxeCoreDS); @@ -309,14 +325,21 @@ DxeMain ( ASSERT_EFI_ERROR (Status); // - // Initialize the ReportStatusCode with PEI version, if available + // If Loading modules At fixed address feature is enabled, install Load moduels at fixed address + // Configuration Table so that user could easily to retrieve the top address to load Dxe and PEI + // Code and Tseg base to load SMM driver. // - CoreGetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **)&gStatusCode->ReportStatusCode); - + if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) { + Status = CoreInstallConfigurationTable (&gLoadFixedAddressConfigurationTableGuid, &gLoadModuleAtFixAddressConfigurationTable); + ASSERT_EFI_ERROR (Status); + } // // Report Status Code here for DXE_ENTRY_POINT once it is available // - CoreReportProgressCode (FixedPcdGet32(PcdStatusCodeValueDxeCoreEntry)); + REPORT_STATUS_CODE ( + EFI_PROGRESS_CODE, + (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_ENTRY_POINT) + ); // // Create the aligned system table pointer structure that is used by external @@ -330,7 +353,27 @@ DxeMain ( gDxeCoreImageHandle ); - DEBUG ((DEBUG_INFO | DEBUG_LOAD, "HOBLIST address in DXE = 0x%016lx\n", (UINT64) (UINTN) HobStart)); + DEBUG ((DEBUG_INFO | DEBUG_LOAD, "HOBLIST address in DXE = 0x%p\n", HobStart)); + + DEBUG_CODE_BEGIN (); + EFI_PEI_HOB_POINTERS Hob; + + for (Hob.Raw = HobStart; !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) { + if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_MEMORY_ALLOCATION) { + DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Memory Allocation 0x%08x 0x%0lx - 0x%0lx\n", \ + Hob.MemoryAllocation->AllocDescriptor.MemoryType, \ + Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress, \ + Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress + Hob.MemoryAllocation->AllocDescriptor.MemoryLength - 1)); + } + } + for (Hob.Raw = HobStart; !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) { + if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV2) { + DEBUG ((DEBUG_INFO | DEBUG_LOAD, "FV2 Hob 0x%0lx - 0x%0lx\n", Hob.FirmwareVolume2->BaseAddress, Hob.FirmwareVolume2->BaseAddress + Hob.FirmwareVolume2->Length - 1)); + } else if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV) { + DEBUG ((DEBUG_INFO | DEBUG_LOAD, "FV Hob 0x%0lx - 0x%0lx\n", Hob.FirmwareVolume->BaseAddress, Hob.FirmwareVolume->BaseAddress + Hob.FirmwareVolume2->Length - 1)); + } + } + DEBUG_CODE_END (); // // Initialize the Event Services @@ -338,6 +381,24 @@ DxeMain ( Status = CoreInitializeEventServices (); ASSERT_EFI_ERROR (Status); + // + // Get persisted vector hand-off info from GUIDeed HOB again due to HobStart may be updated, + // and install configuration table + // + GuidHob = GetNextGuidHob (&gEfiVectorHandoffInfoPpiGuid, HobStart); + if (GuidHob != NULL) { + VectorInfoList = (EFI_VECTOR_HANDOFF_INFO *) (GET_GUID_HOB_DATA(GuidHob)); + VectorInfo = VectorInfoList; + Index = 1; + while (VectorInfo->Attribute != EFI_VECTOR_HANDOFF_LAST_ENTRY) { + VectorInfo ++; + Index ++; + } + VectorInfo = AllocateCopyPool (sizeof (EFI_VECTOR_HANDOFF_INFO) * Index, (VOID *) VectorInfoList); + ASSERT (VectorInfo != NULL); + Status = CoreInstallConfigurationTable (&gEfiVectorHandoffTableGuid, (VOID *) VectorInfo); + ASSERT_EFI_ERROR (Status); + } // // Get the Protocols that were passed in from PEI to DXE through GUIDed HOBs @@ -355,17 +416,18 @@ DxeMain ( // Publish the EFI, Tiano, and Custom Decompress protocols for use by other DXE components // Status = CoreInstallMultipleProtocolInterfaces ( - &mDecompressHandle, - &gEfiDecompressProtocolGuid, &gEfiDecompress, - NULL - ); + &mDecompressHandle, + &gEfiDecompressProtocolGuid, &gEfiDecompress, + NULL + ); ASSERT_EFI_ERROR (Status); // // Register for the GUIDs of the Architectural Protocols, so the rest of the // EFI Boot Services and EFI Runtime Services tables can be filled in. + // Also register for the GUIDs of optional protocols. // - CoreNotifyOnArchProtocolInstallation (); + CoreNotifyOnProtocolInstallation (); // // Produce Firmware Volume Protocols, one for each FV in the HOB list. @@ -385,16 +447,16 @@ DxeMain ( // // Initialize the DXE Dispatcher // - PERF_START (0,"CoreInitializeDispatcher", "DxeMain", 0) ; + PERF_START (NULL,"CoreInitializeDispatcher", "DxeMain", 0) ; CoreInitializeDispatcher (); - PERF_END (0,"CoreInitializeDispatcher", "DxeMain", 0) ; + PERF_END (NULL,"CoreInitializeDispatcher", "DxeMain", 0) ; // // Invoke the DXE Dispatcher // - PERF_START (0, "CoreDispatcher", "DxeMain", 0); + PERF_START (NULL, "CoreDispatcher", "DxeMain", 0); CoreDispatcher (); - PERF_END (0, "CoreDispatcher", "DxeMain", 0); + PERF_END (NULL, "CoreDispatcher", "DxeMain", 0); // // Display Architectural protocols that were not loaded if this is DEBUG build @@ -403,15 +465,6 @@ DxeMain ( CoreDisplayMissingArchProtocols (); DEBUG_CODE_END (); - // - // Assert if the Architectural Protocols are not present. - // - ASSERT_EFI_ERROR (CoreAllEfiServicesAvailable ()); - - // - // Report Status code before transfer control to BDS - // - CoreReportProgressCode (FixedPcdGet32 (PcdStatusCodeValueDxeCoreHandoffToBds)); // // Display any drivers that were not dispatched because dependency expression // evaluated to false if this is a debug build @@ -420,6 +473,29 @@ DxeMain ( CoreDisplayDiscoveredNotDispatched (); DEBUG_CODE_END (); + // + // Assert if the Architectural Protocols are not present. + // + Status = CoreAllEfiServicesAvailable (); + if (EFI_ERROR(Status)) { + // + // Report Status code that some Architectural Protocols are not present. + // + REPORT_STATUS_CODE ( + EFI_ERROR_CODE | EFI_ERROR_MAJOR, + (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_EC_NO_ARCH) + ); + } + ASSERT_EFI_ERROR (Status); + + // + // Report Status code before transfer control to BDS + // + REPORT_STATUS_CODE ( + EFI_PROGRESS_CODE, + (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_HANDOFF_TO_NEXT) + ); + // // Transfer control to the BDS Architectural Protocol // @@ -461,7 +537,7 @@ CoreEfiNotAvailableYetArg0 ( Place holder function until all the Boot Services and Runtime Services are available. - @param Arg1 Undefined + @param Arg1 Undefined @return EFI_NOT_AVAILABLE_YET @@ -485,8 +561,8 @@ CoreEfiNotAvailableYetArg1 ( /** Place holder function until all the Boot Services and Runtime Services are available. - @param Arg1 Undefined - @param Arg2 Undefined + @param Arg1 Undefined + @param Arg2 Undefined @return EFI_NOT_AVAILABLE_YET @@ -511,9 +587,9 @@ CoreEfiNotAvailableYetArg2 ( /** Place holder function until all the Boot Services and Runtime Services are available. - @param Arg1 Undefined - @param Arg2 Undefined - @param Arg3 Undefined + @param Arg1 Undefined + @param Arg2 Undefined + @param Arg3 Undefined @return EFI_NOT_AVAILABLE_YET @@ -539,10 +615,10 @@ CoreEfiNotAvailableYetArg3 ( /** Place holder function until all the Boot Services and Runtime Services are available. - @param Arg1 Undefined - @param Arg2 Undefined - @param Arg3 Undefined - @param Arg4 Undefined + @param Arg1 Undefined + @param Arg2 Undefined + @param Arg3 Undefined + @param Arg4 Undefined @return EFI_NOT_AVAILABLE_YET @@ -569,11 +645,11 @@ CoreEfiNotAvailableYetArg4 ( /** Place holder function until all the Boot Services and Runtime Services are available. - @param Arg1 Undefined - @param Arg2 Undefined - @param Arg3 Undefined - @param Arg4 Undefined - @param Arg5 Undefined + @param Arg1 Undefined + @param Arg2 Undefined + @param Arg3 Undefined + @param Arg4 Undefined + @param Arg5 Undefined @return EFI_NOT_AVAILABLE_YET @@ -598,42 +674,6 @@ CoreEfiNotAvailableYetArg5 ( } - -/** - Searches for a Protocol Interface passed from PEI through a HOB. - - @param ProtocolGuid The Protocol GUID to search for in the HOB List - @param Interface A pointer to the interface for the Protocol GUID - - @retval EFI_SUCCESS The Protocol GUID was found and its interface is - returned in Interface - @retval EFI_NOT_FOUND The Protocol GUID was not found in the HOB List - -**/ -EFI_STATUS -CoreGetPeiProtocol ( - IN EFI_GUID *ProtocolGuid, - IN VOID **Interface - ) -{ - EFI_HOB_GUID_TYPE *GuidHob; - VOID *Buffer; - - GuidHob = GetNextGuidHob (ProtocolGuid, mHobStart); - if (GuidHob == NULL) { - return EFI_NOT_FOUND; - } - - Buffer = GET_GUID_HOB_DATA (GuidHob); - ASSERT (Buffer != NULL); - - *Interface = (VOID *)(*(UINTN *)(Buffer)); - - return EFI_SUCCESS; -} - - - /** Calcualte the 32-bit CRC in a EFI table using the service provided by the gRuntime service. @@ -651,24 +691,22 @@ CalculateEfiHdrCrc ( Hdr->CRC32 = 0; // - // If gDxeCoreBS->CalculateCrce32 () == CoreEfiNotAvailableYet () then + // If gBS->CalculateCrce32 () == CoreEfiNotAvailableYet () then // Crc will come back as zero if we set it to zero here // Crc = 0; - gDxeCoreBS->CalculateCrc32 ((UINT8 *)Hdr, Hdr->HeaderSize, &Crc); + gBS->CalculateCrc32 ((UINT8 *)Hdr, Hdr->HeaderSize, &Crc); Hdr->CRC32 = Crc; } - - /** Terminates all boot services. - @param ImageHandle Handle that identifies the exiting image. + @param ImageHandle Handle that identifies the exiting image. @param MapKey Key to the latest memory map. - @retval EFI_SUCCESS Boot Services terminated + @retval EFI_SUCCESS Boot Services terminated @retval EFI_INVALID_PARAMETER MapKey is incorrect. **/ @@ -679,24 +717,12 @@ CoreExitBootServices ( IN UINTN MapKey ) { - EFI_STATUS Status; - EFI_STATUS StatusTemp; - EFI_TCG_PLATFORM_PROTOCOL *TcgPlatformProtocol; + EFI_STATUS Status; // - // Measure invocation of ExitBootServices, - // which is defined by TCG_EFI_Platform_1_20_Final Specification + // Disable Timer // - TcgPlatformProtocol = NULL; - Status = CoreLocateProtocol ( - &gEfiTcgPlatformProtocolGuid, - NULL, - (VOID **) &TcgPlatformProtocol - ); - if (!EFI_ERROR (Status)) { - Status = TcgPlatformProtocol->MeasureAction (EFI_EXIT_BOOT_SERVICES_INVOCATION); - ASSERT_EFI_ERROR (Status); - } + gTimer->SetTimerPeriod (gTimer, 0); // // Terminate memory services if the MapKey matches @@ -704,13 +730,9 @@ CoreExitBootServices ( Status = CoreTerminateMemoryMap (MapKey); if (EFI_ERROR (Status)) { // - // Measure failure of ExitBootServices + // Notify other drivers that ExitBootServices fail // - if (TcgPlatformProtocol != NULL) { - StatusTemp = TcgPlatformProtocol->MeasureAction (EFI_EXIT_BOOT_SERVICES_FAILED); - ASSERT_EFI_ERROR (StatusTemp); - } - + CoreNotifySignalList (&gEventExitBootServicesFailedGuid); return Status; } @@ -720,21 +742,22 @@ CoreExitBootServices ( CoreNotifySignalList (&gEfiEventExitBootServicesGuid); // - // Disable Timer + // Report that ExitBootServices() has been called // - gTimer->SetTimerPeriod (gTimer, 0); + REPORT_STATUS_CODE ( + EFI_PROGRESS_CODE, + (EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_BS_PC_EXIT_BOOT_SERVICES) + ); // - // Disable CPU Interrupts + // Disable interrupt of Debug timer. // - gCpu->DisableInterrupt (gCpu); + SaveAndSetDebugTimerInterrupt (FALSE); // - // Report that ExitBootServices() has been called - // - // We are using gEfiCallerIdGuid as the caller ID for Dxe Core + // Disable CPU Interrupts // - CoreReportProgressCode (FixedPcdGet32 (PcdStatusCodeValueBootServiceExit)); + gCpu->DisableInterrupt (gCpu); // // Clear the non-runtime values of the EFI System Table @@ -755,22 +778,14 @@ CoreExitBootServices ( // // Zero out the Boot Service Table // - SetMem (gDxeCoreBS, sizeof (EFI_BOOT_SERVICES), 0); - gDxeCoreBS = NULL; + ZeroMem (gBS, sizeof (EFI_BOOT_SERVICES)); + gBS = NULL; // // Update the AtRuntime field in Runtiem AP. // gRuntime->AtRuntime = TRUE; - // - // Measure success of ExitBootServices - // - if (TcgPlatformProtocol != NULL) { - StatusTemp = TcgPlatformProtocol->MeasureAction (EFI_EXIT_BOOT_SERVICES_SUCCEEDED); - ASSERT_EFI_ERROR (StatusTemp); - } - return Status; } @@ -804,7 +819,7 @@ CoreExitBootServices ( buffer that is required to decompress the compressed buffer specified by Source and SourceSize. - + @retval EFI_SUCCESS The size of the uncompressed data was returned in DestinationSize and the size of the scratch buffer was returned in ScratchSize. @@ -824,9 +839,7 @@ DxeMainUefiDecompressGetInfo ( OUT UINT32 *ScratchSize ) { - if (Source == NULL - || DestinationSize == NULL - || ScratchSize == NULL) { + if (Source == NULL || DestinationSize == NULL || ScratchSize == NULL) { return EFI_INVALID_PARAMETER; } return UefiDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize); @@ -859,7 +872,7 @@ DxeMainUefiDecompressGetInfo ( the decompression. @param ScratchSize The size of scratch buffer. The size of the scratch buffer needed is obtained from GetInfo(). - + @retval EFI_SUCCESS Decompression completed successfully, and the uncompressed buffer is returned in Destination. @retval EFI_INVALID_PARAMETER The source buffer specified by Source and @@ -870,7 +883,7 @@ DxeMainUefiDecompressGetInfo ( EFI_STATUS EFIAPI DxeMainUefiDecompress ( - IN EFI_DECOMPRESS_PROTOCOL *This, + IN EFI_DECOMPRESS_PROTOCOL *This, IN VOID *Source, IN UINT32 SourceSize, IN OUT VOID *Destination, @@ -882,13 +895,11 @@ DxeMainUefiDecompress ( EFI_STATUS Status; UINT32 TestDestinationSize; UINT32 TestScratchSize; - - if (Source == NULL - || Destination== NULL - || Scratch == NULL) { + + if (Source == NULL || Destination== NULL || Scratch == NULL) { return EFI_INVALID_PARAMETER; } - + Status = UefiDecompressGetInfo (Source, SourceSize, &TestDestinationSize, &TestScratchSize); if (EFI_ERROR (Status)) { return Status;