summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-04-08 09:34:21 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-04-08 09:34:21 +0000
commit23d64dda6b61f86cdeac40b465144845f60406f4 (patch)
tree39e261835ba2ac4d6e7317628f6f5b6bf77a45da /MdeModulePkg/Library
parentc4fa3eacb3fae2fd5052dd0727272896310c4a9a (diff)
downloadedk2-platforms-23d64dda6b61f86cdeac40b465144845f60406f4.tar.xz
1.Port Platform driver override protocol utility application in MdeModulePkg.dsc.
2.Update PlatDriOverLib library to use EFI Loaded Image Device Path Protocol to avoid "reconnect -r" issue for Platform driver override utility application. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5006 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library')
-rw-r--r--MdeModulePkg/Library/DxePlatDriOverLib/DxePlatDriOverLib.inf2
-rw-r--r--MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOverLib.c35
2 files changed, 12 insertions, 25 deletions
diff --git a/MdeModulePkg/Library/DxePlatDriOverLib/DxePlatDriOverLib.inf b/MdeModulePkg/Library/DxePlatDriOverLib/DxePlatDriOverLib.inf
index 1ba2d7887b..cb0eb29b8b 100644
--- a/MdeModulePkg/Library/DxePlatDriOverLib/DxePlatDriOverLib.inf
+++ b/MdeModulePkg/Library/DxePlatDriOverLib/DxePlatDriOverLib.inf
@@ -62,4 +62,4 @@
gEfiBusSpecificDriverOverrideProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiDriverBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
-
+ gEfiLoadedImageDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
diff --git a/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOverLib.c b/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOverLib.c
index 0ba63fc512..497446b10a 100644
--- a/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOverLib.c
+++ b/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOverLib.c
@@ -666,7 +666,6 @@ GetDriverFromMapping (
EFI_HANDLE *ImageHandleBuffer;
UINTN ImageHandleCount;
UINTN Index;
- EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
EFI_HANDLE DriverBindingHandle;
BOOLEAN FoundLastReturned;
@@ -677,8 +676,7 @@ GetDriverFromMapping (
EFI_DEVICE_PATH_PROTOCOL *TempDriverImagePath;
EFI_HANDLE ImageHandle;
EFI_HANDLE Handle;
- EFI_DEVICE_PATH_PROTOCOL *LoadedImageHandleDevicePath;
- EFI_DEVICE_PATH_PROTOCOL *TatalFilePath;
+ EFI_DEVICE_PATH_PROTOCOL *LoadedImageDevicePath;
EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL *BusSpecificDriverOverride;
UINTN DevicePathSize;
@@ -786,39 +784,28 @@ GetDriverFromMapping (
}
for(Index = 0; Index < ImageHandleCount; Index ++) {
- Status = gBS->HandleProtocol (
- ImageHandleBuffer[Index],
- &gEfiLoadedImageProtocolGuid,
- (VOID **) &LoadedImage
- );
- if (EFI_ERROR (Status)) {
- continue;
- }
-
//
- // Get the driver image total file path
+ // Get the EFI Loaded Image Device Path Protocol
//
- LoadedImageHandleDevicePath = NULL;
+ LoadedImageDevicePath = NULL;
Status = gBS->HandleProtocol (
- LoadedImage->DeviceHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID **) &LoadedImageHandleDevicePath
+ ImageHandleBuffer[Index],
+ &gEfiLoadedImageDevicePathProtocolGuid,
+ (VOID **) &LoadedImageDevicePath
);
if (EFI_ERROR (Status)) {
//
- // Maybe Not all LoadedImage->DeviceHandle has valid value. Skip the invalid image.
+ // Maybe Not all EFI Loaded Image Device Path Protocol existed.
//
continue;
}
- TatalFilePath = AppendDevicePath (LoadedImageHandleDevicePath, LoadedImage->FilePath);
-
DevicePathSize = GetDevicePathSize (DriverImageInfo->DriverImagePath);
- if (DevicePathSize == GetDevicePathSize (TatalFilePath)) {
+ if (DevicePathSize == GetDevicePathSize (LoadedImageDevicePath)) {
if (CompareMem (
DriverImageInfo->DriverImagePath,
- TatalFilePath,
- GetDevicePathSize (TatalFilePath)
+ LoadedImageDevicePath,
+ GetDevicePathSize (LoadedImageDevicePath)
) == 0
) {
ImageFound = TRUE;
@@ -1881,7 +1868,7 @@ ConnectDevicePath (
// change, so next time will do the dispatch, then dispatch's status
// will take effect
// 2. If the connect success, the RemainingDevicepath and handle will
- // change, then avoid the dispatch, we have chance to continue the
+ // change, then avoid the dispatch, we have chance to continue the
// next connection
//
gBS->ConnectController (Handle, NULL, RemainingDevicePath, FALSE);