Expand description
Task context for scheduling
The crate defines the needful fields for task context switching and scheduling.
Content
-
tls
: Thread Local Storage (TLS) area for each task. -
stat
: Task statistics. -
preempt_disable_count
: Preemption disable counter. Only when the counter is zero, the task can be preempted. It can be used to implement preemption protection lock.
Structs
- Extended state of a task, such as FP/SIMD states.
- A 512-byte memory region for the FXSAVE/FXRSTOR instruction to save and restore the x87 FPU, MMX, XMM, and MXCSR registers.
- The status of the scheduler
- Saved hardware states of a task.
- A unique identifier for a thread.
- The inner task structure used as the minimal unit of scheduling.
- 任务时间统计结构
Enums
- The policy of the scheduler
- The possible states of a task.
- sys_settimer / sys_gettimer 中设定的 which,即计时器类型
Functions
- Switches the context from the current task to the next task.
- Gets the pointer to the current task with preemption-safety.
- Disables kernel preemption.
- Enables kernel preemption.
- Sets the pointer to the current task with preemption-safety.