]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
Cache the state whether the ROM image contains EFI Option ROM when loading the ROM...
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciDeviceSupport.c
index 8ba5fc57ead108a59ae7f6c473cbd44f6a099f48..0ff39a56c4ceb63884aea80add915476a17be213 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Supporting functions implementaion for PCI devices management.\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -214,7 +214,6 @@ RegisterPciDevice (
   UINT8               PciExpressCapRegOffset;\r
   EFI_PCI_IO_PROTOCOL *PciIo;\r
   UINT8               Data8;\r
-  BOOLEAN             HasEfiImage;\r
 \r
   //\r
   // Install the pciio protocol, device path protocol\r
@@ -315,12 +314,7 @@ RegisterPciDevice (
     }\r
   }\r
 \r
-  //\r
-  // Determine if there are EFI images in the option rom\r
-  //\r
-  HasEfiImage = ContainEfiImage (PciIoDevice->PciIo.RomImage, PciIoDevice->PciIo.RomSize);\r
-\r
-  if (HasEfiImage) {\r
+  if (PciIoDevice->HasEfiOpRom) {\r
     Status = gBS->InstallMultipleProtocolInterfaces (\r
                     &PciIoDevice->Handle,\r
                     &gEfiLoadFile2ProtocolGuid,\r
@@ -350,7 +344,7 @@ RegisterPciDevice (
     // The OpRom is got from platform in the above code\r
     // or loaded from device in the previous round of bus enumeration\r
     //\r
-    if (HasEfiImage) {\r
+    if (PciIoDevice->HasEfiOpRom) {\r
       ProcessOpRomImage (PciIoDevice);\r
     }\r
   }\r
@@ -374,7 +368,7 @@ RegisterPciDevice (
              &PciIoDevice->PciIo,\r
              NULL\r
              );\r
-      if (HasEfiImage) {\r
+      if (PciIoDevice->HasEfiOpRom) {\r
         gBS->UninstallMultipleProtocolInterfaces (\r
                &PciIoDevice->Handle,\r
                &gEfiLoadFile2ProtocolGuid,\r