[PCI]
authorEric Kohl <eric.kohl@reactos.org>
Wed, 27 Sep 2017 22:59:48 +0000 (22:59 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Wed, 27 Sep 2017 22:59:48 +0000 (22:59 +0000)
Fix a port base adddress decoding bug. Port base addresses were always decoded like memory base addresses. Because of this bug, a device could have two port address ranges starting at the same base address but with different lengths.

svn path=/trunk/; revision=75981

reactos/drivers/bus/pci/pdo.c

index 7448fd2..bedaac3 100644 (file)
@@ -355,7 +355,9 @@ PdoGetRangeLength(PPDO_DEVICE_EXTENSION DeviceExtension,
         return TRUE;
     }
 
-    *Base = OriginalValue.Bar & PCI_ADDRESS_MEMORY_ADDRESS_MASK_64;
+    *Base = ((OriginalValue.Bar & PCI_ADDRESS_IO_SPACE)
+             ? (OriginalValue.Bar & PCI_ADDRESS_IO_ADDRESS_MASK_64)
+             : (OriginalValue.Bar & PCI_ADDRESS_MEMORY_ADDRESS_MASK_64));
 
     *Length = ~((NewValue.Bar & PCI_ADDRESS_IO_SPACE)
                 ? (NewValue.Bar & PCI_ADDRESS_IO_ADDRESS_MASK_64)