⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

CpuInfo

Struct CpuInfo 

Source
pub struct CpuInfo {
    pub id: u8,
    pub online: AtomicBool,
    pub idle: AtomicBool,
    pub current_task: AtomicU64,
    pub load: AtomicU8,
    pub nr_running: AtomicU32,
    pub scheduler: Mutex<Scheduler>,
    pub ready_queue: Mutex<ReadyQueue>,
    pub vendor: String,
    pub model: String,
    pub features: CpuFeatures,
    pub page_cache_id: u8,
}
Expand description

CPU information

Fields§

§id: u8

CPU ID

§online: AtomicBool

CPU online status

§idle: AtomicBool

CPU idle status

§current_task: AtomicU64

Current task on this CPU

§load: AtomicU8

Load average (0-100)

§nr_running: AtomicU32

Number of tasks in run queue

§scheduler: Mutex<Scheduler>

Per-CPU scheduler

§ready_queue: Mutex<ReadyQueue>

Per-CPU ready queue

§vendor: String

CPU vendor string

§model: String

CPU model string

§features: CpuFeatures

CPU features

§page_cache_id: u8

Per-CPU page frame cache index (matches PER_CPU_PAGE_CACHES slot)

Implementations§

Source§

impl CpuInfo

Source

pub const fn new(id: u8) -> Self

Create new CPU info

Source

pub fn bring_online(&self)

Mark CPU as online

Source

pub fn bring_offline(&self)

Mark CPU as offline

Source

pub fn is_online(&self) -> bool

Check if CPU is online

Source

pub fn is_idle(&self) -> bool

Check if CPU is idle

Source

pub fn update_load(&self)

Update load average

Auto Trait Implementations§

§

impl !Freeze for CpuInfo

§

impl !RefUnwindSafe for CpuInfo

§

impl Send for CpuInfo

§

impl Sync for CpuInfo

§

impl Unpin for CpuInfo

§

impl !UnwindSafe for CpuInfo

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.