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 IrqRoute
s.
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).
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Routes
impl Send for Routes
impl Sync for Routes
impl Unpin for Routes
impl UnwindSafe for Routes
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.