Added a PCD to turn on/off probing Block IO devices to detect add/remove/change. FAT driver does not do this so if the shell does not do this you will get dir hits on an SD Card that has been removed. Default is ON. I moved this feature from device command to main command loop so it gets done after you type return before your command is processed.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10479 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -210,34 +210,13 @@ EblDeviceCmd (
|
||||
UINTN Index;
|
||||
UINTN CurrentRow;
|
||||
UINTN Max;
|
||||
EFI_OPEN_FILE *File;
|
||||
|
||||
CurrentRow = 0;
|
||||
|
||||
// Need to call here to make sure Device Counts are valid
|
||||
EblUpdateDeviceLists ();
|
||||
|
||||
//
|
||||
// Probe for media insertion/removal in removable media devices
|
||||
//
|
||||
Max = EfiGetDeviceCounts (EfiOpenBlockIo);
|
||||
if (Max != 0) {
|
||||
for (Index = 0; Index < Max; Index++) {
|
||||
File = EfiDeviceOpenByType (EfiOpenBlockIo, Index);
|
||||
if (File != NULL) {
|
||||
if (File->FsBlockIoMedia->RemovableMedia) {
|
||||
// Probe to see if media is present (or not) or media changed
|
||||
// this causes the ReinstallProtocolInterface() to fire in the
|
||||
// block io driver to update the system about media change events
|
||||
File->FsBlockIo->ReadBlocks (File->FsBlockIo, File->FsBlockIo->Media->MediaId, (EFI_LBA)0, 0, NULL);
|
||||
}
|
||||
EfiClose (File);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Now we can print out the info...
|
||||
|
||||
Max = EfiGetDeviceCounts (EfiOpenFirmwareVolume);
|
||||
if (Max != 0) {
|
||||
AsciiPrint ("Firmware Volume Devices:\n");
|
||||
|
Reference in New Issue
Block a user