mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +00:00
Kernel/VirtIO: Introduce the concept of transport options
The VirtIO specification defines many types of devices with different purposes, and it also defines 3 possible transport mediums where devices could be connected to the host machine. We only care about the PCIe transport, but this commit puts the actual foundations for supporting the lean MMIO transport too in the future. To ensure things are kept abstracted but still functional, the VirtIO transport code is responsible for what is deemed as related to an actual transport type - allocation of interrupt handlers and tinkering with low level transport-related registers, etc.
This commit is contained in:
parent
68c3f9aa5a
commit
d61c23569e
24 changed files with 732 additions and 429 deletions
22
Kernel/Bus/VirtIO/Transport/InterruptHandler.cpp
Normal file
22
Kernel/Bus/VirtIO/Transport/InterruptHandler.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Liav A. <liavalb@hotmail.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <Kernel/Bus/VirtIO/Device.h>
|
||||
#include <Kernel/Bus/VirtIO/Transport/InterruptHandler.h>
|
||||
|
||||
namespace Kernel::VirtIO {
|
||||
|
||||
TransportInterruptHandler::TransportInterruptHandler(VirtIO::Device& parent_device)
|
||||
: m_parent_device(parent_device)
|
||||
{
|
||||
}
|
||||
|
||||
bool TransportInterruptHandler::notify_parent_device_on_interrupt()
|
||||
{
|
||||
return m_parent_device.handle_irq({});
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue