2018-07-16 20:23:02 +04:00
|
|
|
use process::*;
|
|
|
|
use arch::interrupt::TrapFrame;
|
2018-10-23 20:27:25 +04:00
|
|
|
use arch::cpu;
|
2018-07-12 20:00:42 +04:00
|
|
|
|
|
|
|
pub fn timer() {
|
2018-10-23 20:27:25 +04:00
|
|
|
processor().tick();
|
2018-07-12 20:00:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn before_return() {
|
2018-07-16 20:23:02 +04:00
|
|
|
}
|
|
|
|
|
2018-07-17 08:07:21 +04:00
|
|
|
pub fn error(tf: &TrapFrame) -> ! {
|
2018-10-23 20:27:25 +04:00
|
|
|
let pid = processor().pid();
|
|
|
|
error!("On CPU{} Process {}:\n{:#x?}", cpu::id(), pid, tf);
|
|
|
|
|
|
|
|
processor().manager().set_status(pid, Status::Exited(0x100));
|
|
|
|
processor().yield_now();
|
|
|
|
unreachable!();
|
2018-07-12 20:00:42 +04:00
|
|
|
}
|