Revision: 13950
          http://edk2.svn.sourceforge.net/edk2/?rev=13950&view=rev
Author:   vanjeff
Date:     2012-11-17 06:44:50 +0000 (Sat, 17 Nov 2012)
Log Message:
-----------
Sync patch r13944 from main trunk.
Remove 0xc8000 check when searching PNP header. Remove the check about the size 
of Init code when validating if PCI 3.0 OPROM is successfully started.

Revision Links:
--------------
    http://edk2.svn.sourceforge.net/edk2/?rev=13944&view=rev

Modified Paths:
--------------
    branches/UDK2010.SR1/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyPci.c

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

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to