]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / CapsuleRuntimeDxe / CapsuleService.c
index 23fd6d59c59e7d4341c57c78cf5170d990e4d2d3..aaf819c4c615e7f2903b77139120c829055bb8e3 100644 (file)
@@ -1,17 +1,11 @@
 /** @file\r
   Capsule Runtime Driver produces two UEFI capsule runtime services.\r
   (UpdateCapsule, QueryCapsuleCapabilities)\r
-  It installs the Capsule Architectural Protocol defined in PI1.0a to signify \r
+  It installs the Capsule Architectural Protocol defined in PI1.0a to signify\r
   the capsule runtime services are ready.\r
 \r
-Copyright (c) 2006 - 2017, 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
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -54,10 +48,10 @@ UINT32      mMaxSizeNonPopulateCapsule  = 0;
   @retval EFI_INVALID_PARAMETER CapsuleCount is Zero.\r
   @retval EFI_INVALID_PARAMETER For across reset capsule image, ScatterGatherList is NULL.\r
   @retval EFI_UNSUPPORTED       CapsuleImage is not recognized by the firmware.\r
-  @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has been previously called this error indicates the capsule \r
-                                is compatible with this platform but is not capable of being submitted or processed \r
+  @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has been previously called this error indicates the capsule\r
+                                is compatible with this platform but is not capable of being submitted or processed\r
                                 in runtime. The caller may resubmit the capsule prior to ExitBootServices().\r
-  @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has not been previously called then this error indicates \r
+  @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has not been previously called then this error indicates\r
                                 the capsule is compatible with this platform but there are insufficient resources to process.\r
 \r
 **/\r
@@ -75,8 +69,8 @@ UpdateCapsule (
   BOOLEAN                   NeedReset;\r
   BOOLEAN                   InitiateReset;\r
   CHAR16                    CapsuleVarName[30];\r
-  CHAR16                    *TempVarName;  \r
-  \r
+  CHAR16                    *TempVarName;\r
+\r
   //\r
   // Capsule Count can't be less than one.\r
   //\r
@@ -107,7 +101,7 @@ UpdateCapsule (
     }\r
 \r
     //\r
-    // Check FMP capsule flag \r
+    // Check FMP capsule flag\r
     //\r
     if (CompareGuid(&CapsuleHeader->CapsuleGuid, &gEfiFmpCapsuleGuid)\r
      && (CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) != 0 ) {\r
@@ -115,7 +109,7 @@ UpdateCapsule (
     }\r
 \r
     //\r
-    // Check Capsule image without populate flag by firmware support capsule function  \r
+    // Check Capsule image without populate flag by firmware support capsule function\r
     //\r
     if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) {\r
       Status = SupportCapsuleImage (CapsuleHeader);\r
@@ -136,7 +130,7 @@ UpdateCapsule (
     // Platform specific update for the non-reset capsule image.\r
     //\r
     if ((CapsuleHeader->Flags & CAPSULE_FLAGS_PERSIST_ACROSS_RESET) == 0) {\r
-      if (EfiAtRuntime ()) { \r
+      if (EfiAtRuntime ()) {\r
         Status = EFI_OUT_OF_RESOURCES;\r
       } else {\r
         Status = ProcessCapsuleImage(CapsuleHeader);\r
@@ -151,7 +145,7 @@ UpdateCapsule (
       }\r
     }\r
   }\r
-  \r
+\r
   //\r
   // After launching all capsules who has no reset flag, if no more capsules claims\r
   // for a system reset just return.\r
@@ -162,7 +156,7 @@ UpdateCapsule (
 \r
   //\r
   // ScatterGatherList is only referenced if the capsules are defined to persist across\r
-  // system reset. \r
+  // system reset.\r
   //\r
   if (ScatterGatherList == (EFI_PHYSICAL_ADDRESS) (UINTN) NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -195,7 +189,7 @@ UpdateCapsule (
 \r
   //\r
   // ScatterGatherList is only referenced if the capsules are defined to persist across\r
-  // system reset. Set its value into NV storage to let pre-boot driver to pick it up \r
+  // system reset. Set its value into NV storage to let pre-boot driver to pick it up\r
   // after coming through a system reset.\r
   //\r
   Status = EfiSetVariable (\r
@@ -213,7 +207,7 @@ UpdateCapsule (
      if(InitiateReset) {\r
        //\r
        // Firmware that encounters a capsule which has the CAPSULE_FLAGS_INITIATE_RESET Flag set in its header\r
-       // will initiate a reset of the platform which is compatible with the passed-in capsule request and will \r
+       // will initiate a reset of the platform which is compatible with the passed-in capsule request and will\r
        // not return back to the caller.\r
        //\r
        EfiResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);\r
@@ -261,7 +255,7 @@ QueryCapsuleCapabilities (
   if (CapsuleCount < 1) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // Check whether input parameter is valid\r
   //\r
@@ -290,7 +284,7 @@ QueryCapsuleCapabilities (
     }\r
 \r
     //\r
-    // Check FMP capsule flag \r
+    // Check FMP capsule flag\r
     //\r
     if (CompareGuid(&CapsuleHeader->CapsuleGuid, &gEfiFmpCapsuleGuid)\r
      && (CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) != 0 ) {\r
@@ -309,7 +303,7 @@ QueryCapsuleCapabilities (
   }\r
 \r
   //\r
-  // Find out whether there is any capsule defined to persist across system reset. \r
+  // Find out whether there is any capsule defined to persist across system reset.\r
   //\r
   for (ArrayNumber = 0; ArrayNumber < CapsuleCount ; ArrayNumber++) {\r
     CapsuleHeader = CapsuleHeaderArray[ArrayNumber];\r
@@ -344,10 +338,10 @@ QueryCapsuleCapabilities (
 \r
   This code installs UEFI capsule runtime service.\r
 \r
-  @param  ImageHandle    The firmware allocated handle for the EFI image.  \r
+  @param  ImageHandle    The firmware allocated handle for the EFI image.\r
   @param  SystemTable    A pointer to the EFI System Table.\r
 \r
-  @retval EFI_SUCCESS    UEFI Capsule Runtime Services are installed successfully. \r
+  @retval EFI_SUCCESS    UEFI Capsule Runtime Services are installed successfully.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -363,14 +357,14 @@ CapsuleServiceInitialize (
   mMaxSizeNonPopulateCapsule = PcdGet32(PcdMaxSizeNonPopulateCapsule);\r
 \r
   //\r
-  // When PEI phase is IA32, DXE phase is X64, it is possible that capsule data are \r
+  // When PEI phase is IA32, DXE phase is X64, it is possible that capsule data are\r
   // put above 4GB, so capsule PEI will transfer to long mode to get capsule data.\r
   // The page table and stack is used to transfer processor mode from IA32 to long mode.\r
   // Create the base address of page table and stack, and save them into variable.\r
   // This is not needed when capsule with reset type is not supported.\r
   //\r
   SaveLongModeContext ();\r
-    \r
+\r
   //\r
   // Install capsule runtime services into UEFI runtime service tables.\r
   //\r