ros666::task::processor

Struct Processor

Source
pub struct Processor {
    current: Option<Arc<SyncRefCell<ProcessControlBlock>>>,
    idle_ctx: TaskCtx,
}
Expand description

处理器

Fields§

§current: Option<Arc<SyncRefCell<ProcessControlBlock>>>

当前正在运行的任务

§idle_ctx: TaskCtx

空闲任务上下文

Implementations§

Source§

impl Processor

Source

pub fn new() -> Self

创建一个新的处理器实例

Source

fn get_idle_ctx_ptr(&mut self) -> *mut TaskCtx

获取空闲任务上下文的指针

Source

pub fn run_tasks()

运行任务

Source

pub fn schedule(switched_task_cx_ptr: *mut TaskCtx)

调度任务

Source

pub fn take_current() -> Option<Arc<SyncRefCell<ProcessControlBlock>>>

获取当前任务并将其从处理器中移除

Source

pub fn get_current() -> Option<Arc<SyncRefCell<ProcessControlBlock>>>

获取当前任务的引用

Source

pub fn current_user_token() -> Option<usize>

获取当前用户的 satp 寄存器的值

Source

pub fn current_trap_cx() -> Option<&'static mut TrapCtx>

获取当前陷入上下文

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.