1 use crate::include::bindings::bindings::{process_control_block, switch_proc}; 2 3 use core::sync::atomic::compiler_fence; 4 5 /// @brief 切换进程的上下文(没有切换页表的动作) 6 /// 7 /// @param next 下一个进程的pcb 8 /// @param trap_frame 中断上下文的栈帧 9 #[inline(always)] switch_process( prev: &'static mut process_control_block, next: &'static mut process_control_block, )10pub fn switch_process( 11 prev: &'static mut process_control_block, 12 next: &'static mut process_control_block, 13 ) { 14 compiler_fence(core::sync::atomic::Ordering::SeqCst); 15 unsafe { 16 switch_proc(prev, next); 17 } 18 compiler_fence(core::sync::atomic::Ordering::SeqCst); 19 } 20