Add loaded Image device paths for EFI Drivers loaded from PCI Option ROM.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8022 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -25,6 +25,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
#include <Protocol/DevicePath.h>
|
#include <Protocol/DevicePath.h>
|
||||||
#include <Protocol/Runtime.h>
|
#include <Protocol/Runtime.h>
|
||||||
#include <Protocol/LoadFile.h>
|
#include <Protocol/LoadFile.h>
|
||||||
|
#include <Protocol/LoadFile2.h>
|
||||||
#include <Protocol/DriverBinding.h>
|
#include <Protocol/DriverBinding.h>
|
||||||
#include <Protocol/VariableWrite.h>
|
#include <Protocol/VariableWrite.h>
|
||||||
#include <Protocol/PlatformDriverOverride.h>
|
#include <Protocol/PlatformDriverOverride.h>
|
||||||
|
@ -110,6 +110,7 @@
|
|||||||
gEfiLoadPeImageProtocolGuid ## PRODUCES
|
gEfiLoadPeImageProtocolGuid ## PRODUCES
|
||||||
gEfiSimpleFileSystemProtocolGuid ## CONSUMES
|
gEfiSimpleFileSystemProtocolGuid ## CONSUMES
|
||||||
gEfiLoadFileProtocolGuid ## CONSUMES
|
gEfiLoadFileProtocolGuid ## CONSUMES
|
||||||
|
gEfiLoadFile2ProtocolGuid ## CONSUMES
|
||||||
gEfiResetArchProtocolGuid ## CONSUMES
|
gEfiResetArchProtocolGuid ## CONSUMES
|
||||||
gEfiRealTimeClockArchProtocolGuid ## CONSUMES
|
gEfiRealTimeClockArchProtocolGuid ## CONSUMES
|
||||||
gEfiRuntimeArchProtocolGuid ## CONSUMES
|
gEfiRuntimeArchProtocolGuid ## CONSUMES
|
||||||
|
@ -90,6 +90,7 @@ CoreOpenImageFile (
|
|||||||
EFI_FILE_HANDLE FileHandle;
|
EFI_FILE_HANDLE FileHandle;
|
||||||
EFI_FILE_HANDLE LastHandle;
|
EFI_FILE_HANDLE LastHandle;
|
||||||
EFI_LOAD_FILE_PROTOCOL *LoadFile;
|
EFI_LOAD_FILE_PROTOCOL *LoadFile;
|
||||||
|
EFI_LOAD_FILE2_PROTOCOL *LoadFile2;
|
||||||
EFI_FIRMWARE_VOLUME2_PROTOCOL *FwVol;
|
EFI_FIRMWARE_VOLUME2_PROTOCOL *FwVol;
|
||||||
EFI_SECTION_TYPE SectionType;
|
EFI_SECTION_TYPE SectionType;
|
||||||
UINT8 *Pe32Buffer;
|
UINT8 *Pe32Buffer;
|
||||||
@ -315,6 +316,52 @@ CoreOpenImageFile (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Try LoadFile2 style
|
||||||
|
//
|
||||||
|
if (!BootPolicy) {
|
||||||
|
TempFilePath = *FilePath;
|
||||||
|
Status = CoreDevicePathToInterface (
|
||||||
|
&gEfiLoadFile2ProtocolGuid,
|
||||||
|
&TempFilePath,
|
||||||
|
(VOID*)&LoadFile2,
|
||||||
|
DeviceHandle
|
||||||
|
);
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
|
//
|
||||||
|
// Call LoadFile2 with the correct buffer size
|
||||||
|
//
|
||||||
|
ASSERT (ImageFileHandle->SourceSize == 0);
|
||||||
|
ASSERT (ImageFileHandle->Source == NULL);
|
||||||
|
|
||||||
|
Status = LoadFile2->LoadFile (
|
||||||
|
LoadFile2,
|
||||||
|
TempFilePath,
|
||||||
|
BootPolicy,
|
||||||
|
&ImageFileHandle->SourceSize,
|
||||||
|
ImageFileHandle->Source
|
||||||
|
);
|
||||||
|
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||||
|
ImageFileHandle->Source = AllocatePool (ImageFileHandle->SourceSize);
|
||||||
|
if (ImageFileHandle->Source == NULL) {
|
||||||
|
Status = EFI_OUT_OF_RESOURCES;
|
||||||
|
} else {
|
||||||
|
Status = LoadFile2->LoadFile (
|
||||||
|
LoadFile2,
|
||||||
|
TempFilePath,
|
||||||
|
BootPolicy,
|
||||||
|
&ImageFileHandle->SourceSize,
|
||||||
|
ImageFileHandle->Source
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
|
ImageFileHandle->FreeBuffer = TRUE;
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Try LoadFile style
|
// Try LoadFile style
|
||||||
|
Reference in New Issue
Block a user