mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +00:00
Kernel/PCI: Convert PCI BAR number to a strong typed enum class
This commit is contained in:
parent
f510c0ba04
commit
bb6f61ee5d
10 changed files with 26 additions and 17 deletions
|
@ -20,7 +20,7 @@ UNMAP_AFTER_INIT void PCISerialDevice::detect()
|
|||
if (board_definition.device_id != device_identifier.hardware_id())
|
||||
continue;
|
||||
|
||||
auto bar_base = PCI::get_BAR(device_identifier.address(), board_definition.pci_bar) & ~1;
|
||||
auto bar_base = PCI::get_BAR(device_identifier.address(), static_cast<PCI::HeaderType0BaseRegister>(board_definition.pci_bar)) & ~1;
|
||||
auto port_base = IOAddress(bar_base + board_definition.first_offset);
|
||||
for (size_t i = 0; i < board_definition.port_count; i++) {
|
||||
auto serial_device = new SerialDevice(port_base.offset(board_definition.port_size * i), current_device_minor++);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue