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