mirror of
https://github.com/reactos/reactos.git
synced 2024-12-26 17:14:41 +00:00
[PCI] Fix I/O range size of the resource descriptors
Fixes incorrect PCI IDE resources in VPC 2007 CORE-17256
This commit is contained in:
parent
d3a718eb01
commit
3dd3d10531
1 changed files with 5 additions and 3 deletions
|
@ -283,6 +283,7 @@ PdoGetRangeLength(PPDO_DEVICE_EXTENSION DeviceExtension,
|
|||
ULONGLONG Bar;
|
||||
} NewValue;
|
||||
ULONG Offset;
|
||||
ULONGLONG Size;
|
||||
|
||||
/* Compute the offset of this BAR in PCI config space */
|
||||
Offset = 0x10 + Bar * 4;
|
||||
|
@ -359,9 +360,10 @@ PdoGetRangeLength(PPDO_DEVICE_EXTENSION DeviceExtension,
|
|||
? (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)
|
||||
: (NewValue.Bar & PCI_ADDRESS_MEMORY_ADDRESS_MASK_64)) + 1;
|
||||
Size = (NewValue.Bar & PCI_ADDRESS_IO_SPACE)
|
||||
? (NewValue.Bar & PCI_ADDRESS_IO_ADDRESS_MASK_64)
|
||||
: (NewValue.Bar & PCI_ADDRESS_MEMORY_ADDRESS_MASK_64);
|
||||
*Length = Size & ~(Size - 1);
|
||||
|
||||
*Flags = (NewValue.Bar & PCI_ADDRESS_IO_SPACE)
|
||||
? (NewValue.Bar & ~PCI_ADDRESS_IO_ADDRESS_MASK_64)
|
||||
|
|
Loading…
Reference in a new issue