Skip to main content

Process

Struct Process 

Source
pub struct Process {
Show 15 fields pub id: usize, pub name: &'static str, pub state: ProcessState, pub priority: Priority, pub stack_ptr: usize, pub stack_mem: Vec<u8>, pub wait_ticks: usize, pub page_table_phys_addr: u64, pub starvation_count: usize, pub is_kernel: bool, pub user_entry: usize, pub user_stack_ptr: usize, pub kernel_stack: Vec<u8>, pub time_slice: usize, pub need_resched: bool,
}
Expand description

プロセス制御ブロック (PCB)。プロセスのメタデータ、実行コンテキスト、スタック情報を保持します。

Fields§

§id: usize

一意のプロセスID (PID)

§name: &'static str

デバッグ用のプロセス名

§state: ProcessState

現在のプロセスの状態

§priority: Priority

プロセスのスケジュール優先度

§stack_ptr: usize

保存されたスタックポインタの値 (コンテキストスイッチ時に書き換えられる)

§stack_mem: Vec<u8>

プロセスのスタックメモリ領域 (EL1スレッド用またはEL0ユーザースタック用)

§wait_ticks: usize

Waiting 状態時の残りの待機チック数

§page_table_phys_addr: u64

プロセスに割り当てられたTTBR0ページテーブルの物理アドレス

§starvation_count: usize

飢餓防止のための優先度スコアに加算されるカウント

§is_kernel: bool

カーネル空間 (EL1) で動作するか、ユーザー空間 (EL0) で動作するかのフラグ (true: EL1, false: EL0)

§user_entry: usize

EL0プロセスのエントリポイント

§user_stack_ptr: usize

EL0プロセスのユーザースタックポインタ

§kernel_stack: Vec<u8>

EL0プロセスがトラップした際に使用するEL1カーネルスタック

§time_slice: usize

残りのタイムスライス (チック数)

§need_resched: bool

再スケジュールが必要であることを示すフラグ

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> Same for T

Source§

type Output = T

Should always be Self
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.