xref: /DragonOS/kernel/src/driver/virtio/mod.rs (revision 338f6903262c5031abad3c8e361813355a27fcdb)
1 use core::any::Any;
2 
3 use alloc::sync::Arc;
4 use system_error::SystemError;
5 
6 use crate::exception::{irqdesc::IrqReturn, IrqNumber};
7 
8 use super::base::device::DeviceId;
9 
10 pub(super) mod irq;
11 pub mod transport_pci;
12 pub mod virtio;
13 pub mod virtio_impl;
14 
15 pub trait VirtIODevice: Send + Sync + Any {
16     fn handle_irq(&self, _irq: IrqNumber) -> Result<IrqReturn, SystemError>;
17 
18     fn dev_id(&self) -> &Arc<DeviceId>;
19 }
20