pub struct Routes {
routes: Vec<Vec<IrqSource>>,
}Expand description
A container for x86 IrqRoutes, grouped by GSI.
Fields§
§routes: Vec<Vec<IrqSource>>A list of routes, indexed by GSI. Each GSI can map to zero or more routes, so this is a Vec of Vecs. Specifically, a GSI can map to:
- no routes; or
- one IrqSource::Msi route; or
- one or more IrqSource::Irqchip routes (PicPrimary, PicSecondary, or Ioapic)
Implementations§
Source§impl Routes
impl Routes
Sourcepub fn add(&mut self, route: IrqRoute) -> Result<()>
pub fn add(&mut self, route: IrqRoute) -> Result<()>
Inserts a route, replacing any existing route that conflicts. Two routes conflict if they
have the same GSI, and they’re both IrqSource::Irqchip routes with the same chip or
they’re both IrqSource::Msi. Returns Err if an IrqSource::Irqchip and IrqSource::Msi
route have the same GSI.
Sourcepub fn replace_all(&mut self, routes: &[IrqRoute]) -> Result<()>
pub fn replace_all(&mut self, routes: &[IrqRoute]) -> Result<()>
Deletes all existing routes and replaces them with routes. If two routes in routes
conflict with each other, the one earlier in the slice is dropped.
Sourcepub fn default_pic_ioapic_routes(ioapic_pins: usize) -> Vec<IrqRoute>
pub fn default_pic_ioapic_routes(ioapic_pins: usize) -> Vec<IrqRoute>
Default x86 routing table. Pins 0-7 go to primary pic and ioapic, pins 8-15 go to secondary pic and ioapic, and pins 16-23 go only to the ioapic.
Sourcepub fn get_routes(&self) -> Vec<IrqRoute>
pub fn get_routes(&self) -> Vec<IrqRoute>
Gets the routes as a flat Vec of IrqRoutes.
Sourcefn conflict(source: &IrqSource, other: &IrqSource) -> bool
fn conflict(source: &IrqSource, other: &IrqSource) -> bool
Determines whether or not two irq routes on the same GSI conflict. Returns true if they conflict.
Sourcefn same_source(source: &IrqSource, other: &IrqSource) -> bool
fn same_source(source: &IrqSource, other: &IrqSource) -> bool
Determines whether two routes have the same IrqSource variant (IrqSource::Irqchip or IrqSource::Msi).