pub struct TaskControlBlock {
    pub task_cx: TaskContext,
    pub task_status: TaskStatus,
    pub memory_set: MemorySet,
    pub trap_cx_ppn: PhysPageNum,
    pub base_size: usize,
    pub heap_bottom: usize,
    pub program_brk: usize,
}
Expand description

The task control block (TCB) of a task.

Fields

task_cx: TaskContext

Save task context

task_status: TaskStatus

Maintain the execution status of the current process

memory_set: MemorySet

Application address space

trap_cx_ppn: PhysPageNum

The phys page number of trap context

base_size: usize

The size(top addr) of program which is loaded from elf file

heap_bottom: usize

Heap bottom

program_brk: usize

Program break

Implementations

get the trap context

get the user token

Based on the elf info in program, build the contents of task in a new address space

change the location of the program break. return None if failed.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.