pub struct Ioapic {
num_pins: usize,
ioregsel: u8,
ioapicid: u32,
rtc_remote_irr: bool,
out_events: Vec<Option<OutEvent>>,
resample_events: Vec<Vec<Event>>,
redirect_table: Vec<IoapicRedirectionTableEntry>,
interrupt_level: Vec<bool>,
irq_tube: Tube,
}Fields§
§num_pins: usizeNumber of supported IO-APIC inputs / redirection entries.
ioregsel: u8ioregsel register. Used for selecting which entry of the redirect table to read/write.
ioapicid: u32ioapicid register. Bits 24 - 27 contain the APIC ID for this device.
rtc_remote_irr: boolRemote IRR for Edge Triggered Real Time Clock interrupts, which allows the CMOS to know when one of its interrupts is being coalesced.
out_events: Vec<Option<OutEvent>>Outgoing irq events that are used to inject MSI interrupts. Also contains the serializable form used for snapshotting.
resample_events: Vec<Vec<Event>>Events that should be triggered on an EOI. The outer Vec is indexed by GSI, and the inner Vec is an unordered list of registered resample events for the GSI.
redirect_table: Vec<IoapicRedirectionTableEntry>Redirection settings for each irq line.
interrupt_level: Vec<bool>Interrupt activation state.
irq_tube: TubeTube used to route MSI irqs.
Implementations§
Source§impl Ioapic
impl Ioapic
pub fn new(irq_tube: Tube, num_pins: usize) -> Result<Ioapic>
pub fn get_ioapic_state(&self) -> IoapicState
pub fn set_ioapic_state(&mut self, state: &IoapicState)
pub fn register_resample_events(&mut self, resample_events: Vec<Vec<Event>>)
pub fn end_of_interrupt(&mut self, vector: u8)
pub fn service_irq(&mut self, irq: usize, level: bool) -> bool
fn ioapic_write(&mut self, val: u32)
fn setup_msi( &mut self, index: usize, msi_address: u64, msi_data: u32, ) -> Result<(), IoapicError>
Sourcefn restore_msi(
&mut self,
index: usize,
gsi: u32,
msi_address: u64,
msi_data: u32,
) -> Result<(), IoapicError>
fn restore_msi( &mut self, index: usize, gsi: u32, msi_address: u64, msi_data: u32, ) -> Result<(), IoapicError>
Similar to Ioapic::setup_msi, but used only to re-create an MSI as part of the snapshot restore process, which allows us to assume certain invariants (like msi_data != 0) already hold.
Sourcefn release_all_msis(&mut self) -> Result<(), IoapicError>
fn release_all_msis(&mut self) -> Result<(), IoapicError>
On warm restore, there could already be MSIs registered. We need to release them in case the routing has changed (e.g. different data <-> GSI).
fn ioapic_read(&mut self) -> u32
Trait Implementations§
Source§impl BusDevice for Ioapic
impl BusDevice for Ioapic
Source§fn debug_label(&self) -> String
fn debug_label(&self) -> String
Source§fn device_id(&self) -> DeviceId
fn device_id(&self) -> DeviceId
Source§fn read(&mut self, info: BusAccessInfo, data: &mut [u8])
fn read(&mut self, info: BusAccessInfo, data: &mut [u8])
info.Source§fn write(&mut self, info: BusAccessInfo, data: &[u8])
fn write(&mut self, info: BusAccessInfo, data: &[u8])
info.