Centralize global scheme constructors.
This commit is contained in:
@@ -178,6 +178,9 @@ fn kmain(cpu_count: u32, bootstrap: Bootstrap) -> ! {
|
||||
//Initialize the first context, stored in kernel/src/context/mod.rs
|
||||
context::init();
|
||||
|
||||
//Initialize global schemes, such as `acpi:`.
|
||||
scheme::init_globals();
|
||||
|
||||
let pid = syscall::getpid();
|
||||
info!("BSP: {:?} {}", pid, cpu_count);
|
||||
info!("Env: {:?}", ::core::str::from_utf8(bootstrap.env));
|
||||
|
||||
@@ -496,3 +496,12 @@ impl GlobalSchemes {
|
||||
SchemeId::new(self as usize)
|
||||
}
|
||||
}
|
||||
|
||||
#[cold]
|
||||
pub fn init_globals() {
|
||||
#[cfg(all(feature = "acpi", any(target_arch = "x86", target_arch = "x86_64")))]
|
||||
{
|
||||
AcpiScheme::init();
|
||||
}
|
||||
IrqScheme::init();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user