Avoid deadlocks in println/serial_println

This commit is contained in:
Philipp Oppermann
2018-10-20 16:44:40 +02:00
parent 68ffc3cd59
commit 66d940559f
4 changed files with 118 additions and 7 deletions

View File

@@ -11,10 +11,14 @@ lazy_static! {
pub fn print(args: ::core::fmt::Arguments) {
use core::fmt::Write;
SERIAL1
.lock()
.write_fmt(args)
.expect("Printing to serial failed");
use x86_64::instructions::interrupts;
interrupts::without_interrupts(|| {
SERIAL1
.lock()
.write_fmt(args)
.expect("Printing to serial failed");
});
}
/// Prints to the host through the serial interface.