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: usize
Number of supported IO-APIC inputs / redirection entries.
ioregsel: u8
ioregsel register. Used for selecting which entry of the redirect table to read/write.
ioapicid: u32
ioapicid register. Bits 24 - 27 contain the APIC ID for this device.
rtc_remote_irr: bool
Remote 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: Tube
Tube 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])
offset
from this devicesource§fn write(&mut self, info: BusAccessInfo, data: &[u8])
fn write(&mut self, info: BusAccessInfo, data: &[u8])
offset
into this devicesource§fn config_register_write(
&mut self,
reg_idx: usize,
offset: u64,
data: &[u8]
) -> ConfigWriteResult
fn config_register_write( &mut self, reg_idx: usize, offset: u64, data: &[u8] ) -> ConfigWriteResult
source§fn config_register_read(&self, reg_idx: usize) -> u32
fn config_register_read(&self, reg_idx: usize) -> u32
source§fn init_pci_config_mapping(
&mut self,
shmem: &SharedMemory,
base: usize,
len: usize
) -> bool
fn init_pci_config_mapping( &mut self, shmem: &SharedMemory, base: usize, len: usize ) -> bool
source§fn virtual_config_register_write(&mut self, reg_idx: usize, value: u32)
fn virtual_config_register_write(&mut self, reg_idx: usize, value: u32)
source§fn virtual_config_register_read(&self, reg_idx: usize) -> u32
fn virtual_config_register_read(&self, reg_idx: usize) -> u32
source§fn on_sandboxed(&mut self)
fn on_sandboxed(&mut self)
source§fn get_ranges(&self) -> Vec<(BusRange, BusType)>
fn get_ranges(&self) -> Vec<(BusRange, BusType)>
source§fn destroy_device(&mut self)
fn destroy_device(&mut self)
Auto Trait Implementations§
impl RefUnwindSafe for Ioapic
impl Send for Ioapic
impl Sync for Ioapic
impl Unpin for Ioapic
impl UnwindSafe for Ioapic
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.