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

SmpVm

Struct SmpVm 

Source
pub struct SmpVm {
    pub vm_id: u64,
    pub vcpus: Vec<VirtualCpu>,
    pub max_vcpus: usize,
}
Expand description

Multi-vCPU VM

Fields§

§vm_id: u64

VM identifier

§vcpus: Vec<VirtualCpu>

Virtual CPUs

§max_vcpus: usize

Maximum vCPUs allowed

Implementations§

Source§

impl SmpVm

Source

pub fn new(vm_id: u64, vcpu_count: usize) -> Result<Self, VmError>

Source

pub fn send_ipi( &mut self, source: u8, dest: u8, mode: IpiDeliveryMode, vector: u8, ) -> Result<(), VmError>

Send IPI from one vCPU to another

Source

pub fn startup_ap(&mut self, ap_id: u8, sipi_vector: u8) -> Result<(), VmError>

Emulate the AP startup sequence: BSP sends INIT then SIPI

Source

pub fn vcpu_count(&self) -> usize

Source

pub fn running_vcpu_count(&self) -> usize

Source

pub fn vcpu(&self, id: u8) -> Option<&VirtualCpu>

Get a vCPU by ID

Source

pub fn vcpu_mut(&mut self, id: u8) -> Option<&mut VirtualCpu>

Get a mutable reference to a vCPU by ID

Source

pub fn pause_all(&mut self)

Pause all vCPUs

Source

pub fn resume_all(&mut self)

Resume all vCPUs

Auto Trait Implementations§

§

impl Freeze for SmpVm

§

impl RefUnwindSafe for SmpVm

§

impl Send for SmpVm

§

impl Sync for SmpVm

§

impl Unpin for SmpVm

§

impl UnwindSafe for SmpVm

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.