summaryrefslogtreecommitdiffstats
path: root/IntelFrameworkModulePkg/Universal
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2009-07-13 10:20:09 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2009-07-13 10:20:09 +0000
commit429cac9c178d62020bc05debadee974986cef769 (patch)
treefc25fd5e3ebfa29d4070f887a234c20b91e1b8b0 /IntelFrameworkModulePkg/Universal
parent33801c0c8e3c99211a8f5a5a04f15e4499711abc (diff)
downloadedk2-429cac9c178d62020bc05debadee974986cef769.tar.gz
edk2-429cac9c178d62020bc05debadee974986cef769.tar.bz2
edk2-429cac9c178d62020bc05debadee974986cef769.zip
Retire description string macro for boot device type which are not defined in UEFI specification.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8926 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal')
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c61
1 files changed, 35 insertions, 26 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c
index 80af8e1803..af54de6926 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c
@@ -202,6 +202,7 @@ CallBootManager (
EFI_IFR_GUID_LABEL *StartLabel;
EFI_IFR_GUID_LABEL *EndLabel;
CHAR16 *BootStringNumber;
+ UINTN DevicePathType;
gOption = NULL;
InitializeListHead (&BdsBootOptionList);
@@ -267,43 +268,51 @@ CallBootManager (
//
// Replace description string with UNI file string.
//
- BootStringNumber = AllocateZeroPool (StrSize (Option->Description));
- ASSERT (BootStringNumber != NULL);
+ BootStringNumber = NULL;
- if (StrStr (Option->Description, DESCRIPTION_FLOPPY) != NULL) {
- BootStringNumber = Option->Description + StrLen (DESCRIPTION_FLOPPY) + 1;
+ DevicePathType = BdsGetBootTypeFromDevicePath (Option->DevicePath);
+
+ //
+ // store number string of boot option temporary.
+ //
+
+ switch (DevicePathType) {
+ case BDS_EFI_ACPI_FLOPPY_BOOT:
+ BootStringNumber = Option->Description;
Option->Description = GetStringById (STRING_TOKEN (STR_DESCRIPTION_FLOPPY));
- } else if (StrStr (Option->Description, DESCRIPTION_DVD) != NULL) {
- BootStringNumber = Option->Description + StrLen (DESCRIPTION_DVD) + 1;
+ break;
+ case BDS_EFI_MEDIA_CDROM_BOOT:
+ BootStringNumber = Option->Description;
Option->Description = GetStringById (STRING_TOKEN (STR_DESCRIPTION_DVD));
-
- } else if (StrStr (Option->Description, DESCRIPTION_USB) != NULL) {
- BootStringNumber = Option->Description + StrLen (DESCRIPTION_USB) + 1;
+ break;
+ case BDS_EFI_MESSAGE_USB_DEVICE_BOOT:
+ BootStringNumber = Option->Description;
Option->Description = GetStringById (STRING_TOKEN (STR_DESCRIPTION_USB));
-
- } else if (StrStr (Option->Description, DESCRIPTION_SCSI) != NULL) {
- BootStringNumber = Option->Description + StrLen (DESCRIPTION_SCSI) + 1;
+ break;
+ case BDS_EFI_MESSAGE_SCSI_BOOT:
+ BootStringNumber = Option->Description;
Option->Description = GetStringById (STRING_TOKEN (STR_DESCRIPTION_SCSI));
-
- } else if (StrStr (Option->Description, DESCRIPTION_MISC) != NULL) {
- BootStringNumber = Option->Description + StrLen (DESCRIPTION_MISC) + 1;
+ break;
+ case BDS_EFI_MESSAGE_MISC_BOOT:
+ BootStringNumber = Option->Description;
Option->Description = GetStringById (STRING_TOKEN (STR_DESCRIPTION_MISC));
-
- } else if (StrStr (Option->Description, DESCRIPTION_NETWORK) != NULL) {
- BootStringNumber = Option->Description + StrLen (DESCRIPTION_NETWORK) + 1;
+ break;
+ case BDS_EFI_MESSAGE_MAC_BOOT:
+ BootStringNumber = Option->Description;
Option->Description = GetStringById (STRING_TOKEN (STR_DESCRIPTION_NETWORK));
-
- } else if (StrStr (Option->Description, DESCRIPTION_NON_BLOCK) != NULL) {
- BootStringNumber = Option->Description + StrLen (DESCRIPTION_NON_BLOCK) + 1;
- Option->Description = GetStringById (STRING_TOKEN (STR_DESCRIPTION_NON_BLOCK));
+ break;
}
ASSERT (Option->Description != NULL);
- if (StrnCmp (BootStringNumber, L"0", 1) != 0) {
- StrCat (Option->Description, L" ");
- StrCat (Option->Description, BootStringNumber);
+ if (BootStringNumber != NULL) {
+ if (StrnCmp (BootStringNumber, L"0", 1) != 0) {
+ StrCat (Option->Description, L" ");
+ StrCat (Option->Description, BootStringNumber);
+ }
+
+ FreePool (BootStringNumber);
}
-
+
Token = HiiSetString (HiiHandle, 0, Option->Description, NULL);
TempStr = DevicePathToStr (Option->DevicePath);