Author: sginsberg
Date: Mon Nov  2 22:13:45 2009
New Revision: 43924

URL: http://svn.reactos.org/svn/reactos?rev=43924&view=rev
Log:
- Fix a FreeLdr PCI detection bug introduced in revision 10742 5 years ago when 
PCI detection was added. FindPciBios was setting the HardwareMechanism entry in 
the PCI_REGISTRY_INFO structure (then called CM_PCI_BUS_DATA) to the wrong 
register returned from the PCI BIOS: CL instead of AL. CL is the number of the 
last PCI bus in the system (0 if you only have 1 bus, 1 if you have 2 buses). 
AL contains bit-fields for PCI characteristics, and HAL checks the 2 first bits 
to determine the type of the BUS. My VMWare test environment has 2 PCI buses, 
so the number happened to be correct. This doesn't work if there is only 1 PCI 
bus, such as in QEMU and Vbox, as we then get an invalid PCI type of 0. Fix 
this and re-enable the PCI detection in HAL to properly detect the PCI type 
instead of assuming type 1.

Modified:
    trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c
    trunk/reactos/hal/halx86/generic/bus/pcibus.c

Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c?rev=43924&r1=43923&r2=43924&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c [iso-8859-1] Mon Nov  
2 22:13:45 2009
@@ -132,7 +132,7 @@
       BusData->NoBuses = RegsOut.b.cl + 1;
       BusData->MajorRevision = RegsOut.b.bh;
       BusData->MinorRevision = RegsOut.b.bl;
-      BusData->HardwareMechanism = RegsOut.b.cl;
+      BusData->HardwareMechanism = RegsOut.b.al;
 
       return TRUE;
     }

Modified: trunk/reactos/hal/halx86/generic/bus/pcibus.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/bus/pcibus.c?rev=43924&r1=43923&r2=43924&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/bus/pcibus.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/bus/pcibus.c [iso-8859-1] Mon Nov  2 
22:13:45 2009
@@ -938,11 +938,7 @@
     ULONG VendorId = 0;
 
     /* Query registry information */
-#ifdef WORKED_FOR_ME
     PciRegistryInfo = HalpQueryPciRegistryInfo();
-#else
-    PciRegistryInfo = NULL;
-#endif
     if (!PciRegistryInfo)
     {
         /* Assume type 1 */


Reply via email to