]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
Clean up the private GUID definition in module Level.
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / GenericBdsLib / BdsBoot.c
index 58f058df805d3af53161661f9c8bb5df0d04ff90..372cab59721d1dedbc94f454b6531ef2ec2585ff 100644 (file)
@@ -18,23 +18,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 BOOLEAN mEnumBootDevice = FALSE;\r
 EFI_HII_HANDLE gBdsLibStringPackHandle = NULL;\r
 \r
-///\r
-/// This GUID is used for an EFI Variable that stores the front device pathes\r
-/// for a partial device path that starts with the HD node.\r
-///\r
-EFI_GUID  mHdBootVariablePrivateGuid = { 0xfab7e9e1, 0x39dd, 0x4f2b, { 0x84, 0x8, 0xe2, 0xe, 0x90, 0x6c, 0xb6, 0xde } };\r
-\r
-///\r
-/// This GUID is used for register UNI string.\r
-///\r
-EFI_GUID mBdsLibStringPackGuid = {  0x3b4d9b23, 0x95ac, 0x44f6, { 0x9f, 0xcd, 0xe, 0x95, 0x94, 0x58, 0x6c, 0x72 } };\r
-\r
-///\r
-/// This GUID is used for Set/Get platform language into/from variable at last time enumeration to ensure the enumeration will\r
-/// only execute once.\r
-///\r
-EFI_GUID mBdsLibLastLangGuid = { 0xe8c545b, 0xa2ee, 0x470d, { 0x8e, 0x26, 0xbd, 0xa1, 0xa1, 0x3c, 0xa, 0xa3 } };\r
-\r
 /**\r
   The constructor function register UNI strings into imageHandle.\r
   \r
@@ -56,7 +39,7 @@ GenericBdsLibConstructor (
 {\r
 \r
   gBdsLibStringPackHandle = HiiAddPackages (\r
-                              &mBdsLibStringPackGuid,\r
+                              &gBdsLibStringPackageGuid,\r
                               &ImageHandle,\r
                               GenericBdsLibStrings,\r
                               NULL\r
@@ -906,13 +889,13 @@ BdsExpandPartitionPartialDevicePathToFull (
 \r
   FullDevicePath = NULL;\r
   //\r
-  // Check if there is prestore 'HDDP' variable.\r
+  // Check if there is prestore HD_BOOT_DEVICE_PATH_VARIABLE_NAME variable.\r
   // If exist, search the front path which point to partition node in the variable instants.\r
-  // If fail to find or 'HDDP' not exist, reconnect all and search in all system\r
+  // If fail to find or HD_BOOT_DEVICE_PATH_VARIABLE_NAME not exist, reconnect all and search in all system\r
   //\r
   CachedDevicePath = BdsLibGetVariableAndSize (\r
-                      L"HDDP",\r
-                      &mHdBootVariablePrivateGuid,\r
+                      HD_BOOT_DEVICE_PATH_VARIABLE_NAME,\r
+                      &gHdBootDevicePathVariablGuid,\r
                       &CachedDevicePathSize\r
                       );\r
 \r
@@ -954,7 +937,7 @@ BdsExpandPartitionPartialDevicePathToFull (
       FullDevicePath = AppendDevicePath (Instance, DevicePath);\r
 \r
       //\r
-      // Adjust the 'HDDP' instances sequence if the matched one is not first one.\r
+      // Adjust the HD_BOOT_DEVICE_PATH_VARIABLE_NAME instances sequence if the matched one is not first one.\r
       //\r
       if (NeedAdjust) {\r
         //\r
@@ -974,8 +957,8 @@ BdsExpandPartitionPartialDevicePathToFull (
         // Save the matching Device Path so we don't need to do a connect all next time\r
         //\r
         Status = gRT->SetVariable (\r
-                        L"HDDP",\r
-                        &mHdBootVariablePrivateGuid,\r
+                        HD_BOOT_DEVICE_PATH_VARIABLE_NAME,\r
+                        &gHdBootDevicePathVariablGuid,\r
                         EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
                         GetDevicePathSize (CachedDevicePath),\r
                         CachedDevicePath\r
@@ -989,7 +972,7 @@ BdsExpandPartitionPartialDevicePathToFull (
   }\r
 \r
   //\r
-  // If we get here we fail to find or 'HDDP' not exist, and now we need\r
+  // If we get here we fail to find or HD_BOOT_DEVICE_PATH_VARIABLE_NAME not exist, and now we need\r
   // to search all devices in the system for a matched partition\r
   //\r
   BdsLibConnectAllDriversToAllControllers ();\r
@@ -1019,11 +1002,11 @@ BdsExpandPartitionPartialDevicePathToFull (
       FullDevicePath = AppendDevicePath (BlockIoDevicePath, DevicePath);\r
 \r
       //\r
-      // Save the matched partition device path in 'HDDP' variable\r
+      // Save the matched partition device path in HD_BOOT_DEVICE_PATH_VARIABLE_NAME variable\r
       //\r
       if (CachedDevicePath != NULL) {\r
         //\r
-        // Save the matched partition device path as first instance of 'HDDP' variable\r
+        // Save the matched partition device path as first instance of HD_BOOT_DEVICE_PATH_VARIABLE_NAME variable\r
         //\r
         if (BdsLibMatchDevicePaths (CachedDevicePath, BlockIoDevicePath)) {\r
           TempNewDevicePath = CachedDevicePath;\r
@@ -1042,7 +1025,8 @@ BdsExpandPartitionPartialDevicePathToFull (
         }\r
         //\r
         // Here limit the device path instance number to 12, which is max number for a system support 3 IDE controller\r
-        // If the user try to boot many OS in different HDs or partitions, in theory, the 'HDDP' variable maybe become larger and larger.\r
+        // If the user try to boot many OS in different HDs or partitions, in theory, \r
+        // the HD_BOOT_DEVICE_PATH_VARIABLE_NAME variable maybe become larger and larger.\r
         //\r
         InstanceNum = 0;\r
         ASSERT (CachedDevicePath != NULL);\r
@@ -1072,8 +1056,8 @@ BdsExpandPartitionPartialDevicePathToFull (
       // Save the matching Device Path so we don't need to do a connect all next time\r
       //\r
       Status = gRT->SetVariable (\r
-                      L"HDDP",\r
-                      &mHdBootVariablePrivateGuid,\r
+                      HD_BOOT_DEVICE_PATH_VARIABLE_NAME,\r
+                      &gHdBootDevicePathVariablGuid,\r
                       EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
                       GetDevicePathSize (CachedDevicePath),\r
                       CachedDevicePath\r
@@ -1495,7 +1479,7 @@ BdsLibEnumerateAllBootOption (
   // device from the boot order variable\r
   //\r
   if (mEnumBootDevice) {\r
-    LastLang = GetVariable (L"LastEnumLang", &mBdsLibLastLangGuid);\r
+    LastLang = GetVariable (LAST_ENUM_LANGUAGE_VARIABLE_NAME, &gLastEnumLangGuid);\r
     PlatLang = GetEfiGlobalVariable (L"PlatformLang");\r
     ASSERT (PlatLang != NULL);\r
     if ((LastLang != NULL) && (AsciiStrCmp (LastLang, PlatLang) == 0)) {\r
@@ -1505,8 +1489,8 @@ BdsLibEnumerateAllBootOption (
       return Status;\r
     } else {\r
       Status = gRT->SetVariable (\r
-        L"LastEnumLang",\r
-        &mBdsLibLastLangGuid,\r
+        LAST_ENUM_LANGUAGE_VARIABLE_NAME,\r
+        &gLastEnumLangGuid,\r
         EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
         AsciiStrSize (PlatLang),\r
         PlatLang\r