1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-27 02:03:29 +04:00
rCore/kernel/src/trap.rs

14 lines
269 B
Rust
Raw Normal View History

use process::PROCESSOR;
pub fn timer() {
let mut processor = PROCESSOR.try().unwrap().lock();
processor.tick();
}
pub fn before_return() {
use process::PROCESSOR;
if let Some(processor) = PROCESSOR.try() {
processor.lock().schedule();
}
}