mirror of
https://github.com/sgmarz/osblog.git
synced 2024-11-24 02:16:19 +04:00
Clean up context switch code.
This commit is contained in:
parent
ba661749fc
commit
e811451879
@ -52,26 +52,10 @@ extern "C" fn m_trap(epc: usize,
|
|||||||
// process to run.
|
// process to run.
|
||||||
// Machine timer
|
// Machine timer
|
||||||
let new_frame = schedule();
|
let new_frame = schedule();
|
||||||
// let p = frame as *const TrapFrame;
|
|
||||||
// println!(
|
|
||||||
// "CTX Startup {}, pc = {:x}",
|
|
||||||
// (*p).pid,
|
|
||||||
// (*p).pc
|
|
||||||
// );
|
|
||||||
// print!(" ");
|
|
||||||
// for i in 1..32 {
|
|
||||||
// if i % 4 == 0 {
|
|
||||||
// println!();
|
|
||||||
// print!(" ");
|
|
||||||
// }
|
|
||||||
// print!("{:2}:{:08x} ", i, (*p).regs[i]);
|
|
||||||
// }
|
|
||||||
// println!();
|
|
||||||
schedule_next_context_switch(1);
|
schedule_next_context_switch(1);
|
||||||
if new_frame != 0 {
|
if new_frame != 0 {
|
||||||
rust_switch_to_user(new_frame);
|
rust_switch_to_user(new_frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
11 => {
|
11 => {
|
||||||
// Machine external (interrupt from Platform Interrupt Controller (PLIC))
|
// Machine external (interrupt from Platform Interrupt Controller (PLIC))
|
||||||
|
Loading…
Reference in New Issue
Block a user