virt_support_apic

Struct LocalApic

Source
pub struct LocalApic { /* private fields */ }
Expand description

An individual local APIC for a processor.

Implementations§

Source§

impl LocalApic

Source

pub fn access<'a, T: ApicClient>( &'a mut self, client: &'a mut T, ) -> LocalApicAccess<'a, T>

Returns an object to access APIC registers.

Source

pub fn request_fixed_interrupts(&mut self, irr: [u32; 8])

Fast path for updating IRR on the local processor.

Source

pub fn apic_base(&self) -> u64

Gets the APIC base MSR.

Source

pub fn base_address(&self) -> Option<u64>

Gets the APIC base address, if the APIC is enabled and in xapic mode.

Source

pub fn set_apic_base(&mut self, apic_base: u64) -> Result<(), InvalidApicBase>

Sets the APIC base MSR.

Returns false if the value is invalid.

Source

pub fn x2apic_enabled(&self) -> bool

X2APIC is enabled on this local APIC

Source

pub fn scan(&mut self, vmtime: &mut VmTimeAccess, scan_irr: bool) -> ApicWork

Scans for pending interrupts.

Source

pub fn next_irr(&self) -> Option<u8>

Returns the next pending interrupt vector, if any.

Source

pub fn push_to_offload( &mut self, update: impl FnOnce(&[u32; 8], &[u32; 8], &[u32; 8]), ) -> Result<(), OffloadNotSupported>

Handles APIC offload, calling update with new bits in IRR, ISR, and the current value of TMR.

update should accumulate IRR and ISR into the offload APIC page and update the EOI exit bitmap if TMR has changed since the last call.

update will not be called if there are no changes (i.e. if IRR and ISR are both zero).

Source

pub fn is_offloaded(&self) -> bool

Returns whether APIC offload is enabled.

Source

pub fn can_offload_irr(&self) -> bool

Returns true if it is safe to set an IRR bit directly in offloaded APIC state.

Source

pub fn enable_offload(&mut self)

Enables APIC offload.

Source

pub fn disable_offload(&mut self, irr: &[u32; 8], isr: &[u32; 8])

Disables APIC offload, accumulating IRR and ISR from the offload APIC page.

Source

pub fn flush(&mut self) -> ApicWork

Flushes work as in Self::scan, but does not poll timers or IRR.

This must be called before Self::save to flush hidden state to registers.

Source

pub fn acknowledge_interrupt(&mut self, vector: u8)

Acknowledges the interrupt returned by scan.

Source

pub fn is_lazy_eoi_pending(&self) -> bool

Returns whether an EOI is pending that can be completed lazily, without intercepting the VP.

Source

pub fn reset(&mut self)

Resets the APIC state.

Source

pub fn save(&mut self) -> Apic

Returns the APIC register state.

Source

pub fn restore(&mut self, state: &Apic) -> Result<(), InvalidApicBase>

Restores the APIC register state.

Trait Implementations§

Source§

impl Inspect for LocalApic

Source§

fn inspect(&self, req: Request<'_>)

Inspects the object.

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more