Centralize global scheme constructors.

This commit is contained in:
4lDO2
2023-09-06 23:16:05 +02:00
parent ce313ba28d
commit f6002e839d
2 changed files with 12 additions and 0 deletions
+3
View File
@@ -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));
+9
View File
@@ -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();
}