mirror of
https://github.com/rcore-os/rCore.git
synced 2024-11-23 00:16:17 +04:00
Tiny changes
This commit is contained in:
parent
71e49e3959
commit
25dde04795
@ -56,6 +56,9 @@ impl TrapFrame {
|
|||||||
tf.rflags = 0x282;
|
tf.rflags = 0x282;
|
||||||
tf
|
tf
|
||||||
}
|
}
|
||||||
|
pub fn is_user(&self) -> bool {
|
||||||
|
self.cs & 0x3 == 0x3
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
|
@ -68,7 +68,10 @@ impl Log for SimpleLogger {
|
|||||||
// metadata.level() <= Level::Info
|
// metadata.level() <= Level::Info
|
||||||
}
|
}
|
||||||
fn log(&self, record: &Record) {
|
fn log(&self, record: &Record) {
|
||||||
if self.enabled(record.metadata()) {
|
static DISABLED_TARGET: &[&str] = &[
|
||||||
|
"rust_ucore::process::scheduler::rr",
|
||||||
|
];
|
||||||
|
if self.enabled(record.metadata()) && !DISABLED_TARGET.contains(&record.target()) {
|
||||||
print_in_color(format_args!("[{}] {}\n", record.target(), record.args()), Color::from(record.level()));
|
print_in_color(format_args!("[{}] {}\n", record.target(), record.args()), Color::from(record.level()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,7 @@ extern fn eh_personality() {
|
|||||||
#[lang = "panic_fmt"]
|
#[lang = "panic_fmt"]
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern fn panic_fmt(fmt: core::fmt::Arguments, file: &'static str, line: u32) -> ! {
|
pub extern fn panic_fmt(fmt: core::fmt::Arguments, file: &'static str, line: u32) -> ! {
|
||||||
error!("\n\nPANIC in {} at line {}:", file, line);
|
error!("\n\nPANIC in {} at line {}\n {}", file, line, fmt);
|
||||||
error!(" {}", fmt);
|
|
||||||
if cfg!(feature = "qemu_auto_exit") {
|
if cfg!(feature = "qemu_auto_exit") {
|
||||||
unsafe{ cpu::exit_in_qemu(3) }
|
unsafe{ cpu::exit_in_qemu(3) }
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user