Skip to content

Commit

Permalink
Fix print_emergency in kernel log to disable interrupts. (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbittman authored Jun 29, 2024
1 parent 8aee030 commit 623c834
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/kernel/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,13 @@ pub fn _print_normal(args: ::core::fmt::Arguments) {
}

pub fn _print_emergency(args: ::core::fmt::Arguments) {
let istate = interrupt::disable();
unsafe {
EMERGENCY_CONSOLE
.write_fmt(args)
.expect("printing to serial failed");
}
interrupt::set(istate);
}

#[macro_export]
Expand Down

0 comments on commit 623c834

Please sign in to comment.