Properly end process on error

master
Harry Cheng 5 years ago
parent 88e4c2c178
commit b4b3cd20b2

@ -18,17 +18,18 @@ pub fn timer() {
processor().tick();
}
pub fn error(tf: &TrapFrame) -> ! {
pub fn error(tf: &mut TrapFrame) -> ! {
use crate::arch::syscall::*;
error!("{:#x?}", tf);
let tid = processor().tid();
error!("On CPU{} Thread {}", cpu::id(), tid);
processor().manager().exit(tid, 0x100);
processor().yield_now();
crate::syscall::syscall(SYS_EXIT_GROUP, [0x100, 0, 0, 0, 0, 0], tf);
unreachable!();
}
pub fn serial(c: char) {
trace!("Serial input: {:X}", c as u8);
if c == '\r' {
// in linux, we use '\n' instead
crate::fs::STDIN.push('\n');

Loading…
Cancel
Save