]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
Refine the save action for the BdsDxe.
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / BootMaint / Variable.c
index 63eeb54ccf886bacc2ebf4e0e709ee44ea178634..0e9dbda66707fe9ca02e97f6a2c765d6ba7ae5a3 100644 (file)
@@ -708,6 +708,16 @@ Var_UpdateDriverOption (
       InsertTailList (&DriverOptionMenu.Head, &NewMenuEntry->Link);\r
       DriverOptionMenu.MenuNumber++;\r
 \r
+      //\r
+      // Update "change boot order" page used data, append the new add boot\r
+      // option at the end.\r
+      //\r
+      Index = 0;\r
+      while (CallbackData->BmmFakeNvData.DriverOptionOrder[Index] != 0) {\r
+        Index++;\r
+      }\r
+      CallbackData->BmmFakeNvData.DriverOptionOrder[Index] = (UINT32) (NewMenuEntry->OptionNumber + 1);\r
+\r
       *DescriptionData  = 0x0000;\r
       *OptionalData     = 0x0000;\r
     }\r
@@ -879,6 +889,16 @@ Var_UpdateBootOption (
       InsertTailList (&BootOptionMenu.Head, &NewMenuEntry->Link);\r
       BootOptionMenu.MenuNumber++;\r
 \r
+      //\r
+      // Update "change driver order" page used data, append the new add driver\r
+      // option at the end.\r
+      //\r
+      Index = 0;\r
+      while (CallbackData->BmmFakeNvData.BootOptionOrder[Index] != 0) {\r
+        Index++;\r
+      }\r
+      CallbackData->BmmFakeNvData.BootOptionOrder[Index] = (UINT32) (NewMenuEntry->OptionNumber + 1);\r
+\r
       NvRamMap->BootDescriptionData[0]  = 0x0000;\r
       NvRamMap->BootOptionalData[0]     = 0x0000;\r
     }\r