Struct os::task::id::TaskUserRes
source · pub struct TaskUserRes {
pub tid: usize,
pub ustack_base: usize,
pub process: Weak<ProcessControlBlock>,
}Expand description
User Resource for a task
Fields§
§tid: usizetask id
ustack_base: usizeuser stack base
process: Weak<ProcessControlBlock>process belongs to
Implementations§
source§impl TaskUserRes
impl TaskUserRes
sourcepub fn new(
process: Arc<ProcessControlBlock>,
ustack_base: usize,
alloc_user_res: bool
) -> Self
pub fn new( process: Arc<ProcessControlBlock>, ustack_base: usize, alloc_user_res: bool ) -> Self
Create a new TaskUserRes (Task User Resource)
sourcepub fn alloc_user_res(&self)
pub fn alloc_user_res(&self)
Allocate user resource for a task
sourcefn dealloc_user_res(&self)
fn dealloc_user_res(&self)
Deallocate user resource for a task
sourcepub fn dealloc_tid(&self)
pub fn dealloc_tid(&self)
dealloc task id
sourcepub fn trap_cx_user_va(&self) -> usize
pub fn trap_cx_user_va(&self) -> usize
The bottom usr vaddr (low addr) of the trap context for a task with tid
sourcepub fn trap_cx_ppn(&self) -> PhysPageNum
pub fn trap_cx_ppn(&self) -> PhysPageNum
The physical page number(ppn) of the trap context for a task with tid
sourcepub fn ustack_base(&self) -> usize
pub fn ustack_base(&self) -> usize
the bottom addr (low addr) of the user stack for a task
sourcepub fn ustack_top(&self) -> usize
pub fn ustack_top(&self) -> usize
the top addr (high addr) of the user stack for a task
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TaskUserRes
impl !RefUnwindSafe for TaskUserRes
impl Send for TaskUserRes
impl Sync for TaskUserRes
impl Unpin for TaskUserRes
impl !UnwindSafe for TaskUserRes
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more