]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciLib.c
Fixed NT32 Build break.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / PciBusDxe / PciLib.c
index 7a4684d96d3331b86e8639a6251f1d27cf97a21b..c7423f6f799dddf81522b24b858bce7a5b324035 100644 (file)
@@ -1258,8 +1258,6 @@ Returns:
   SecondBus       = 0;\r
   Register        = 0;\r
 \r
-  ResetAllPpbBusReg (Bridge, StartBusNumber);\r
-\r
   for (Device = 0; Device <= PCI_MAX_DEVICE; Device++) {\r
     for (Func = 0; Func <= PCI_MAX_FUNC; Func++) {\r
 \r
@@ -1278,6 +1276,8 @@ Returns:
           (IS_PCI_BRIDGE (&Pci) ||\r
           IS_CARDBUS_BRIDGE (&Pci))) {\r
 \r
+        DEBUG((EFI_D_ERROR, "Found DEV(%02d,%02d,%02d)\n", StartBusNumber, Device, Func ));\r
+\r
         //\r
         // Get the bridge information\r
         //\r
@@ -1294,6 +1294,14 @@ Returns:
           return Status;\r
         }\r
 \r
+        //\r
+        // Add feature to support customized secondary bus number\r
+        //\r
+               if (*SubBusNumber == 0) {        \r
+          *SubBusNumber   = *PaddedBusRange;\r
+          *PaddedBusRange = 0;\r
+        }\r
+\r
         (*SubBusNumber)++;\r
 \r
         SecondBus = (*SubBusNumber);\r
@@ -1350,6 +1358,7 @@ Returns:
             EfiPciBeforeChildBusEnumeration\r
             );\r
 \r
+          DEBUG((EFI_D_ERROR, "Scan  PPB(%02d,%02d,%02d)\n", PciDevice->BusNumber, PciDevice->DeviceNumber,PciDevice->FunctionNumber ));\r
           Status = PciScanBus (\r
                     PciDevice,\r
                     (UINT8) (SecondBus),\r
@@ -1446,8 +1455,6 @@ Returns:
   Attributes      = (EFI_HPC_PADDING_ATTRIBUTES) 0;\r
   BusRange        = 0;\r
 \r
-  ResetAllPpbBusReg (Bridge, StartBusNumber);\r
-\r
   for (Device = 0; Device <= PCI_MAX_DEVICE; Device++) {\r
     for (Func = 0; Func <= PCI_MAX_FUNC; Func++) {\r
 \r
@@ -1473,6 +1480,8 @@ Returns:
         continue;\r
       }\r
 \r
+      DEBUG((EFI_D_ERROR, "Found DEV(%02d,%02d,%02d)\n", StartBusNumber, Device, Func ));\r
+      \r
       //\r
       // Get the PCI device information\r
       //\r
@@ -1534,7 +1543,6 @@ Returns:
               PciDevice->FunctionNumber,\r
               EfiPciBeforeChildBusEnumeration\r
             );\r
-            continue;\r
           }\r
         }\r
       }\r
@@ -1583,6 +1591,14 @@ Returns:
           }\r
         }\r
 \r
+        //\r
+        // Add feature to support customized secondary bus number\r
+        //\r
+               if (*SubBusNumber == 0) {        \r
+          *SubBusNumber   = *PaddedBusRange;\r
+          *PaddedBusRange = 0;\r
+        }\r
+\r
         (*SubBusNumber)++;\r
         SecondBus = *SubBusNumber;\r
 \r
@@ -1629,6 +1645,7 @@ Returns:
             EfiPciBeforeChildBusEnumeration\r
             );\r
 \r
+          DEBUG((EFI_D_ERROR, "Scan  PPB(%02d,%02d,%02d)\n", PciDevice->BusNumber, PciDevice->DeviceNumber,PciDevice->FunctionNumber ));\r
           Status = PciScanBus (\r
                     PciDevice,\r
                     (UINT8) (SecondBus),\r
@@ -1851,6 +1868,7 @@ Returns:
   //\r
   NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginBusAllocation);\r
 \r
+  DEBUG((EFI_D_ERROR, "PCI Bus First Scanning\n"));\r
   RootBridgeHandle = NULL;\r
   while (PciResAlloc->GetNextRootBridge (PciResAlloc, &RootBridgeHandle) == EFI_SUCCESS) {\r
 \r
@@ -1901,6 +1919,7 @@ Returns:
       //\r
       NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginBusAllocation);\r
 \r
+      DEBUG((EFI_D_ERROR, "PCI Bus Second Scanning\n"));  \r
       RootBridgeHandle = NULL;\r
       while (PciResAlloc->GetNextRootBridge (PciResAlloc, &RootBridgeHandle) == EFI_SUCCESS) {\r
 \r
@@ -2096,7 +2115,7 @@ ReadConfigData (
 \r
        Stride = 1 << AccessWidth;\r
         AccessAddress += Stride;\r
-        if (AccessAddress >= (Address + (1 << Width))) {\r
+        if (AccessAddress >= (Address + LShiftU64 (1ULL, (UINTN)Width))) {\r
           //\r
           // if all datas have been read, exist\r
           //\r
@@ -2363,7 +2382,7 @@ WriteConfigData (
 \r
         Stride = 1 << AccessWidth;\r
         AccessAddress += Stride;\r
-        if (AccessAddress >= (Address + (1 << Width))) {\r
+        if (AccessAddress >= (Address + LShiftU64 (1ULL, (UINTN)Width))) {\r
           //\r
           // if all datas have been written, exist\r
           //\r