pci: support 64-bit BAR addressing for MSI-X memory mappings
Change-Id: I463de6aeb45d34e68e888a7648546acddb3fd57a Reviewed-on: https://review.haiku-os.org/c/haiku/+/4613 Tested-by: Commit checker robot <[email protected]> Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
d029b0dd9f
commit
b7a1261eef
@@ -361,9 +361,14 @@ pci_configure_msix(uint8 virtualBus, uint8 _device, uint8 function,
|
|||||||
// map the table bar
|
// map the table bar
|
||||||
size_t tableSize = info->message_count * 16;
|
size_t tableSize = info->message_count * 16;
|
||||||
addr_t address;
|
addr_t address;
|
||||||
|
phys_addr_t barAddr = device->info.u.h0.base_registers[info->table_bar];
|
||||||
|
uchar flags = device->info.u.h0.base_register_flags[info->table_bar];
|
||||||
|
if ((flags & PCI_address_type) == PCI_address_type_64) {
|
||||||
|
barAddr |= (uint64)device->info.u.h0.base_registers[
|
||||||
|
info->table_bar + 1] << 32;
|
||||||
|
}
|
||||||
area_id area = map_physical_memory("msi table map",
|
area_id area = map_physical_memory("msi table map",
|
||||||
device->info.u.h0.base_registers[info->table_bar],
|
barAddr, tableSize + info->table_offset,
|
||||||
tableSize + info->table_offset,
|
|
||||||
B_ANY_KERNEL_ADDRESS, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA,
|
B_ANY_KERNEL_ADDRESS, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA,
|
||||||
(void**)&address);
|
(void**)&address);
|
||||||
if (area < 0)
|
if (area < 0)
|
||||||
@@ -373,9 +378,14 @@ pci_configure_msix(uint8 virtualBus, uint8 _device, uint8 function,
|
|||||||
|
|
||||||
// and the pba bar if necessary
|
// and the pba bar if necessary
|
||||||
if (info->table_bar != info->pba_bar) {
|
if (info->table_bar != info->pba_bar) {
|
||||||
|
barAddr = device->info.u.h0.base_registers[info->pba_bar];
|
||||||
|
flags = device->info.u.h0.base_register_flags[info->pba_bar];
|
||||||
|
if ((flags & PCI_address_type) == PCI_address_type_64) {
|
||||||
|
barAddr |= (uint64)device->info.u.h0.base_registers[
|
||||||
|
info->pba_bar + 1] << 32;
|
||||||
|
}
|
||||||
area = map_physical_memory("msi pba map",
|
area = map_physical_memory("msi pba map",
|
||||||
device->info.u.h0.base_registers[info->pba_bar],
|
barAddr, tableSize + info->pba_offset,
|
||||||
tableSize + info->pba_offset,
|
|
||||||
B_ANY_KERNEL_ADDRESS, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA,
|
B_ANY_KERNEL_ADDRESS, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA,
|
||||||
(void**)&address);
|
(void**)&address);
|
||||||
if (area < 0) {
|
if (area < 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user