pub struct X2Apic {
_private: (),
}Fields§
§_private: ()Implementations§
Source§impl X2Apic
impl X2Apic
pub fn new() -> Option<Self>
pub fn is_supported() -> bool
Sourcepub fn enable(&self) -> Result<(), &'static str>
pub fn enable(&self) -> Result<(), &'static str>
Enable x2APIC mode on this CPU.
Performs the two-step enable sequence:
- Ensure APIC global enable (EN=1) in IA32_APIC_BASE.
- Set x2APIC enable (EXTD=1).
Writes the Spurious Interrupt Vector Register to finalize.
Returns Err if the CPU refuses to enter x2APIC mode (e.g. BIOS
locked the APIC base, or the CPU doesn’t actually support x2APIC).
Sourcepub fn read_and_clear_esr(&self) -> u32
pub fn read_and_clear_esr(&self) -> u32
Read and clear the Error Status Register.
After a send_ipi() the ESR should be read to detect delivery errors (illegal vector, accept error, etc.). Writes-1-to-clear, so we write 0 then read to snapshot.
pub fn id(&self) -> u32
pub fn version(&self) -> u32
pub fn eoi(&self)
Sourcepub fn send_ipi(&self, target_id: u32, vector: u8)
pub fn send_ipi(&self, target_id: u32, vector: u8)
Send an IPI to a specific x2APIC destination.
Uses Fixed delivery mode, physical destination, edge-triggered, no shorthand. This is the common-case IPI (reschedule, TLB shootdown, etc.).
Sourcepub fn send_init_ipi(&self, target_id: u32)
pub fn send_init_ipi(&self, target_id: u32)
Send an INIT IPI to a specific x2APIC destination.
INIT IPIs use Delivery Mode = 101 (INIT). In x2APIC mode the Level bit is not meaningful for INIT delivery, but is set to 1 (assert) by convention to match xAPIC-compatible INIT sequences.
Sourcepub fn send_startup_ipi(&self, target_id: u32, start_page: u8)
pub fn send_startup_ipi(&self, target_id: u32, start_page: u8)
Send a STARTUP IPI (SIPI) to a specific x2APIC destination.
start_page is the start-up vector (page frame number of the real-mode
entry point, e.g. 0x08 for physical 0x0800). The CPU begins execution
at start_page << 12 in real mode after receiving SIPI.
Sourcepub fn configure_timer(
&self,
initial_count: u32,
vector: u8,
periodic: bool,
divide: TimerDivide,
)
pub fn configure_timer( &self, initial_count: u32, vector: u8, periodic: bool, divide: TimerDivide, )
Configure the LVT timer.
Programs the divide configuration, LVT entry, and initial count in the correct order (SDM requires: DIV → LVT → INIT_COUNT).
Sourcepub fn mask_timer(&self)
pub fn mask_timer(&self)
Mask the LVT timer (set mask bit = 1 → timer interrupt suppressed).
Sourcepub fn unmask_timer(&self)
pub fn unmask_timer(&self)
Unmask the LVT timer (clear mask bit = 0 → timer interrupt delivered).
Auto Trait Implementations§
impl Freeze for X2Apic
impl RefUnwindSafe for X2Apic
impl Send for X2Apic
impl Sync for X2Apic
impl Unpin for X2Apic
impl UnsafeUnpin for X2Apic
impl UnwindSafe for X2Apic
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more