Skip to main content

Cpu

Struct Cpu 

Source
#[repr(align(64))]
pub struct Cpu { global_cpu_state: GlobalCpuState, bsp_cpu_state: CpuState, ap_cpu_states: NicheCell<Box<[CpuState]>>, }
Expand description

Per-CPU descriptor tables: one TSS and GDT per CPU, plus the shared IDT.

Fields§

§global_cpu_state: GlobalCpuState§bsp_cpu_state: CpuState§ap_cpu_states: NicheCell<Box<[CpuState]>>

Implementations§

Source§

impl Cpu

Source

pub const fn new() -> Self

Construct with a default TSS and GDT for every CPU and a fresh IDT.

Source

pub unsafe fn init_ap_cpu_states(&self, value: Box<[CpuState]>)

Source

pub fn global_cpu_state(&self) -> &GlobalCpuState

Getter for Cpu::global_cpu_state

Source

pub fn bsp_cpu_state(&self) -> &CpuState

Getter for Cpu::bsp_cpu_state

Source

pub unsafe fn ap_cpu_states(&self) -> &Option<Box<[CpuState]>>

Getter for Cpu::ap_cpu_states

§Safety

The caller must guarantee that at this method’s entire execution time, no mutable references or pointers to this data exist or will exist

Auto Trait Implementations§

§

impl !Freeze for Cpu

§

impl !RefUnwindSafe for Cpu

§

impl Send for Cpu

§

impl Sync for Cpu

§

impl Unpin for Cpu

§

impl UnsafeUnpin for Cpu

§

impl UnwindSafe for Cpu

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.