diff options
author | wuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-12-12 07:09:03 +0000 |
---|---|---|
committer | wuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-12-12 07:09:03 +0000 |
commit | 406adcd15cafe2f1f6cff0750ef9bfd8c613013a (patch) | |
tree | a0f2e98b6ba78d6af198523c0a503fdfe7885c31 /EdkModulePkg/Bus/Pci/PciBus/Dxe | |
parent | d02920ead2934c94ad3603bdce18d699af027a9f (diff) | |
download | edk2-platforms-406adcd15cafe2f1f6cff0750ef9bfd8c613013a.tar.xz |
Merge GOP related code from r8->r9.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2085 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Bus/Pci/PciBus/Dxe')
-rw-r--r-- | EdkModulePkg/Bus/Pci/PciBus/Dxe/PciDriverOverride.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciDriverOverride.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciDriverOverride.c index cd2d585303..70ad48b5ec 100644 --- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciDriverOverride.c +++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciDriverOverride.c @@ -139,8 +139,11 @@ Returns: // TODO: EFI_SUCCESS - add return value to function comment
{
EFI_STATUS Status;
+ EFI_IMAGE_DOS_HEADER *DosHdr;
+ EFI_IMAGE_NT_HEADERS *PeHdr;
EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
PCI_DRIVER_OVERRIDE_LIST *Node;
+#if (EFI_SPECIFICATION_VERSION < 0x00020000)
EFI_DRIVER_OS_HANDOFF_HEADER *DriverOsHandoffHeader;
EFI_DRIVER_OS_HANDOFF_HEADER *NewDriverOsHandoffHeader;
EFI_DRIVER_OS_HANDOFF *DriverOsHandoff;
@@ -149,6 +152,7 @@ Returns: UINTN NumberOfEntries;
UINTN Size;
UINTN Index;
+#endif
Status = gBS->HandleProtocol (DriverImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &LoadedImage);
if (EFI_ERROR (Status)) {
@@ -167,10 +171,18 @@ Returns: PciIoDevice->BusOverride = TRUE;
- if (PeCoffLoaderGetMachineType ((VOID *)(UINTN)LoadedImage->ImageBase) != EFI_IMAGE_MACHINE_EBC) {
+ DosHdr = (EFI_IMAGE_DOS_HEADER *) LoadedImage->ImageBase;
+ if (DosHdr->e_magic != EFI_IMAGE_DOS_SIGNATURE) {
return EFI_SUCCESS;
}
+ PeHdr = (EFI_IMAGE_NT_HEADERS *) ((UINTN) LoadedImage->ImageBase + DosHdr->e_lfanew);
+
+ if (PeHdr->FileHeader.Machine != EFI_IMAGE_MACHINE_EBC) {
+ return EFI_SUCCESS;
+ }
+
+#if (EFI_SPECIFICATION_VERSION < 0x00020000)
DriverOsHandoffHeader = NULL;
Status = EfiGetSystemConfigurationTable (&gEfiUgaIoProtocolGuid, (VOID **) &DriverOsHandoffHeader);
if (!EFI_ERROR (Status) && DriverOsHandoffHeader != NULL) {
@@ -276,6 +288,7 @@ Returns: if (DriverOsHandoffHeader != NULL) {
gBS->FreePool (DriverOsHandoffHeader);
}
+#endif
return EFI_SUCCESS;
}
|