]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
revise the debug message to add 0x in front of the HEX number for consistency
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / DxeMain / DxeMain.c
index 3513179b4780de4c9183ef133dbb2692427b2c8e..cd2368e570a758e666bec22bfd584016782b57b7 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   DXE Core Main Entry Point\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include <DxeMain.h>\r
+#include "DxeMain.h"\r
 \r
 //\r
 // DXE Core Global Variables for Protocols from PEI\r
@@ -29,29 +29,15 @@ EFI_TIMER_ARCH_PROTOCOL           *gTimer         = NULL;
 EFI_BDS_ARCH_PROTOCOL             *gBds           = NULL;\r
 EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *gWatchdogTimer = NULL;\r
 \r
-\r
-//\r
-// BugBug: I'n not runtime, but is the PPI?\r
-//\r
-EFI_STATUS_CODE_PROTOCOL     gStatusCodeInstance = {\r
-  NULL\r
-};\r
-\r
-EFI_STATUS_CODE_PROTOCOL     *gStatusCode    = &gStatusCodeInstance;\r
-\r
-\r
 //\r
 // DXE Core Global used to update core loaded image protocol handle\r
 //\r
 EFI_GUID                           *gDxeCoreFileName;\r
 EFI_LOADED_IMAGE_PROTOCOL          *gDxeCoreLoadedImage;\r
 \r
-\r
-\r
 //\r
 // DXE Core Module Variables\r
 //\r
-\r
 EFI_BOOT_SERVICES mBootServices = {\r
   {\r
     EFI_BOOT_SERVICES_SIGNATURE,                                                          // Signature\r
@@ -203,7 +189,6 @@ EFI_RUNTIME_ARCH_PROTOCOL *gRuntime = &gRuntimeTemplate;
 // DXE Core Global Variables for the EFI System Table, Boot Services Table,\r
 // DXE Services Table, and Runtime Services Table\r
 //\r
-EFI_BOOT_SERVICES     *gDxeCoreBS = &mBootServices;\r
 EFI_DXE_SERVICES      *gDxeCoreDS = &mDxeServices;\r
 EFI_SYSTEM_TABLE      *gDxeCoreST = NULL;\r
 \r
@@ -215,7 +200,6 @@ EFI_SYSTEM_TABLE      *gDxeCoreST = NULL;
 EFI_RUNTIME_SERVICES  *gDxeCoreRT = &mEfiRuntimeServicesTableTemplate;\r
 EFI_HANDLE            gDxeCoreImageHandle = NULL;\r
 \r
-VOID  *mHobStart;\r
 \r
 //\r
 // EFI Decompress Protocol\r
@@ -226,16 +210,20 @@ EFI_DECOMPRESS_PROTOCOL  gEfiDecompress = {
 };\r
 \r
 //\r
+// For Loading modules at fixed address feature, the configuration table is to cache the top address below which to load \r
+// Runtime code&boot time code \r
+//\r
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE    gLoadModuleAtFixAddressConfigurationTable = {0, 0};\r
+\r
 // Main entry point to the DXE Core\r
 //\r
 \r
 /**\r
   Main entry point to DXE Core.\r
 \r
-  @param  HobStart               Pointer to the beginning of the HOB List from \r
-                                 PEI \r
+  @param  HobStart               Pointer to the beginning of the HOB List from PEI.\r
 \r
-  @return This function should never return\r
+  @return This function should never return.\r
 \r
 **/\r
 VOID\r
@@ -248,8 +236,6 @@ DxeMain (
   EFI_PHYSICAL_ADDRESS               MemoryBaseAddress;\r
   UINT64                             MemoryLength;\r
 \r
-  mHobStart = HobStart;\r
-\r
   //\r
   // Initialize Memory Services\r
   //\r
@@ -259,10 +245,10 @@ DxeMain (
   // Allocate the EFI System Table and EFI Runtime Service Table from EfiRuntimeServicesData\r
   // Use the templates to initialize the contents of the EFI System Table and EFI Runtime Services Table\r
   //\r
-  gDxeCoreST = CoreAllocateRuntimeCopyPool (sizeof (EFI_SYSTEM_TABLE), &mEfiSystemTableTemplate);\r
+  gDxeCoreST = AllocateRuntimeCopyPool (sizeof (EFI_SYSTEM_TABLE), &mEfiSystemTableTemplate);\r
   ASSERT (gDxeCoreST != NULL);\r
 \r
-  gDxeCoreRT = CoreAllocateRuntimeCopyPool (sizeof (EFI_RUNTIME_SERVICES), &mEfiRuntimeServicesTableTemplate);\r
+  gDxeCoreRT = AllocateRuntimeCopyPool (sizeof (EFI_RUNTIME_SERVICES), &mEfiRuntimeServicesTableTemplate);\r
   ASSERT (gDxeCoreRT != NULL);\r
 \r
   gDxeCoreST->RuntimeServices = gDxeCoreRT;\r
@@ -277,8 +263,8 @@ DxeMain (
   // Call constructor for all libraries\r
   //\r
   ProcessLibraryConstructorList (gDxeCoreImageHandle, gDxeCoreST);\r
-  PERF_END   (0,PEI_TOK, NULL, 0) ;\r
-  PERF_START (0,DXE_TOK, NULL, 0) ;\r
+  PERF_END   (NULL,"PEI", NULL, 0) ;\r
+  PERF_START (NULL,"DXE", NULL, 0) ;\r
 \r
   //\r
   // Initialize the Global Coherency Domain Services\r
@@ -287,10 +273,6 @@ DxeMain (
   ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
-  // The HobStart is relocated in gcd service init. Sync mHobStart varible.\r
-  //\r
-  mHobStart = HobStart;\r
-  \r
   // Install the DXE Services Table into the EFI System Tables's Configuration Table\r
   //\r
   Status = CoreInstallConfigurationTable (&gEfiDxeServicesTableGuid, gDxeCoreDS);\r
@@ -307,16 +289,23 @@ DxeMain (
   //\r
   Status = CoreInstallConfigurationTable (&gEfiMemoryTypeInformationGuid, &gMemoryTypeInformation);\r
   ASSERT_EFI_ERROR (Status);\r
-\r
+  \r
   //\r
-  // Initialize the ReportStatusCode with PEI version, if available\r
+  // If Loading modules At fixed address feature is enabled, install Load moduels at fixed address \r
+  // Configuration Table so that user could easily to retrieve the top address to load Dxe and PEI\r
+  // Code and Tseg base to load SMM driver. \r
   //\r
-  CoreGetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **)&gStatusCode->ReportStatusCode);\r
-\r
+  if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {\r
+    Status = CoreInstallConfigurationTable (&gLoadFixedAddressConfigurationTableGuid, &gLoadModuleAtFixAddressConfigurationTable);\r
+    ASSERT_EFI_ERROR (Status);\r
+  }\r
   //\r
   // Report Status Code here for DXE_ENTRY_POINT once it is available\r
   //\r
-  CoreReportProgressCode (FixedPcdGet32(PcdStatusCodeValueDxeCoreEntry));\r
+  REPORT_STATUS_CODE (\r
+    EFI_PROGRESS_CODE,\r
+    (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_ENTRY_POINT)\r
+    );\r
 \r
   //\r
   // Create the aligned system table pointer structure that is used by external\r
@@ -330,7 +319,27 @@ DxeMain (
     gDxeCoreImageHandle\r
     );\r
 \r
-  DEBUG ((DEBUG_INFO | DEBUG_LOAD, "HOBLIST address in DXE = 0x%016lx\n", (UINT64) (UINTN) HobStart));\r
+  DEBUG ((DEBUG_INFO | DEBUG_LOAD, "HOBLIST address in DXE = 0x%p\n", HobStart));\r
+\r
+  DEBUG_CODE_BEGIN ();\r
+    EFI_PEI_HOB_POINTERS               Hob;\r
+\r
+    for (Hob.Raw = HobStart; !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {\r
+      if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_MEMORY_ALLOCATION) {\r
+        DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Memory Allocation %08x %0lx - %0lx\n", \\r
+          Hob.MemoryAllocation->AllocDescriptor.MemoryType,                      \\r
+          Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress,               \\r
+          Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress + Hob.MemoryAllocation->AllocDescriptor.MemoryLength - 1));\r
+      }\r
+    }\r
+    for (Hob.Raw = HobStart; !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {\r
+      if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV2) {\r
+        DEBUG ((DEBUG_INFO | DEBUG_LOAD, "FV2 Hob           %08x %0lx - %0lx\n", Hob.FirmwareVolume2->BaseAddress, Hob.FirmwareVolume2->BaseAddress + Hob.FirmwareVolume2->Length - 1, Hob.ResourceDescriptor->ResourceType));\r
+      } else if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV) {\r
+        DEBUG ((DEBUG_INFO | DEBUG_LOAD, "FV Hob            %08x %0lx - %0lx\n", Hob.FirmwareVolume->BaseAddress, Hob.FirmwareVolume->BaseAddress + Hob.FirmwareVolume2->Length - 1, Hob.ResourceDescriptor->ResourceType));\r
+      }\r
+    }\r
+  DEBUG_CODE_END ();\r
 \r
   //\r
   // Initialize the Event Services\r
@@ -355,10 +364,10 @@ DxeMain (
   // Publish the EFI, Tiano, and Custom Decompress protocols for use by other DXE components\r
   //\r
   Status = CoreInstallMultipleProtocolInterfaces (\r
-              &mDecompressHandle,\r
-              &gEfiDecompressProtocolGuid,           &gEfiDecompress,\r
-              NULL\r
-              );\r
+             &mDecompressHandle,\r
+             &gEfiDecompressProtocolGuid,           &gEfiDecompress,\r
+             NULL\r
+             );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
@@ -385,16 +394,16 @@ DxeMain (
   //\r
   // Initialize the DXE Dispatcher\r
   //\r
-  PERF_START (0,"CoreInitializeDispatcher", "DxeMain", 0) ;\r
+  PERF_START (NULL,"CoreInitializeDispatcher", "DxeMain", 0) ;\r
   CoreInitializeDispatcher ();\r
-  PERF_END (0,"CoreInitializeDispatcher", "DxeMain", 0) ;\r
+  PERF_END (NULL,"CoreInitializeDispatcher", "DxeMain", 0) ;\r
 \r
   //\r
   // Invoke the DXE Dispatcher\r
   //\r
-  PERF_START (0, "CoreDispatcher", "DxeMain", 0);\r
+  PERF_START (NULL, "CoreDispatcher", "DxeMain", 0);\r
   CoreDispatcher ();\r
-  PERF_END (0, "CoreDispatcher", "DxeMain", 0);\r
+  PERF_END (NULL, "CoreDispatcher", "DxeMain", 0);\r
 \r
   //\r
   // Display Architectural protocols that were not loaded if this is DEBUG build\r
@@ -403,6 +412,14 @@ DxeMain (
     CoreDisplayMissingArchProtocols ();\r
   DEBUG_CODE_END ();\r
 \r
+  //\r
+  // Display any drivers that were not dispatched because dependency expression\r
+  // evaluated to false if this is a debug build\r
+  //\r
+  DEBUG_CODE_BEGIN ();\r
+    CoreDisplayDiscoveredNotDispatched ();\r
+  DEBUG_CODE_END ();\r
+\r
   //\r
   // Assert if the Architectural Protocols are not present.\r
   //\r
@@ -411,14 +428,10 @@ DxeMain (
   //\r
   // Report Status code before transfer control to BDS\r
   //\r
-  CoreReportProgressCode (FixedPcdGet32 (PcdStatusCodeValueDxeCoreHandoffToBds));\r
-  //\r
-  // Display any drivers that were not dispatched because dependency expression\r
-  // evaluated to false if this is a debug build\r
-  //\r
-  DEBUG_CODE_BEGIN ();\r
-    CoreDisplayDiscoveredNotDispatched ();\r
-  DEBUG_CODE_END ();\r
+  REPORT_STATUS_CODE (\r
+    EFI_PROGRESS_CODE,\r
+    (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_HANDOFF_TO_NEXT)\r
+    );\r
 \r
   //\r
   // Transfer control to the BDS Architectural Protocol\r
@@ -461,7 +474,7 @@ CoreEfiNotAvailableYetArg0 (
   Place holder function until all the Boot Services and Runtime Services are\r
   available.\r
 \r
-  @param  Arg1                   Undefined \r
+  @param  Arg1                   Undefined\r
 \r
   @return EFI_NOT_AVAILABLE_YET\r
 \r
@@ -485,8 +498,8 @@ CoreEfiNotAvailableYetArg1 (
 /**\r
   Place holder function until all the Boot Services and Runtime Services are available.\r
 \r
-  @param  Arg1                   Undefined \r
-  @param  Arg2                   Undefined \r
+  @param  Arg1                   Undefined\r
+  @param  Arg2                   Undefined\r
 \r
   @return EFI_NOT_AVAILABLE_YET\r
 \r
@@ -511,9 +524,9 @@ CoreEfiNotAvailableYetArg2 (
 /**\r
   Place holder function until all the Boot Services and Runtime Services are available.\r
 \r
-  @param  Arg1                   Undefined \r
-  @param  Arg2                   Undefined \r
-  @param  Arg3                   Undefined \r
+  @param  Arg1                   Undefined\r
+  @param  Arg2                   Undefined\r
+  @param  Arg3                   Undefined\r
 \r
   @return EFI_NOT_AVAILABLE_YET\r
 \r
@@ -539,10 +552,10 @@ CoreEfiNotAvailableYetArg3 (
 /**\r
   Place holder function until all the Boot Services and Runtime Services are available.\r
 \r
-  @param  Arg1                   Undefined \r
-  @param  Arg2                   Undefined \r
-  @param  Arg3                   Undefined \r
-  @param  Arg4                   Undefined \r
+  @param  Arg1                   Undefined\r
+  @param  Arg2                   Undefined\r
+  @param  Arg3                   Undefined\r
+  @param  Arg4                   Undefined\r
 \r
   @return EFI_NOT_AVAILABLE_YET\r
 \r
@@ -569,11 +582,11 @@ CoreEfiNotAvailableYetArg4 (
 /**\r
   Place holder function until all the Boot Services and Runtime Services are available.\r
 \r
-  @param  Arg1                   Undefined \r
-  @param  Arg2                   Undefined \r
-  @param  Arg3                   Undefined \r
-  @param  Arg4                   Undefined \r
-  @param  Arg5                   Undefined \r
+  @param  Arg1                   Undefined\r
+  @param  Arg2                   Undefined\r
+  @param  Arg3                   Undefined\r
+  @param  Arg4                   Undefined\r
+  @param  Arg5                   Undefined\r
 \r
   @return EFI_NOT_AVAILABLE_YET\r
 \r
@@ -598,42 +611,6 @@ CoreEfiNotAvailableYetArg5 (
 }\r
 \r
 \r
-\r
-/**\r
-  Searches for a Protocol Interface passed from PEI through a HOB.\r
-\r
-  @param  ProtocolGuid           The Protocol GUID to search for in the HOB List \r
-  @param  Interface              A pointer to the interface for the Protocol GUID \r
-\r
-  @retval EFI_SUCCESS            The Protocol GUID was found and its interface is \r
-                                 returned in Interface \r
-  @retval EFI_NOT_FOUND          The Protocol GUID was not found in the HOB List\r
-\r
-**/\r
-EFI_STATUS\r
-CoreGetPeiProtocol (\r
-  IN EFI_GUID  *ProtocolGuid,\r
-  IN VOID      **Interface\r
-  )\r
-{\r
-  EFI_HOB_GUID_TYPE   *GuidHob;\r
-  VOID                *Buffer;\r
-\r
-  GuidHob = GetNextGuidHob (ProtocolGuid, mHobStart);\r
-  if (GuidHob == NULL) {\r
-    return EFI_NOT_FOUND;\r
-  }\r
-\r
-  Buffer = GET_GUID_HOB_DATA (GuidHob);\r
-  ASSERT (Buffer != NULL);\r
-\r
-  *Interface = (VOID *)(*(UINTN *)(Buffer));\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-\r
 /**\r
   Calcualte the 32-bit CRC in a EFI table using the service provided by the\r
   gRuntime service.\r
@@ -651,24 +628,22 @@ CalculateEfiHdrCrc (
   Hdr->CRC32 = 0;\r
 \r
   //\r
-  // If gDxeCoreBS->CalculateCrce32 () == CoreEfiNotAvailableYet () then\r
+  // If gBS->CalculateCrce32 () == CoreEfiNotAvailableYet () then\r
   //  Crc will come back as zero if we set it to zero here\r
   //\r
   Crc = 0;\r
-  gDxeCoreBS->CalculateCrc32 ((UINT8 *)Hdr, Hdr->HeaderSize, &Crc);\r
+  gBS->CalculateCrc32 ((UINT8 *)Hdr, Hdr->HeaderSize, &Crc);\r
   Hdr->CRC32 = Crc;\r
 }\r
 \r
 \r
-\r
-\r
 /**\r
   Terminates all boot services.\r
 \r
-  @param  ImageHandle            Handle that identifies the exiting image. \r
+  @param  ImageHandle            Handle that identifies the exiting image.\r
   @param  MapKey                 Key to the latest memory map.\r
 \r
-  @retval EFI_SUCCESS            Boot Services terminated \r
+  @retval EFI_SUCCESS            Boot Services terminated\r
   @retval EFI_INVALID_PARAMETER  MapKey is incorrect.\r
 \r
 **/\r
@@ -679,50 +654,25 @@ CoreExitBootServices (
   IN UINTN        MapKey\r
   )\r
 {\r
-  EFI_STATUS    Status;\r
-  EFI_STATUS    StatusTemp;\r
-  EFI_TCG_PLATFORM_PROTOCOL *TcgPlatformProtocol;\r
-\r
-  //\r
-  // Measure invocation of ExitBootServices, \r
-  // which is defined by TCG_EFI_Platform_1_20_Final Specification\r
-  //\r
-  TcgPlatformProtocol = NULL;\r
-  Status = CoreLocateProtocol (\r
-             &gEfiTcgPlatformProtocolGuid,\r
-             NULL,\r
-             (VOID **) &TcgPlatformProtocol\r
-             );\r
-  if (!EFI_ERROR (Status)) {\r
-    Status = TcgPlatformProtocol->MeasureAction (EFI_EXIT_BOOT_SERVICES_INVOCATION);\r
-    ASSERT_EFI_ERROR (Status);\r
-  }\r
+  EFI_STATUS                Status;\r
 \r
   //\r
   // Terminate memory services if the MapKey matches\r
   //\r
   Status = CoreTerminateMemoryMap (MapKey);\r
   if (EFI_ERROR (Status)) {\r
-    //\r
-    // Measure failure of ExitBootServices\r
-    //\r
-    if (TcgPlatformProtocol != NULL) {\r
-      StatusTemp = TcgPlatformProtocol->MeasureAction (EFI_EXIT_BOOT_SERVICES_FAILED);\r
-      ASSERT_EFI_ERROR (StatusTemp);\r
-    }\r
-\r
     return Status;\r
   }\r
 \r
   //\r
-  // Notify other drivers that we are exiting boot services.\r
+  // Disable Timer\r
   //\r
-  CoreNotifySignalList (&gEfiEventExitBootServicesGuid);\r
+  gTimer->SetTimerPeriod (gTimer, 0);\r
 \r
   //\r
-  // Disable Timer\r
+  // Notify other drivers that we are exiting boot services.\r
   //\r
-  gTimer->SetTimerPeriod (gTimer, 0);\r
+  CoreNotifySignalList (&gEfiEventExitBootServicesGuid);\r
 \r
   //\r
   // Disable CPU Interrupts\r
@@ -732,9 +682,10 @@ CoreExitBootServices (
   //\r
   // Report that ExitBootServices() has been called\r
   //\r
-  // We are using gEfiCallerIdGuid as the caller ID for Dxe Core\r
-  //\r
-  CoreReportProgressCode (FixedPcdGet32 (PcdStatusCodeValueBootServiceExit));\r
+  REPORT_STATUS_CODE (\r
+    EFI_PROGRESS_CODE,\r
+    (EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_BS_PC_EXIT_BOOT_SERVICES)\r
+    );\r
 \r
   //\r
   // Clear the non-runtime values of the EFI System Table\r
@@ -755,22 +706,14 @@ CoreExitBootServices (
   //\r
   // Zero out the Boot Service Table\r
   //\r
-  SetMem (gDxeCoreBS, sizeof (EFI_BOOT_SERVICES), 0);\r
-  gDxeCoreBS = NULL;\r
+  ZeroMem (gBS, sizeof (EFI_BOOT_SERVICES));\r
+  gBS = NULL;\r
 \r
   //\r
   // Update the AtRuntime field in Runtiem AP.\r
   //\r
   gRuntime->AtRuntime = TRUE;\r
 \r
-  //\r
-  // Measure success of ExitBootServices\r
-  //\r
-  if (TcgPlatformProtocol != NULL) {\r
-    StatusTemp = TcgPlatformProtocol->MeasureAction (EFI_EXIT_BOOT_SERVICES_SUCCEEDED);\r
-    ASSERT_EFI_ERROR (StatusTemp);\r
-  }\r
\r
   return Status;\r
 }\r
 \r
@@ -804,7 +747,7 @@ CoreExitBootServices (
                              buffer that is required to decompress the\r
                              compressed buffer specified by Source and\r
                              SourceSize.\r
-   \r
+\r
   @retval EFI_SUCCESS        The size of the uncompressed data was returned in\r
                              DestinationSize and the size of the scratch buffer\r
                              was returned in ScratchSize.\r
@@ -824,9 +767,7 @@ DxeMainUefiDecompressGetInfo (
   OUT  UINT32                           *ScratchSize\r
   )\r
 {\r
-  if (Source == NULL \r
-        || DestinationSize == NULL \r
-        || ScratchSize == NULL) {\r
+  if (Source == NULL || DestinationSize == NULL || ScratchSize == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   return UefiDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);\r
@@ -859,7 +800,7 @@ DxeMainUefiDecompressGetInfo (
                               the decompression.\r
   @param  ScratchSize         The size of scratch buffer. The size of the\r
                               scratch buffer needed is obtained from GetInfo().\r
-  \r
+\r
   @retval EFI_SUCCESS         Decompression completed successfully, and the\r
                               uncompressed buffer is returned in Destination.\r
   @retval EFI_INVALID_PARAMETER  The source buffer specified by Source and\r
@@ -870,7 +811,7 @@ DxeMainUefiDecompressGetInfo (
 EFI_STATUS\r
 EFIAPI\r
 DxeMainUefiDecompress (\r
-  IN EFI_DECOMPRESS_PROTOCOL              *This,\r
+  IN     EFI_DECOMPRESS_PROTOCOL          *This,\r
   IN     VOID                             *Source,\r
   IN     UINT32                           SourceSize,\r
   IN OUT VOID                             *Destination,\r
@@ -882,13 +823,11 @@ DxeMainUefiDecompress (
   EFI_STATUS  Status;\r
   UINT32      TestDestinationSize;\r
   UINT32      TestScratchSize;\r
-  \r
-  if (Source == NULL \r
-        || Destination== NULL \r
-        || Scratch == NULL) {\r
+\r
+  if (Source == NULL || Destination== NULL || Scratch == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   Status = UefiDecompressGetInfo (Source, SourceSize, &TestDestinationSize, &TestScratchSize);\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r