]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFspPkg/FspDxeIpl/DxeIpl.c
Omap35xxPkg/InterruptDxe: replace CPU Arch Protocol depex with notify
[mirror_edk2.git] / IntelFspPkg / FspDxeIpl / DxeIpl.c
index 24e6ef75cd0b8f95849a8f300381f72894fa56f6..9ccd3ca94b127a6a4fe83de659149a3efda758ea 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
   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
@@ -301,67 +301,58 @@ Decompress (
   //\r
   switch (CompressionType) {\r
   case EFI_STANDARD_COMPRESSION:\r
-    if (TRUE) {\r
-      //\r
-      // Load EFI standard compression.\r
-      // For compressed data, decompress them to destination buffer.\r
-      //\r
-      Status = UefiDecompressGetInfo (\r
-                 CompressionSource,\r
-                 CompressionSourceSize,\r
-                 &DstBufferSize,\r
-                 &ScratchBufferSize\r
-                 );\r
-      if (EFI_ERROR (Status)) {\r
-        //\r
-        // GetInfo failed\r
-        //\r
-        DEBUG ((DEBUG_ERROR, "Decompress GetInfo Failed - %r\n", Status));\r
-        return EFI_NOT_FOUND;\r
-      }\r
-      //\r
-      // Allocate scratch buffer\r
-      //\r
-      ScratchBuffer = AllocatePages (EFI_SIZE_TO_PAGES (ScratchBufferSize));\r
-      if (ScratchBuffer == NULL) {\r
-        return EFI_OUT_OF_RESOURCES;\r
-      }\r
-      //\r
-      // Allocate destination buffer, extra one page for adjustment\r
-      //\r
-      DstBuffer = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize) + 1);\r
-      if (DstBuffer == NULL) {\r
-        return EFI_OUT_OF_RESOURCES;\r
-      }\r
-      //\r
-      // DstBuffer still is one section. Adjust DstBuffer offset, skip EFI section header\r
-      // to make section data at page alignment.\r
-      //\r
-      DstBuffer = DstBuffer + EFI_PAGE_SIZE - sizeof (EFI_COMMON_SECTION_HEADER);\r
+    //\r
+    // Load EFI standard compression.\r
+    // For compressed data, decompress them to destination buffer.\r
+    //\r
+    Status = UefiDecompressGetInfo (\r
+               CompressionSource,\r
+               CompressionSourceSize,\r
+               &DstBufferSize,\r
+               &ScratchBufferSize\r
+               );\r
+    if (EFI_ERROR (Status)) {\r
       //\r
-      // Call decompress function\r
+      // GetInfo failed\r
       //\r
-      Status = UefiDecompress (\r
-                  CompressionSource,\r
-                  DstBuffer,\r
-                  ScratchBuffer\r
-                  );\r
-      if (EFI_ERROR (Status)) {\r
-        //\r
-        // Decompress failed\r
-        //\r
-        DEBUG ((DEBUG_ERROR, "Decompress Failed - %r\n", Status));\r
-        return EFI_NOT_FOUND;\r
-      }\r
-      break;\r
-    } else {\r
+      DEBUG ((DEBUG_ERROR, "Decompress GetInfo Failed - %r\n", Status));\r
+      return EFI_NOT_FOUND;\r
+    }\r
+    //\r
+    // Allocate scratch buffer\r
+    //\r
+    ScratchBuffer = AllocatePages (EFI_SIZE_TO_PAGES (ScratchBufferSize));\r
+    if (ScratchBuffer == NULL) {\r
+      return EFI_OUT_OF_RESOURCES;\r
+    }\r
+    //\r
+    // Allocate destination buffer, extra one page for adjustment\r
+    //\r
+    DstBuffer = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize) + 1);\r
+    if (DstBuffer == NULL) {\r
+      return EFI_OUT_OF_RESOURCES;\r
+    }\r
+    //\r
+    // DstBuffer still is one section. Adjust DstBuffer offset, skip EFI section header\r
+    // to make section data at page alignment.\r
+    //\r
+    DstBuffer = DstBuffer + EFI_PAGE_SIZE - sizeof (EFI_COMMON_SECTION_HEADER);\r
+    //\r
+    // Call decompress function\r
+    //\r
+    Status = UefiDecompress (\r
+                CompressionSource,\r
+                DstBuffer,\r
+                ScratchBuffer\r
+                );\r
+    if (EFI_ERROR (Status)) {\r
       //\r
-      // PcdDxeIplSupportUefiDecompress is FALSE\r
-      // Don't support UEFI decompression algorithm.\r
+      // Decompress failed\r
       //\r
-      ASSERT (FALSE);\r
+      DEBUG ((DEBUG_ERROR, "Decompress Failed - %r\n", Status));\r
       return EFI_NOT_FOUND;\r
     }\r
+    break;\r
 \r
   case EFI_NOT_COMPRESSED:\r
     //\r
@@ -424,21 +415,22 @@ DxeLoadCore (
   DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP HOB is located at 0x%08X\n", HobList));\r
 \r
   //\r
-  // Give control back to bootloader after FspInit\r
+  // End of PEI phase signal\r
+  //\r
+  Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // Give control back to BootLoader after FspInit\r
   //\r
   DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP is waiting for NOTIFY\n"));\r
   FspInitDone ();\r
 \r
   //\r
-  // Bootloader called FSP again through NotifyPhase\r
+  // BootLoader called FSP again through NotifyPhase\r
   //\r
   FspWaitForNotify ();\r
 \r
-  //\r
-  // End of PEI phase signal\r
-  //\r
-  Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);\r
-  ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
   // Give control back to the boot loader framework caller\r