summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-03-06 11:48:52 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-03-06 11:48:52 +0000
commita1a99cca132359b0f08b66a73e54f6008f90a28e (patch)
treedc19cbf0546948af92d81b993e31e5726b1b9bb4 /MdeModulePkg/Library/GenericBdsLib/BdsBoot.c
parent189eac2199940cdc1265503ba4854ea947042424 (diff)
downloadedk2-platforms-a1a99cca132359b0f08b66a73e54f6008f90a28e.tar.xz
1) Sync in patch for EDK 1063 Boot option enumeration algorithm enhancement
2) Sync in patch for EDK 1081: Enhance the BDS shell enumeration logic to skip the those not dispatched FVs in system. 3) Remove all EFI_SPECIFICATION_VERSION as all module should comply to UEFI 2.1 and later. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4798 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library/GenericBdsLib/BdsBoot.c')
-rw-r--r--MdeModulePkg/Library/GenericBdsLib/BdsBoot.c48
1 files changed, 12 insertions, 36 deletions
diff --git a/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c b/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c
index 5071a679cf..4f9ab144e4 100644
--- a/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c
+++ b/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c
@@ -830,11 +830,7 @@ BdsLibEnumerateAllBootOption (
UINTN Size;
EFI_FV_FILE_ATTRIBUTES Attributes;
UINT32 AuthenticationStatus;
-#if (PI_SPECIFICATION_VERSION < 0x00010000)
- EFI_FIRMWARE_VOLUME_PROTOCOL *Fv;
-#else
EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;
-#endif
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
UINTN DevicePathType;
CHAR16 Buffer[40];
@@ -1046,23 +1042,27 @@ BdsLibEnumerateAllBootOption (
//
gBS->LocateHandleBuffer (
ByProtocol,
- #if (PI_SPECIFICATION_VERSION < 0x00010000)
- &gEfiFirmwareVolumeProtocolGuid,
- #else
&gEfiFirmwareVolume2ProtocolGuid,
- #endif
NULL,
&FvHandleCount,
&FvHandleBuffer
);
for (Index = 0; Index < FvHandleCount; Index++) {
+ //
+ // Only care the dispatched FV. If no dispatch protocol on the FV, it is not dispatched, then skip it.
+ //
+ Status = gBS->HandleProtocol (
+ FvHandleBuffer[Index],
+ &gEfiFirmwareVolumeDispatchProtocolGuid,
+ (VOID **) &Fv
+ );
+ if (EFI_ERROR (Status)) {
+ continue;
+ }
+
gBS->HandleProtocol (
FvHandleBuffer[Index],
- #if (PI_SPECIFICATION_VERSION < 0x00010000)
- &gEfiFirmwareVolumeProtocolGuid,
- #else
&gEfiFirmwareVolume2ProtocolGuid,
- #endif
(VOID **) &Fv
);
@@ -1731,11 +1731,7 @@ BdsLibUpdateFvFileDevicePath (
UINT32 AuthenticationStatus;
BOOLEAN FindFvFile;
EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
-#if (PI_SPECIFICATION_VERSION < 0x00010000)
- EFI_FIRMWARE_VOLUME_PROTOCOL *Fv;
-#else
EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;
-#endif
MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FvFileNode;
EFI_HANDLE FoundFvHandle;
EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
@@ -1777,22 +1773,14 @@ BdsLibUpdateFvFileDevicePath (
TempDevicePath = *DevicePath;
FoundFvHandle = NULL;
Status = gBS->LocateDevicePath (
- #if (PI_SPECIFICATION_VERSION < 0x00010000)
- &gEfiFirmwareVolumeProtocolGuid,
- #else
&gEfiFirmwareVolume2ProtocolGuid,
- #endif
&TempDevicePath,
&FoundFvHandle
);
if (!EFI_ERROR (Status)) {
Status = gBS->HandleProtocol (
FoundFvHandle,
- #if (PI_SPECIFICATION_VERSION < 0x00010000)
- &gEfiFirmwareVolumeProtocolGuid,
- #else
&gEfiFirmwareVolume2ProtocolGuid,
- #endif
(VOID **) &Fv
);
if (!EFI_ERROR (Status)) {
@@ -1828,11 +1816,7 @@ BdsLibUpdateFvFileDevicePath (
if (!EFI_ERROR (Status)) {
Status = gBS->HandleProtocol (
LoadedImage->DeviceHandle,
- #if (PI_SPECIFICATION_VERSION < 0x00010000)
- &gEfiFirmwareVolumeProtocolGuid,
- #else
&gEfiFirmwareVolume2ProtocolGuid,
- #endif
(VOID **) &Fv
);
if (!EFI_ERROR (Status)) {
@@ -1857,11 +1841,7 @@ BdsLibUpdateFvFileDevicePath (
if (!FindFvFile) {
gBS->LocateHandleBuffer (
ByProtocol,
- #if (PI_SPECIFICATION_VERSION < 0x00010000)
- &gEfiFirmwareVolumeProtocolGuid,
- #else
&gEfiFirmwareVolume2ProtocolGuid,
- #endif
NULL,
&FvHandleCount,
&FvHandleBuffer
@@ -1869,11 +1849,7 @@ BdsLibUpdateFvFileDevicePath (
for (Index = 0; Index < FvHandleCount; Index++) {
gBS->HandleProtocol (
FvHandleBuffer[Index],
- #if (PI_SPECIFICATION_VERSION < 0x00010000)
- &gEfiFirmwareVolumeProtocolGuid,
- #else
&gEfiFirmwareVolume2ProtocolGuid,
- #endif
(VOID **) &Fv
);