mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 22:38:12 +00:00
Kernel: Add various methods to handle interrupts in the PCI subsystem
For now, we only are able to enable or disable pin based interrupts. Later, when implemented, we could utilize MSI & MSI-X interrupts.
This commit is contained in:
parent
97b36febd5
commit
cf0a12c68f
2 changed files with 54 additions and 0 deletions
|
@ -34,5 +34,48 @@ DeviceController::DeviceController(Address address)
|
|||
{
|
||||
}
|
||||
|
||||
bool DeviceController::is_msi_capable() const
|
||||
{
|
||||
for (auto capability : PCI::get_physical_id(pci_address()).capabilities()) {
|
||||
if (capability.m_id == 0x5)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool DeviceController::is_msix_capable() const
|
||||
{
|
||||
for (auto capability : PCI::get_physical_id(pci_address()).capabilities()) {
|
||||
if (capability.m_id == 0x11)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void DeviceController::enable_pin_based_interrupts() const
|
||||
{
|
||||
PCI::enable_interrupt_line(pci_address());
|
||||
}
|
||||
void DeviceController::disable_pin_based_interrupts() const
|
||||
{
|
||||
PCI::disable_interrupt_line(pci_address());
|
||||
}
|
||||
|
||||
void DeviceController::enable_message_signalled_interrupts()
|
||||
{
|
||||
TODO();
|
||||
}
|
||||
void DeviceController::disable_message_signalled_interrupts()
|
||||
{
|
||||
TODO();
|
||||
}
|
||||
void DeviceController::enable_extended_message_signalled_interrupts()
|
||||
{
|
||||
TODO();
|
||||
}
|
||||
void DeviceController::disable_extended_message_signalled_interrupts()
|
||||
{
|
||||
TODO();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue