Add print macros, and use them for panic handling.
Bug: 223166344
Test: Ran unprotected VM under crosvm.
Change-Id: I2314d417f485a6bd9aad2d6816fef42747eab194
diff --git a/pvmfw/src/main.rs b/pvmfw/src/main.rs
index 7156213..4ab14b7 100644
--- a/pvmfw/src/main.rs
+++ b/pvmfw/src/main.rs
@@ -21,7 +21,6 @@
mod psci;
mod uart;
-use console::emergency_write_str;
use core::panic::PanicInfo;
use psci::{system_off, system_reset};
@@ -29,7 +28,7 @@
#[no_mangle]
pub extern "C" fn main() -> ! {
console::init();
- console::write_str("Hello world\n");
+ println!("Hello world");
system_off();
#[allow(clippy::empty_loop)]
@@ -37,8 +36,8 @@
}
#[panic_handler]
-fn panic(_info: &PanicInfo) -> ! {
- emergency_write_str("panic\n");
+fn panic(info: &PanicInfo) -> ! {
+ eprintln!("{}", info);
system_reset();
loop {}
}