mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-09 13:26:48 +00:00
Rename print in framework to early_print
This commit is contained in:
parent
34e66a51d9
commit
d809eca81d
@ -5,14 +5,14 @@ pub fn print(args: Arguments) {
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! print {
|
||||
macro_rules! early_print {
|
||||
($fmt: literal $(, $($arg: tt)+)?) => {
|
||||
$crate::console::print(format_args!($fmt $(, $($arg)+)?))
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! println {
|
||||
macro_rules! early_println {
|
||||
($fmt: literal $(, $($arg: tt)+)?) => {
|
||||
$crate::console::print(format_args!(concat!($fmt, "\n") $(, $($arg)+)?))
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ pub fn init() {
|
||||
#[cfg(feature = "intel_tdx")]
|
||||
let td_info = init_tdx().unwrap();
|
||||
#[cfg(feature = "intel_tdx")]
|
||||
println!(
|
||||
early_println!(
|
||||
"td gpaw: {}, td attributes: {:?}\nTDX guest is initialized",
|
||||
td_info.gpaw,
|
||||
td_info.attributes
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::{config::DEFAULT_LOG_LEVEL, println};
|
||||
use crate::{config::DEFAULT_LOG_LEVEL, early_println};
|
||||
|
||||
use log::{Metadata, Record};
|
||||
|
||||
@ -13,7 +13,7 @@ impl log::Log for Logger {
|
||||
|
||||
fn log(&self, record: &Record) {
|
||||
if self.enabled(record.metadata()) {
|
||||
println!("[{}]: {}", record.level(), record.args());
|
||||
early_println!("[{}]: {}", record.level(), record.args());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@ use alloc::{boxed::Box, string::ToString};
|
||||
use core::ffi::c_void;
|
||||
|
||||
use crate::arch::qemu::{exit_qemu, QemuExitCode};
|
||||
use crate::{print, println};
|
||||
use crate::{early_print, early_println};
|
||||
use log::error;
|
||||
|
||||
extern crate cfg_if;
|
||||
@ -36,8 +36,8 @@ fn panic_handler(info: &core::panic::PanicInfo) -> ! {
|
||||
// If the exception is not caught (e.g. by ktest) and resumed,
|
||||
// then print the information and abort.
|
||||
error!("Uncaught panic!");
|
||||
println!("{}", info);
|
||||
println!("printing stack trace:");
|
||||
early_println!("{}", info);
|
||||
early_println!("printing stack trace:");
|
||||
print_stack_trace();
|
||||
abort();
|
||||
}
|
||||
@ -51,7 +51,7 @@ fn print_stack_trace() {
|
||||
data.counter += 1;
|
||||
let pc = _Unwind_GetIP(unwind_ctx);
|
||||
let fde_initial_address = _Unwind_FindEnclosingFunction(pc as *mut c_void) as usize;
|
||||
println!(
|
||||
early_println!(
|
||||
"{:4}: fn {:#18x} - pc {:#18x} / registers:",
|
||||
data.counter, fde_initial_address, pc,
|
||||
);
|
||||
@ -67,11 +67,11 @@ fn print_stack_trace() {
|
||||
}
|
||||
}
|
||||
if i % 4 == 0 {
|
||||
print!("\n ");
|
||||
early_print!("\n ");
|
||||
}
|
||||
print!(" {} {:#18x};", reg_name, reg_i);
|
||||
early_print!(" {} {:#18x};", reg_name, reg_i);
|
||||
}
|
||||
print!("\n\n");
|
||||
early_print!("\n\n");
|
||||
UnwindReasonCode::NO_REASON
|
||||
}
|
||||
let mut data = CallbackData { counter: 0 };
|
||||
|
@ -5,12 +5,12 @@
|
||||
// #![forbid(unsafe_code)]
|
||||
extern crate jinux_frame;
|
||||
|
||||
use jinux_frame::println;
|
||||
use jinux_frame::early_println;
|
||||
|
||||
#[export_name = "jinux_main"]
|
||||
pub fn main() -> ! {
|
||||
jinux_frame::init();
|
||||
println!("[kernel] finish init jinux_frame");
|
||||
early_println!("[kernel] finish init jinux_frame");
|
||||
component::init_all(component::parse_metadata!()).unwrap();
|
||||
jinux_std::init();
|
||||
jinux_std::run_first_process();
|
||||
|
Loading…
x
Reference in New Issue
Block a user