mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:08:13 +00:00
Kernel: Add MSIInfo struct to PCI DeviceIdentifier
Add a struct named MSIInfo that stores all the relevant MSI information as a part of PCI DeviceIdentifier struct. Populate the MSI struct during the PCI device init.
This commit is contained in:
parent
d1a1b1ab75
commit
09b5cefd43
2 changed files with 30 additions and 2 deletions
|
@ -26,7 +26,15 @@ void DeviceIdentifier::initialize()
|
|||
auto msix_count = (cap.read16(2) & msix_control_table_mask) + 1;
|
||||
m_msix_info = MSIxInfo(msix_count, msix_bir_bar, msix_bir_offset);
|
||||
}
|
||||
|
||||
if (cap.id() == PCI::Capabilities::ID::MSI) {
|
||||
bool message_address_64_bit_format = (cap.read8(msi_control_offset) & msi_address_format_mask);
|
||||
u8 count = 1;
|
||||
u8 mme_count = (cap.read8(msi_control_offset) & msi_mmc_format_mask) >> 1;
|
||||
if (mme_count)
|
||||
count = mme_count;
|
||||
m_msi_info = MSIInfo(message_address_64_bit_format, count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue