pub struct Task<P>where
P: Platform,{
pub name: String,
pub address_space: Arc<AddressSpace<P>>,
pub state: Spinlock<TaskState>,
pub capabilities: Vec<Capability>,
pub user_slot: Spinlock<TaskSlot>,
pub kernel_stack: Spinlock<Stack>,
pub kernel_stack_pointer: UnsafeCell<VAddr>,
pub user_stack_pointer: UnsafeCell<VAddr>,
pub context: UnsafeCell<P::TaskContext>,
pub handles: RwSpinlock<BTreeMap<Handle, Arc<dyn KernelObject>>>,
/* private fields */
}
Fields§
§name: String
§address_space: Arc<AddressSpace<P>>
§state: Spinlock<TaskState>
§capabilities: Vec<Capability>
§user_slot: Spinlock<TaskSlot>
§kernel_stack: Spinlock<Stack>
§kernel_stack_pointer: UnsafeCell<VAddr>
§user_stack_pointer: UnsafeCell<VAddr>
§context: UnsafeCell<P::TaskContext>
§handles: RwSpinlock<BTreeMap<Handle, Arc<dyn KernelObject>>>
Implementations§
Source§impl<P> Task<P>where
P: Platform,
impl<P> Task<P>where
P: Platform,
pub fn from_boot_info( owner: KernelObjectId, address_space: Arc<AddressSpace<P>>, image: &LoadedImage, allocator: &PhysicalMemoryManager, kernel_page_table: &mut P::PageTable, kernel_stack_allocator: &mut KernelStackAllocator<P>, ) -> Result<Arc<Task<P>>, TaskCreationError>
pub fn add_handle(&self, object: Arc<dyn KernelObject>) -> Handle
Trait Implementations§
Source§impl<P> KernelObject for Task<P>where
P: Platform,
impl<P> KernelObject for Task<P>where
P: Platform,
fn id(&self) -> KernelObjectId
fn typ(&self) -> KernelObjectType
impl<P> Send for Task<P>where
P: Platform,
impl<P> Sync for Task<P>where
P: Platform,
Auto Trait Implementations§
impl<P> !Freeze for Task<P>
impl<P> !RefUnwindSafe for Task<P>
impl<P> Unpin for Task<P>
impl<P> !UnwindSafe for Task<P>
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can then be
further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<dyn Any>
. Rc<dyn Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Anydyn Any
. This is needed since Rust cannot
generate &Anydyn Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Anydyn Any
. This is needed since Rust cannot
generate &mut dyn Any
’s vtable from &mut Trait
’s.