]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c
Update BdsDxe to use new designed HiiLib, remove the referrence to the original IfrSu...
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / BootMngr / BootManager.c
index 4918b25b13e0168767a0ab0517850c8746ddc3df..7a727b86753d1e0b3173b084130b85c42b801ab5 100644 (file)
@@ -186,7 +186,6 @@ CallBootManager (
   EFI_STATUS                  Status;\r
   BDS_COMMON_OPTION           *Option;\r
   LIST_ENTRY                  *Link;\r
-  EFI_HII_UPDATE_DATA         UpdateData;\r
   CHAR16                      *ExitData;\r
   UINTN                       ExitDataSize;\r
   EFI_STRING_ID               Token;\r
@@ -198,6 +197,10 @@ CallBootManager (
   EFI_HII_HANDLE              HiiHandle;\r
   EFI_BROWSER_ACTION_REQUEST  ActionRequest;\r
   UINTN                       TempSize;\r
+  VOID                        *StartOpCodeHandle;\r
+  VOID                        *EndOpCodeHandle;\r
+  EFI_IFR_GUID_LABEL          *StartLabel;\r
+  EFI_IFR_GUID_LABEL          *EndLabel;\r
 \r
   gOption = NULL;\r
   InitializeListHead (&BdsBootOptionList);\r
@@ -223,10 +226,25 @@ CallBootManager (
   //\r
   // Allocate space for creation of UpdateData Buffer\r
   //\r
-  UpdateData.BufferSize = 0x1000;\r
-  UpdateData.Offset = 0;\r
-  UpdateData.Data = AllocateZeroPool (0x1000);\r
-  ASSERT (UpdateData.Data != NULL);\r
+  StartOpCodeHandle = HiiAllocateOpCodeHandle ();\r
+  ASSERT (StartOpCodeHandle != NULL);\r
+\r
+  EndOpCodeHandle = HiiAllocateOpCodeHandle ();\r
+  ASSERT (EndOpCodeHandle != NULL);\r
+\r
+  //\r
+  // Create Hii Extend Label OpCode as the start opcode\r
+  //\r
+  StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));\r
+  StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;\r
+  StartLabel->Number       = LABEL_BOOT_OPTION;\r
+\r
+  //\r
+  // Create Hii Extend Label OpCode as the end opcode\r
+  //\r
+  EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));\r
+  EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;\r
+  EndLabel->Number       = LABEL_BOOT_OPTION_END;\r
 \r
   mKeyInput = 0;\r
 \r
@@ -256,32 +274,33 @@ CallBootManager (
 \r
     HelpToken = HiiSetString (HiiHandle, 0, HelpString, NULL);\r
 \r
-    CreateActionOpCode (\r
+    HiiCreateActionOpCode (\r
+      StartOpCodeHandle,\r
       mKeyInput,\r
       Token,\r
       HelpToken,\r
       EFI_IFR_FLAG_CALLBACK,\r
-      0,\r
-      &UpdateData\r
+      0\r
       );\r
   }\r
 \r
-  IfrLibUpdateForm (\r
+  HiiUpdateForm (\r
     HiiHandle,\r
     &mBootManagerGuid,\r
     BOOT_MANAGER_FORM_ID,\r
-    LABEL_BOOT_OPTION,\r
-    FALSE,\r
-    &UpdateData\r
+    StartOpCodeHandle,\r
+    EndOpCodeHandle\r
     );\r
-  FreePool (UpdateData.Data);\r
+\r
+  HiiFreeOpCodeHandle (StartOpCodeHandle);\r
+  HiiFreeOpCodeHandle (EndOpCodeHandle);\r
 \r
   ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;\r
   Status = gFormBrowser2->SendForm (\r
                            gFormBrowser2,\r
                            &HiiHandle,\r
                            1,\r
-                           NULL,\r
+                           &mBootManagerGuid,\r
                            0,\r
                            NULL,\r
                            &ActionRequest\r