]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Library / BootMaintenanceManagerUiLib / BootMaintenance.c
index fdcb56a9df2b5d7012767eef22c980f12d6d31dc..2167d3a5e8344b2d4f7bfada946c2523af143d2e 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
 The functions for Boot Maintainence Main menu.\r
 \r
-Copyright (c) 2004 - 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) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -61,7 +55,7 @@ HII_VENDOR_DEVICE_PATH  mBmmHiiVendorDevicePath = {
   {\r
     END_DEVICE_PATH_TYPE,\r
     END_ENTIRE_DEVICE_PATH_SUBTYPE,\r
-    { \r
+    {\r
       (UINT8) (END_DEVICE_PATH_LENGTH),\r
       (UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)\r
     }\r
@@ -118,9 +112,9 @@ CustomizeMenus (
 \r
 /**\r
   This function will change video resolution and text mode\r
-  according to defined setup mode or defined boot mode  \r
+  according to defined setup mode or defined boot mode\r
 \r
-  @param  IsSetupMode   Indicate mode is changed to setup mode or boot mode. \r
+  @param  IsSetupMode   Indicate mode is changed to setup mode or boot mode.\r
 \r
   @retval  EFI_SUCCESS  Mode is changed successfully.\r
   @retval  Others       Mode failed to be changed.\r
@@ -147,13 +141,13 @@ BmmSetConsoleMode (
   EFI_STATUS                            Status;\r
   UINTN                                 Index;\r
   UINTN                                 CurrentColumn;\r
-  UINTN                                 CurrentRow;  \r
+  UINTN                                 CurrentRow;\r
 \r
   MaxGopMode  = 0;\r
   MaxTextMode = 0;\r
 \r
   //\r
-  // Get current video resolution and text mode \r
+  // Get current video resolution and text mode\r
   //\r
   Status = gBS->HandleProtocol (\r
                   gST->ConsoleOutHandle,\r
@@ -171,7 +165,7 @@ BmmSetConsoleMode (
                   );\r
   if (EFI_ERROR (Status)) {\r
     SimpleTextOut = NULL;\r
-  }  \r
+  }\r
 \r
   if ((GraphicsOutput == NULL) || (SimpleTextOut == NULL)) {\r
     return EFI_UNSUPPORTED;\r
@@ -192,12 +186,12 @@ BmmSetConsoleMode (
     NewHorizontalResolution = mBmmBootHorizontalResolution;\r
     NewVerticalResolution   = mBmmBootVerticalResolution;\r
     NewColumns              = mBmmBootTextModeColumn;\r
-    NewRows                 = mBmmBootTextModeRow;   \r
+    NewRows                 = mBmmBootTextModeRow;\r
   }\r
 \r
   if (GraphicsOutput != NULL) {\r
     MaxGopMode  = GraphicsOutput->Mode->MaxMode;\r
-  } \r
+  }\r
 \r
   if (SimpleTextOut != NULL) {\r
     MaxTextMode = SimpleTextOut->Mode->MaxMode;\r
@@ -743,7 +737,7 @@ BootMaintExtractConfig (
 \r
   @param[in]  This                Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
   @param[in]  Configuration       A null-terminated Unicode string in\r
-                                  <ConfigString> format.   \r
+                                  <ConfigString> format.\r
   @param[out] Progress            A pointer to a string filled in with the\r
                                   offset of the most recent '&' before the\r
                                   first failing name / value pair (or the\r
@@ -753,7 +747,7 @@ BootMaintExtractConfig (
                                   successful.\r
 \r
   @retval EFI_SUCCESS             The results have been distributed or are\r
-                                  awaiting distribution.  \r
+                                  awaiting distribution.\r
   @retval EFI_OUT_OF_RESOURCES    Not enough memory to store the\r
                                   parts of the results that must be\r
                                   stored awaiting possible future\r
@@ -802,15 +796,15 @@ BootMaintRouteConfig (
   }\r
 \r
   Status = gBS->LocateProtocol (\r
-                  &gEfiHiiConfigRoutingProtocolGuid, \r
-                  NULL, \r
+                  &gEfiHiiConfigRoutingProtocolGuid,\r
+                  NULL,\r
                   (VOID **)&ConfigRouting\r
                   );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
 \r
-  Private = BMM_CALLBACK_DATA_FROM_THIS (This);  \r
+  Private = BMM_CALLBACK_DATA_FROM_THIS (This);\r
   //\r
   // Get Buffer Storage data from EFI variable\r
   //\r
@@ -828,15 +822,15 @@ BootMaintRouteConfig (
                             &BufferSize,\r
                             Progress\r
                             );\r
-  ASSERT_EFI_ERROR (Status);    \r
+  ASSERT_EFI_ERROR (Status);\r
   //\r
-  // Compare new and old BMM configuration data and only do action for modified item to \r
+  // Compare new and old BMM configuration data and only do action for modified item to\r
   // avoid setting unnecessary non-volatile variable\r
   //\r
 \r
   //\r
   // Check data which located in BMM main page and save the settings if need\r
-  //         \r
+  //\r
   if (CompareMem (&NewBmmData->BootNext, &OldBmmData->BootNext, sizeof (NewBmmData->BootNext)) != 0) {\r
     Status = Var_UpdateBootNext (Private);\r
     if (EFI_ERROR (Status)) {\r
@@ -847,10 +841,10 @@ BootMaintRouteConfig (
 \r
   //\r
   // Check data which located in Boot Options Menu and save the settings if need\r
-  //      \r
-  if (CompareMem (NewBmmData->BootOptionDel, OldBmmData->BootOptionDel, sizeof (NewBmmData->BootOptionDel)) != 0) {  \r
-    for (Index = 0; \r
-         ((Index < BootOptionMenu.MenuNumber) && (Index < (sizeof (NewBmmData->BootOptionDel) / sizeof (NewBmmData->BootOptionDel[0])))); \r
+  //\r
+  if (CompareMem (NewBmmData->BootOptionDel, OldBmmData->BootOptionDel, sizeof (NewBmmData->BootOptionDel)) != 0) {\r
+    for (Index = 0;\r
+         ((Index < BootOptionMenu.MenuNumber) && (Index < (sizeof (NewBmmData->BootOptionDel) / sizeof (NewBmmData->BootOptionDel[0]))));\r
          Index ++) {\r
       NewMenuEntry            = BOpt_GetMenuEntry (&BootOptionMenu, Index);\r
       NewLoadContext          = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;\r
@@ -891,10 +885,10 @@ BootMaintRouteConfig (
 \r
   //\r
   // Check data which located in Driver Options Menu and save the settings if need\r
-  //              \r
-  if (CompareMem (NewBmmData->DriverOptionDel, OldBmmData->DriverOptionDel, sizeof (NewBmmData->DriverOptionDel)) != 0) {       \r
-    for (Index = 0; \r
-         ((Index < DriverOptionMenu.MenuNumber) && (Index < (sizeof (NewBmmData->DriverOptionDel) / sizeof (NewBmmData->DriverOptionDel[0])))); \r
+  //\r
+  if (CompareMem (NewBmmData->DriverOptionDel, OldBmmData->DriverOptionDel, sizeof (NewBmmData->DriverOptionDel)) != 0) {\r
+    for (Index = 0;\r
+         ((Index < DriverOptionMenu.MenuNumber) && (Index < (sizeof (NewBmmData->DriverOptionDel) / sizeof (NewBmmData->DriverOptionDel[0]))));\r
          Index++) {\r
       NewMenuEntry            = BOpt_GetMenuEntry (&DriverOptionMenu, Index);\r
       NewLoadContext          = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;\r
@@ -909,7 +903,7 @@ BootMaintRouteConfig (
     }\r
   }\r
 \r
-  if (CompareMem (NewBmmData->DriverOptionOrder, OldBmmData->DriverOptionOrder, sizeof (NewBmmData->DriverOptionOrder)) != 0) {  \r
+  if (CompareMem (NewBmmData->DriverOptionOrder, OldBmmData->DriverOptionOrder, sizeof (NewBmmData->DriverOptionOrder)) != 0) {\r
     Status = Var_UpdateDriverOrder (Private);\r
     if (EFI_ERROR (Status)) {\r
       Offset = OFFSET_OF (BMM_FAKE_NV_DATA, DriverOptionOrder);\r
@@ -1128,14 +1122,14 @@ BootMaintCallback (
     if (Value == NULL) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
-    \r
+\r
     UpdatePageId (Private, QuestionId);\r
 \r
     if (QuestionId < FILE_OPTION_OFFSET) {\r
       if (QuestionId < CONFIG_OPTION_OFFSET) {\r
         switch (QuestionId) {\r
         case FORM_BOOT_ADD_ID:\r
-          // Leave BMM and enter FileExplorer. \r
+          // Leave BMM and enter FileExplorer.\r
           ChooseFile (NULL, L".efi", CreateBootOptionFromFile, &File);\r
           break;\r
 \r
@@ -1213,7 +1207,7 @@ BootMaintCallback (
     if ((Value == NULL) || (ActionRequest == NULL)) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
-   \r
+\r
     if (QuestionId == KEY_VALUE_SAVE_AND_EXIT_BOOT) {\r
       CleanUselessBeforeSubmit (Private);\r
       CurrentFakeNVMap->BootOptionChanged = FALSE;\r
@@ -1247,7 +1241,7 @@ BootMaintCallback (
       CurrentFakeNVMap->BootOptionChanged = TRUE;\r
     } else if (QuestionId == KEY_VALUE_DRIVER_DESCRIPTION || QuestionId == KEY_VALUE_DRIVER_OPTION) {\r
       CurrentFakeNVMap->DriverOptionChanged = TRUE;\r
-    } \r
+    }\r
 \r
     if ((QuestionId >= BOOT_OPTION_DEL_QUESTION_ID) && (QuestionId < BOOT_OPTION_DEL_QUESTION_ID + MAX_MENU_NUMBER)) {\r
       if (Value->b){\r
@@ -1718,7 +1712,7 @@ BootMaintenanceManagerUiLibConstructor (
 \r
   CreateUpdateData();\r
   //\r
-  // Update boot maintenance manager page \r
+  // Update boot maintenance manager page\r
   //\r
   InitializeBmmConfig(mBmmCallbackInfo);\r
 \r