From 8e5e798d784101743e82a605175d307c6b801062 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Mon, 3 Jun 2019 09:47:57 +0800 Subject: [PATCH] Do not print to graphci console unless graphic=console on aarch64 --- kernel/src/arch/aarch64/io.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kernel/src/arch/aarch64/io.rs b/kernel/src/arch/aarch64/io.rs index 312e8960..43ddd613 100644 --- a/kernel/src/arch/aarch64/io.rs +++ b/kernel/src/arch/aarch64/io.rs @@ -13,8 +13,12 @@ pub fn putfmt(fmt: Arguments) { unsafe { SERIAL_PORT.force_unlock() } SERIAL_PORT.lock().write_fmt(fmt).unwrap(); - unsafe { CONSOLE.force_unlock() } - if let Some(console) = CONSOLE.lock().as_mut() { - console.write_fmt(fmt).unwrap(); + // print to graphic + #[cfg(feature = "consolegraphic")] + { + unsafe { CONSOLE.force_unlock() } + if let Some(console) = CONSOLE.lock().as_mut() { + console.write_fmt(fmt).unwrap(); + } } }