1 #include "sched.h" 2 3 /** 4 * @brief 切换进程上下文。请注意,只能在中断上下文内调用本函数 5 * TODO:使用Rust重构这里 6 * @param prev 前一个进程的pcb 7 * @param proc 后一个进程的pcb 8 */ switch_proc(struct process_control_block * prev,struct process_control_block * proc)9void switch_proc(struct process_control_block *prev, struct process_control_block *proc) 10 { 11 process_switch_mm(proc); 12 io_mfence(); 13 switch_to(prev, proc); 14 }