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
{\r
\r
gBdsLibStringPackHandle = HiiAddPackages (\r
- &mBdsLibStringPackGuid,\r
+ &gBdsLibStringPackageGuid,\r
&ImageHandle,\r
GenericBdsLibStrings,\r
NULL\r
// could be installed for this USB device.\r
//\r
BdsLibConnectDevicePath (FullDevicePath);\r
+ REPORT_STATUS_CODE (EFI_PROGRESS_CODE, PcdGet32 (PcdProgressCodeOsLoaderLoad));\r
Status = gBS->LoadImage (\r
TRUE,\r
gImageHandle,\r
//\r
FullDevicePath = FileDevicePath (Handle, EFI_REMOVABLE_MEDIA_FILE_NAME);\r
if (FullDevicePath != NULL) {\r
+ REPORT_STATUS_CODE (EFI_PROGRESS_CODE, PcdGet32 (PcdProgressCodeOsLoaderLoad));\r
Status = gBS->LoadImage (\r
TRUE,\r
gImageHandle,\r
\r
DEBUG_CODE_END();\r
\r
+ //\r
+ // Report status code for OS Loader LoadImage.\r
+ //\r
+ REPORT_STATUS_CODE (EFI_PROGRESS_CODE, PcdGet32 (PcdProgressCodeOsLoaderLoad));\r
Status = gBS->LoadImage (\r
TRUE,\r
gImageHandle,\r
//\r
FilePath = FileDevicePath (Handle, EFI_REMOVABLE_MEDIA_FILE_NAME);\r
if (FilePath != NULL) {\r
+ REPORT_STATUS_CODE (EFI_PROGRESS_CODE, PcdGet32 (PcdProgressCodeOsLoaderLoad));\r
Status = gBS->LoadImage (\r
TRUE,\r
gImageHandle,\r
WriteBootToOsPerformanceData ();\r
);\r
\r
+ //\r
+ // Report status code for OS Loader StartImage.\r
+ //\r
+ REPORT_STATUS_CODE (EFI_PROGRESS_CODE, PcdGet32 (PcdProgressCodeOsLoaderStart));\r
+\r
Status = gBS->StartImage (ImageHandle, ExitDataSize, ExitData);\r
DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Image Return Status = %r\n", Status));\r
\r
\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
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
// 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
}\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
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
}\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
// 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
// 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
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