mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-29 04:13:24 +00:00
Enable IRQs before leaving the OSTD boot routine
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
20d5212910
commit
491e4325fa
@ -119,6 +119,7 @@ fn ap_early_entry(local_apic_id: u32) -> ! {
|
||||
}
|
||||
|
||||
trap::init();
|
||||
crate::arch::irq::enable_local();
|
||||
|
||||
// Mark the AP as started.
|
||||
let ap_boot_info = AP_BOOT_INFO.get().unwrap();
|
||||
|
@ -86,6 +86,8 @@ pub fn init() {
|
||||
|
||||
mm::kspace::activate_kernel_page_table();
|
||||
|
||||
arch::irq::enable_local();
|
||||
|
||||
invoke_ffi_init_funcs();
|
||||
}
|
||||
|
||||
|
@ -172,18 +172,3 @@ impl Drop for DisabledLocalIrqGuard {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Enables all IRQs on the current CPU.
|
||||
///
|
||||
/// 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();
|
||||
}
|
||||
}
|
||||
|
@ -11,9 +11,7 @@ pub use softirq::SoftIrqLine;
|
||||
pub use trapframe::TrapFrame;
|
||||
|
||||
pub(crate) use self::handler::call_irq_callback_functions;
|
||||
pub use self::irq::{
|
||||
disable_local, enable_local, DisabledLocalIrqGuard, IrqCallbackFunction, IrqLine,
|
||||
};
|
||||
pub use self::irq::{disable_local, DisabledLocalIrqGuard, IrqCallbackFunction, IrqLine};
|
||||
|
||||
pub(crate) fn init() {
|
||||
unsafe {
|
||||
|
Reference in New Issue
Block a user