Split TaskManager and Processor.

This commit is contained in:
Yifan Wu 2020-12-08 15:37:10 +08:00
parent e538b204ce
commit a9066d75e5
6 changed files with 175 additions and 132 deletions

View file

@ -4,11 +4,14 @@ use crate::config::{TRAP_CONTEXT, kernel_stack_position};
use super::TaskContext;
pub struct TaskControlBlock {
// immutable
pub trap_cx_ppn: PhysPageNum,
pub base_size: usize,
//pub pid: usize,
// mutable
pub task_cx_ptr: usize,
pub task_status: TaskStatus,
pub memory_set: MemorySet,
pub trap_cx_ppn: PhysPageNum,
pub base_size: usize,
}
impl TaskControlBlock {
@ -65,4 +68,5 @@ pub enum TaskStatus {
Ready,
Running,
Exited,
Zombie,
}