os/task/
switch.rs

1use super::TaskContext;
2use core::arch::global_asm;
3
4global_asm!(include_str!("switch.S"));
5
6unsafe extern "C" {
7    /// Switch to the context of `next_task_cx_ptr`, saving the current context
8    /// in `current_task_cx_ptr`.
9    pub unsafe fn __switch(
10        current_task_cx_ptr: *mut TaskContext,
11        next_task_cx_ptr: *const TaskContext,
12    );
13}