X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FBus%2FPci%2FPciBusDxe%2FPciDeviceSupport.c;h=e76c8f00468a87e9db7d6b014b3cffa257cd2a89;hb=dc080d3b61e570e7a3163fc24afa6f8388d0c0bf;hp=0ff39a56c4ceb63884aea80add915476a17be213;hpb=7d921075b454dcd4af7b8b2dc705bff83edb2275;p=mirror_edk2.git diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c index 0ff39a56c4..e76c8f0046 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c @@ -1,7 +1,7 @@ /** @file Supporting functions implementaion for PCI devices management. -Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -214,6 +214,7 @@ RegisterPciDevice ( UINT8 PciExpressCapRegOffset; EFI_PCI_IO_PROTOCOL *PciIo; UINT8 Data8; + BOOLEAN HasEfiImage; // // Install the pciio protocol, device path protocol @@ -281,7 +282,7 @@ RegisterPciDevice ( PciIoDevice->BusNumber, PciIoDevice->DeviceNumber, PciIoDevice->FunctionNumber, - (UINT64) (UINTN) PciIoDevice->PciIo.RomImage, + PciIoDevice->PciIo.RomImage, PciIoDevice->PciIo.RomSize ); } @@ -307,14 +308,19 @@ RegisterPciDevice ( PciIoDevice->BusNumber, PciIoDevice->DeviceNumber, PciIoDevice->FunctionNumber, - (UINT64) (UINTN) PciIoDevice->PciIo.RomImage, + PciIoDevice->PciIo.RomImage, PciIoDevice->PciIo.RomSize ); } } } - if (PciIoDevice->HasEfiOpRom) { + // + // Determine if there are EFI images in the option rom + // + HasEfiImage = ContainEfiImage (PciIoDevice->PciIo.RomImage, PciIoDevice->PciIo.RomSize); + + if (HasEfiImage) { Status = gBS->InstallMultipleProtocolInterfaces ( &PciIoDevice->Handle, &gEfiLoadFile2ProtocolGuid, @@ -344,7 +350,7 @@ RegisterPciDevice ( // The OpRom is got from platform in the above code // or loaded from device in the previous round of bus enumeration // - if (PciIoDevice->HasEfiOpRom) { + if (HasEfiImage) { ProcessOpRomImage (PciIoDevice); } } @@ -368,7 +374,7 @@ RegisterPciDevice ( &PciIoDevice->PciIo, NULL ); - if (PciIoDevice->HasEfiOpRom) { + if (HasEfiImage) { gBS->UninstallMultipleProtocolInterfaces ( &PciIoDevice->Handle, &gEfiLoadFile2ProtocolGuid, @@ -705,7 +711,7 @@ StartPciDevicesOnBridge ( 0, &Supports ); - Supports &= EFI_PCI_DEVICE_ENABLE; + Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE; PciIoDevice->PciIo.Attributes ( &(PciIoDevice->PciIo), EfiPciIoAttributeOperationEnable, @@ -757,7 +763,7 @@ StartPciDevicesOnBridge ( 0, &Supports ); - Supports &= EFI_PCI_DEVICE_ENABLE; + Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE; PciIoDevice->PciIo.Attributes ( &(PciIoDevice->PciIo), EfiPciIoAttributeOperationEnable,