Order NVMe devices first

This commit is contained in:
Jeremy Soller
2019-05-02 10:06:04 -06:00
committed by Tim Crawford
parent b8fbf69c16
commit 33006e4f4e

View File

@ -3139,6 +3139,7 @@ BdsLibEnumerateAllBootOption (
EFI_BLOCK_IO_PROTOCOL *BlkIo; EFI_BLOCK_IO_PROTOCOL *BlkIo;
BOOLEAN Removable[2]; BOOLEAN Removable[2];
UINTN RemovableIndex; UINTN RemovableIndex;
UINTN DPTIndex;
UINTN Index; UINTN Index;
UINTN NumOfLoadFileHandles; UINTN NumOfLoadFileHandles;
EFI_HANDLE *LoadFileHandles; EFI_HANDLE *LoadFileHandles;
@ -3234,6 +3235,7 @@ BdsLibEnumerateAllBootOption (
); );
for (RemovableIndex = 0; RemovableIndex < 2; RemovableIndex++) { for (RemovableIndex = 0; RemovableIndex < 2; RemovableIndex++) {
for (DPTIndex = 0; DPTIndex < 2; DPTIndex++) {
for (Index = 0; Index < NumberBlockIoHandles; Index++) { for (Index = 0; Index < NumberBlockIoHandles; Index++) {
Status = gBS->HandleProtocol ( Status = gBS->HandleProtocol (
BlockIoHandles[Index], BlockIoHandles[Index],
@ -3256,6 +3258,15 @@ BdsLibEnumerateAllBootOption (
DevicePath = DevicePathFromHandle (BlockIoHandles[Index]); DevicePath = DevicePathFromHandle (BlockIoHandles[Index]);
DevicePathType = BdsGetBootTypeFromDevicePath (DevicePath); DevicePathType = BdsGetBootTypeFromDevicePath (DevicePath);
// Do NVMe devices first, all others second
if (DPTIndex == 0) {
if (DevicePathType != BDS_EFI_MESSAGE_NVME_BOOT) {
continue;
}
} else if (DevicePathType == BDS_EFI_MESSAGE_NVME_BOOT) {
continue;
}
// //
// get description for current block handle // get description for current block handle
// //
@ -3377,6 +3388,7 @@ BdsLibEnumerateAllBootOption (
} }
} }
} }
}
if (NumberBlockIoHandles != 0) { if (NumberBlockIoHandles != 0) {
FreePool (BlockIoHandles); FreePool (BlockIoHandles);