Modify the virtio-blk to async

This commit is contained in:
LI Qing
2024-04-10 16:50:49 +08:00
committed by Tate, Hongliang Tian
parent 2616335755
commit b7131e721c
8 changed files with 263 additions and 207 deletions

View File

@ -156,3 +156,16 @@ impl Drop for DisabledLocalIrqGuard {
}
}
}
/// FIXME: The reason we need to add this API is that currently IRQs
/// are enabled when the CPU enters the user space for the first time,
/// which is too late. During the OS initialization phase,
/// we need to get the block device working and mount the filesystems,
/// thus requiring the IRQs should be enabled as early as possible.
///
/// FIXME: this method may be unsound.
pub fn enable_local() {
if !crate::arch::irq::is_local_enabled() {
crate::arch::irq::enable_local();
}
}

View File

@ -7,7 +7,9 @@ pub use handler::in_interrupt_context;
pub use trapframe::TrapFrame;
pub(crate) use self::handler::call_irq_callback_functions;
pub use self::irq::{disable_local, DisabledLocalIrqGuard, IrqCallbackFunction, IrqLine};
pub use self::irq::{
disable_local, enable_local, DisabledLocalIrqGuard, IrqCallbackFunction, IrqLine,
};
pub(crate) fn init() {
unsafe {