mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 08:06:32 +00:00
初始化riscv的内存管理模块,并且设置保留内存 (#506)
This commit is contained in:
@ -116,9 +116,10 @@ pub struct Logger;
|
||||
|
||||
impl Logger {
|
||||
pub fn log(&self, log_level: usize, message: fmt::Arguments) {
|
||||
if unsafe { !KMSG.is_none() } {
|
||||
if unsafe { KMSG.is_some() } {
|
||||
let timestamp: TimeSpec = TimeSpec::now();
|
||||
let log_level = LogLevel::from(log_level.clone());
|
||||
|
||||
let log_message = LogMessage::new(timestamp, log_level, message.to_string());
|
||||
|
||||
unsafe { KMSG.as_ref().unwrap().lock_irqsave().push(log_message) };
|
||||
|
Reference in New Issue
Block a user