]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Remove 0xc8000 check when searching PNP header. Remove the check about the size of...
authorli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 15 Nov 2012 02:10:44 +0000 (02:10 +0000)
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 15 Nov 2012 02:10:44 +0000 (02:10 +0000)
Signed-off-by: Li Elvin <elvin.li@intel.com>
Reviewed-by: Ni Ruiyu <ruiyu.ni@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13944 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyPci.c

index e32ebacd9404ea4fb55cc28b732f549286e75fe1..910ed41b37911773d2d84e35e274b8c0c70abaf3 100644 (file)
@@ -1500,54 +1500,52 @@ UpdateBevBcvTable (
     }\r
   }\r
 \r
-  if (PciPtr >= (EFI_LEGACY_EXPANSION_ROM_HEADER *) ((UINTN) 0xc8000)) {\r
-    while (TRUE) {\r
-      Status    = FindNextPnpExpansionHeader (Private, Instance, &PnpPtr);\r
-      Instance  = NOT_FIRST_INSTANCE;\r
-      if (EFI_ERROR (Status)) {\r
-        break;\r
-      }\r
-      //\r
-      // There can be additional $PnP headers within the OPROM.\r
-      // Example: SCSI can have one per drive.\r
-      //\r
-      BbsTable[BbsIndex].BootPriority             = BBS_UNPRIORITIZED_ENTRY;\r
-      BbsTable[BbsIndex].DeviceType               = DeviceType;\r
-      BbsTable[BbsIndex].Bus                      = (UINT32) Bus;\r
-      BbsTable[BbsIndex].Device                   = (UINT32) Device;\r
-      BbsTable[BbsIndex].Function                 = (UINT32) Function;\r
-      BbsTable[BbsIndex].StatusFlags.OldPosition  = 0;\r
-      BbsTable[BbsIndex].StatusFlags.Reserved1    = 0;\r
-      BbsTable[BbsIndex].StatusFlags.Enabled      = 0;\r
-      BbsTable[BbsIndex].StatusFlags.Failed       = 0;\r
-      BbsTable[BbsIndex].StatusFlags.MediaPresent = 0;\r
-      BbsTable[BbsIndex].StatusFlags.Reserved2    = 0;\r
-      BbsTable[BbsIndex].Class                    = PnpPtr->Class;\r
-      BbsTable[BbsIndex].SubClass                 = PnpPtr->SubClass;\r
-      BbsTable[BbsIndex].DescStringOffset         = PnpPtr->ProductNamePointer;\r
-      BbsTable[BbsIndex].DescStringSegment        = mBbsRomSegment;\r
-      BbsTable[BbsIndex].MfgStringOffset          = PnpPtr->MfgPointer;\r
-      BbsTable[BbsIndex].MfgStringSegment         = mBbsRomSegment;\r
-      BbsTable[BbsIndex].BootHandlerSegment       = mBbsRomSegment;\r
-\r
-      //\r
-      // Have seen case where PXE base code have PnP expansion ROM\r
-      // header but no Bcv or Bev vectors.\r
-      //\r
-      if (PnpPtr->Bcv != 0) {\r
-        BbsTable[BbsIndex].BootHandlerOffset = PnpPtr->Bcv;\r
-        ++BbsIndex;\r
-      }\r
+  while (TRUE) {\r
+    Status    = FindNextPnpExpansionHeader (Private, Instance, &PnpPtr);\r
+    Instance  = NOT_FIRST_INSTANCE;\r
+    if (EFI_ERROR (Status)) {\r
+      break;\r
+    }\r
+    //\r
+    // There can be additional $PnP headers within the OPROM.\r
+    // Example: SCSI can have one per drive.\r
+    //\r
+    BbsTable[BbsIndex].BootPriority             = BBS_UNPRIORITIZED_ENTRY;\r
+    BbsTable[BbsIndex].DeviceType               = DeviceType;\r
+    BbsTable[BbsIndex].Bus                      = (UINT32) Bus;\r
+    BbsTable[BbsIndex].Device                   = (UINT32) Device;\r
+    BbsTable[BbsIndex].Function                 = (UINT32) Function;\r
+    BbsTable[BbsIndex].StatusFlags.OldPosition  = 0;\r
+    BbsTable[BbsIndex].StatusFlags.Reserved1    = 0;\r
+    BbsTable[BbsIndex].StatusFlags.Enabled      = 0;\r
+    BbsTable[BbsIndex].StatusFlags.Failed       = 0;\r
+    BbsTable[BbsIndex].StatusFlags.MediaPresent = 0;\r
+    BbsTable[BbsIndex].StatusFlags.Reserved2    = 0;\r
+    BbsTable[BbsIndex].Class                    = PnpPtr->Class;\r
+    BbsTable[BbsIndex].SubClass                 = PnpPtr->SubClass;\r
+    BbsTable[BbsIndex].DescStringOffset         = PnpPtr->ProductNamePointer;\r
+    BbsTable[BbsIndex].DescStringSegment        = mBbsRomSegment;\r
+    BbsTable[BbsIndex].MfgStringOffset          = PnpPtr->MfgPointer;\r
+    BbsTable[BbsIndex].MfgStringSegment         = mBbsRomSegment;\r
+    BbsTable[BbsIndex].BootHandlerSegment       = mBbsRomSegment;\r
+\r
+    //\r
+    // Have seen case where PXE base code have PnP expansion ROM\r
+    // header but no Bcv or Bev vectors.\r
+    //\r
+    if (PnpPtr->Bcv != 0) {\r
+      BbsTable[BbsIndex].BootHandlerOffset = PnpPtr->Bcv;\r
+      ++BbsIndex;\r
+    }\r
 \r
-      if (PnpPtr->Bev != 0) {\r
-        BbsTable[BbsIndex].BootHandlerOffset  = PnpPtr->Bev;\r
-        BbsTable[BbsIndex].DeviceType         = BBS_BEV_DEVICE;\r
-        ++BbsIndex;\r
-      }\r
+    if (PnpPtr->Bev != 0) {\r
+      BbsTable[BbsIndex].BootHandlerOffset  = PnpPtr->Bev;\r
+      BbsTable[BbsIndex].DeviceType         = BBS_BEV_DEVICE;\r
+      ++BbsIndex;\r
+    }\r
 \r
-      if ((PnpPtr == (LEGACY_PNP_EXPANSION_HEADER *) PciPtr) || (PnpPtr > (LEGACY_PNP_EXPANSION_HEADER *) RomEnd)) {\r
-        break;\r
-      }\r
+    if ((PnpPtr == (LEGACY_PNP_EXPANSION_HEADER *) PciPtr) || (PnpPtr > (LEGACY_PNP_EXPANSION_HEADER *) RomEnd)) {\r
+      break;\r
     }\r
   }\r
 \r
@@ -2557,10 +2555,10 @@ LegacyBiosInstallRom (
   //\r
   // The ROM could have updated it's size so we need to read again.\r
   //\r
-  if ((((EFI_LEGACY_EXPANSION_ROM_HEADER *) RuntimeAddress)->Signature != PCI_EXPANSION_ROM_HEADER_SIGNATURE) &&\r
-      (((EFI_LEGACY_EXPANSION_ROM_HEADER *) InitAddress)->Size512 == 0)) {\r
+  if (((EFI_LEGACY_EXPANSION_ROM_HEADER *) RuntimeAddress)->Signature != PCI_EXPANSION_ROM_HEADER_SIGNATURE) {\r
     //\r
-    // The INIT function didn't copy the RUNTIME code to RuntimeAddress\r
+    // Now we check the signature (0xaa55) to judge whether the run-time code is truly generated by INIT function.\r
+    // If signature is not valid, that means the INIT function didn't copy the run-time code to RuntimeAddress.\r
     //\r
     *RuntimeImageLength = 0;\r
   } else {\r