summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Library/GenericBdsLib
diff options
context:
space:
mode:
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-25 04:44:45 +0000
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-25 04:44:45 +0000
commit8d3b5aff68cef02a1fdb650d009b9aa6b83d6040 (patch)
tree7a1a5723efddda6c93c3002ef212579289786e4a /IntelFrameworkModulePkg/Library/GenericBdsLib
parentf66d00cabc80475fe1b3a9be9bfd71b712657d02 (diff)
downloadedk2-8d3b5aff68cef02a1fdb650d009b9aa6b83d6040.tar.gz
Use UNI file string to display Boot Option for language localization.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8655 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Library/GenericBdsLib')
-rw-r--r--IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c63
-rw-r--r--IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c2
2 files changed, 20 insertions, 45 deletions
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
index 45d36fe99..d0ce36e98 100644
--- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
+++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
@@ -904,7 +904,7 @@ BdsDeleteAllInvalidEfiBootOption (
This function will enumerate all possible boot device in the system, and
automatically create boot options for Network, Shell, Removable BlockIo,
and Non-BlockIo Simplefile devices.
- It will only excute once of every boot.
+ It will only execute once of every boot.
@param BdsBootOptionList The header of the link list which indexed all
current boot options
@@ -924,6 +924,7 @@ BdsLibEnumerateAllBootOption (
UINT16 CdromNumber;
UINT16 UsbNumber;
UINT16 MiscNumber;
+ UINT16 ScsiNumber;
UINT16 NonBlockNumber;
UINTN NumberBlockIoHandles;
EFI_HANDLE *BlockIoHandles;
@@ -937,8 +938,8 @@ BdsLibEnumerateAllBootOption (
UINTN Size;
EFI_FV_FILE_ATTRIBUTES Attributes;
UINT32 AuthenticationStatus;
- EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+ EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;
UINTN DevicePathType;
CHAR16 Buffer[40];
EFI_HANDLE *FileSystemHandles;
@@ -952,6 +953,7 @@ BdsLibEnumerateAllBootOption (
CdromNumber = 0;
UsbNumber = 0;
MiscNumber = 0;
+ ScsiNumber = 0;
ZeroMem (Buffer, sizeof (Buffer));
//
@@ -1005,11 +1007,7 @@ BdsLibEnumerateAllBootOption (
switch (DevicePathType) {
case BDS_EFI_ACPI_FLOPPY_BOOT:
- if (FloppyNumber == 0) {
- UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_FLOPPY);
- } else {
- UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_FLOPPY_NUM, FloppyNumber);
- }
+ UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_FLOPPY_NUM, FloppyNumber);
BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
FloppyNumber++;
break;
@@ -1019,42 +1017,26 @@ BdsLibEnumerateAllBootOption (
//
case BDS_EFI_MESSAGE_ATAPI_BOOT:
case BDS_EFI_MESSAGE_SATA_BOOT:
- if (CdromNumber == 0) {
- UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_DVD);
- } else {
- UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_DVD_NUM, CdromNumber);
- }
+ UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_DVD_NUM, CdromNumber);
BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
CdromNumber++;
break;
case BDS_EFI_MESSAGE_USB_DEVICE_BOOT:
- if (UsbNumber == 0) {
- UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_USB);
- } else {
- UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_USB_NUM, UsbNumber);
- }
+ UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_USB_NUM, UsbNumber);
BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
UsbNumber++;
break;
case BDS_EFI_MESSAGE_SCSI_BOOT:
- if (UsbNumber == 0) {
- UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_SCSI);
- } else {
- UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_SCSI_NUM, UsbNumber);
- }
- BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
- UsbNumber++;
+ UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_SCSI_NUM, ScsiNumber);
+ BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
+ ScsiNumber++;
break;
case BDS_EFI_MESSAGE_MISC_BOOT:
- if (MiscNumber == 0) {
- UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_MISC);
- } else {
- UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_MISC_NUM, MiscNumber);
- }
- BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
+ UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_MISC_NUM, MiscNumber);
+ BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
MiscNumber++;
break;
@@ -1115,11 +1097,7 @@ BdsLibEnumerateAllBootOption (
//
BdsLibDeleteOptionFromHandle (FileSystemHandles[Index]);
} else {
- if (NonBlockNumber == 0) {
- UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_NON_BLOCK);
- } else {
- UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_NON_BLOCK_NUM, NonBlockNumber);
- }
+ UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_NON_BLOCK_NUM, NonBlockNumber);
BdsLibBuildOptionFromHandle (FileSystemHandles[Index], BdsBootOptionList, Buffer);
NonBlockNumber++;
}
@@ -1139,12 +1117,9 @@ BdsLibEnumerateAllBootOption (
&NumberSimpleNetworkHandles,
&SimpleNetworkHandles
);
+
for (Index = 0; Index < NumberSimpleNetworkHandles; Index++) {
- if (Index == 0) {
- UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_NETWORK);
- } else {
- UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_NETWORK_NUM, Index);
- }
+ UnicodeSPrint (Buffer, sizeof (Buffer), DESCRIPTION_NETWORK_NUM, Index);
BdsLibBuildOptionFromHandle (SimpleNetworkHandles[Index], BdsBootOptionList, Buffer);
}
@@ -1223,7 +1198,7 @@ BdsLibBuildOptionFromHandle (
{
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- DevicePath = DevicePathFromHandle (Handle);
+ DevicePath = DevicePathFromHandle (Handle);
//
// Create and register new boot option
@@ -1804,8 +1779,8 @@ BdsLibIsValidEFIBootOptDevicePathExt (
//
// If the boot option point to a blockIO device:
- // if it is a removable blockIo device, it is valid.
- // if it is a fixed blockIo device, check its description confliction.
+ // if it is a removable blockIo device, it is valid.
+ // if it is a fixed blockIo device, check its description confliction.
//
TempDevicePath = DevPath;
Status = gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &TempDevicePath, &Handle);
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c
index 7b16d9816..f937be27a 100644
--- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c
+++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c
@@ -811,7 +811,7 @@ BdsLibOutputStrings (
}
//
-// Following are BDS Lib functions which contain all the code about setup browser reset reminder feature.
+// Following are BDS Lib functions which contain all the code about setup browser reset reminder feature.
// Setup Browser reset reminder feature is that an reset reminder will be given before user leaves the setup browser if
// user change any option setting which needs a reset to be effective, and the reset will be applied according to the user selection.
//