x2apic-rs
A Rust interface to the x2apic interrupt architecture.
This crate is in its early stages and has only been tested in QEMU; code contributions and bug reports are welcome.
It will use x2APIC mode if supported by the CPU, otherwise it falls back to xAPIC mode.
Usage
The local APIC is initialized like so:
use ;
let apic_physical_address: u64 = unsafe ;
let apic_virtual_address: u64 =
let lapic = new
.timer_vector
.error_vector
.spurious_vector
.set_xapic_base
.build
.unwrap_or_else;
unsafe
This initializes and enables the local APIC timer with a default configuration. The timer can be configured with the builder or directly on the APIC.
The IOAPIC is initialized like so:
use ;
// !!! Map the IOAPIC's MMIO address `addr` here !!!
unsafe
Please refer to the documentation for more details.