pci/ecam: Fix reading config registers using ACPI method.
Also adjust end-address computation: we read up to 4 bytes past the offset. Change-Id: I76343aba38cddb614394bd0dca1b36094b8dd85e Reviewed-on: https://review.haiku-os.org/c/haiku/+/6469 Reviewed-by: waddlesplash <waddlesplash@gmail.com> Reviewed-by: X512 <danger_mail@list.ru> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This commit is contained in:
parent
769b4ee4aa
commit
19ae638fb6
@ -166,10 +166,7 @@ ECAMPCIController::ConfigAddress(uint8 bus, uint8 device, uint8 function, uint16
|
||||
.device = device,
|
||||
.bus = bus
|
||||
};
|
||||
PciAddressEcam addressEnd = address;
|
||||
addressEnd.offset = /*~(uint32)0*/ 4095;
|
||||
|
||||
if (addressEnd.val >= fRegsLen)
|
||||
if ((address.val + 4) > fRegsLen)
|
||||
return 0;
|
||||
|
||||
return (addr_t)fRegs + address.val;
|
||||
|
@ -57,8 +57,9 @@ ECAMPCIControllerACPI::ReadResourceInfo()
|
||||
uint8 startBusNumber = alloc->start_bus_number;
|
||||
uint8 endBusNumber = alloc->end_bus_number;
|
||||
|
||||
fRegsLen = (endBusNumber - startBusNumber + 1) << 20;
|
||||
fRegsArea.SetTo(map_physical_memory("PCI Config MMIO",
|
||||
alloc->address, (endBusNumber - startBusNumber + 1) << 20, B_ANY_KERNEL_ADDRESS,
|
||||
alloc->address, fRegsLen, B_ANY_KERNEL_ADDRESS,
|
||||
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, (void **)&fRegs));
|
||||
CHECK_RET(fRegsArea.Get());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user