]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c
Update for IntelFrameworkModulePkg.
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / BootMngr / BootManager.c
index bf65ea092b534035a5aaec068eb04643b7f83ccb..f86d55594b90437f63cd85304fb03aea9f776c27 100644 (file)
@@ -15,7 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "BootManager.h"\r
 \r
 UINT16             mKeyInput;\r
-EFI_GUID           mBootManagerGuid = BOOT_MANAGER_FORMSET_GUID;\r
 LIST_ENTRY         mBootOptionsList;\r
 BDS_COMMON_OPTION  *gOption;\r
 CHAR16             *mDeviceTypeStr[] = {\r
@@ -40,10 +39,7 @@ HII_VENDOR_DEVICE_PATH  mBootManagerHiiVendorDevicePath = {
         (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)\r
       }\r
     },\r
-    //\r
-    // {1DDDBE15-481D-4d2b-8277-B191EAF66525}\r
-    //\r
-    { 0x1dddbe15, 0x481d, 0x4d2b, { 0x82, 0x77, 0xb1, 0x91, 0xea, 0xf6, 0x65, 0x25 } }\r
+    BOOT_MANAGER_FORMSET_GUID\r
   },\r
   {\r
     END_DEVICE_PATH_TYPE,\r
@@ -99,47 +95,47 @@ BootManagerCallback (
   LIST_ENTRY              *Link;\r
   UINT16                  KeyCount;\r
 \r
-  if ((Action == EFI_BROWSER_ACTION_FORM_OPEN) || (Action == EFI_BROWSER_ACTION_FORM_CLOSE)) {\r
+  if (Action == EFI_BROWSER_ACTION_CHANGED) {\r
+    if ((Value == NULL) || (ActionRequest == NULL)) {\r
+      return EFI_INVALID_PARAMETER;\r
+    }\r
+\r
     //\r
-    // Do nothing for UEFI OPEN/CLOSE Action\r
+    // Initialize the key count\r
     //\r
-    return EFI_SUCCESS;\r
-  }\r
+    KeyCount = 0;\r
 \r
-  if ((Value == NULL) || (ActionRequest == NULL)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Initialize the key count\r
-  //\r
-  KeyCount = 0;\r
+    for (Link = GetFirstNode (&mBootOptionsList); !IsNull (&mBootOptionsList, Link); Link = GetNextNode (&mBootOptionsList, Link)) {\r
+      Option = CR (Link, BDS_COMMON_OPTION, Link, BDS_LOAD_OPTION_SIGNATURE);\r
 \r
-  for (Link = GetFirstNode (&mBootOptionsList); !IsNull (&mBootOptionsList, Link); Link = GetNextNode (&mBootOptionsList, Link)) {\r
-    Option = CR (Link, BDS_COMMON_OPTION, Link, BDS_LOAD_OPTION_SIGNATURE);\r
+      KeyCount++;\r
 \r
-    KeyCount++;\r
-\r
-    gOption = Option;\r
-\r
-    //\r
-    // Is this device the one chosen?\r
-    //\r
-    if (KeyCount == QuestionId) {\r
-      //\r
-      // Assigning the returned Key to a global allows the original routine to know what was chosen\r
-      //\r
-      mKeyInput = QuestionId;\r
+      gOption = Option;\r
 \r
       //\r
-      // Request to exit SendForm(), so that we could boot the selected option\r
+      // Is this device the one chosen?\r
       //\r
-      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;\r
-      break;\r
+      if (KeyCount == QuestionId) {\r
+        //\r
+        // Assigning the returned Key to a global allows the original routine to know what was chosen\r
+        //\r
+        mKeyInput = QuestionId;\r
+\r
+        //\r
+        // Request to exit SendForm(), so that we could boot the selected option\r
+        //\r
+        *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;\r
+        break;\r
+      }\r
     }\r
+\r
+    return EFI_SUCCESS;\r
   }\r
 \r
-  return EFI_SUCCESS;\r
+  //\r
+  // All other action return unsupported.\r
+  //\r
+  return EFI_UNSUPPORTED;\r
 }\r
 \r
 /**\r
@@ -175,7 +171,7 @@ InitializeBootManager (
   // Publish our HII data\r
   //\r
   gBootManagerPrivate.HiiHandle = HiiAddPackages (\r
-                                    &mBootManagerGuid,\r
+                                    &gBootManagerFormSetGuid,\r
                                     gBootManagerPrivate.DriverHandle,\r
                                     BootManagerVfrBin,\r
                                     BdsDxeStrings,\r
@@ -338,7 +334,7 @@ CallBootManager (
 \r
   HiiUpdateForm (\r
     HiiHandle,\r
-    &mBootManagerGuid,\r
+    &gBootManagerFormSetGuid,\r
     BOOT_MANAGER_FORM_ID,\r
     StartOpCodeHandle,\r
     EndOpCodeHandle\r
@@ -352,7 +348,7 @@ CallBootManager (
                            gFormBrowser2,\r
                            &HiiHandle,\r
                            1,\r
-                           &mBootManagerGuid,\r
+                           &gBootManagerFormSetGuid,\r
                            0,\r
                            NULL,\r
                            &ActionRequest\r