Struct InterruptControllers

Source
pub struct InterruptControllers {
    local_controllers: Vec<Box<dyn LocalInterruptController>>,
    external_controller: Option<Box<dyn ExternalInterruptController>>,
    cpu_to_local_controller: BTreeMap<CpuId, usize>,
}
Expand description

Interrupt controller registry

This struct maintains references to the active interrupt controllers and provides a unified interface for interrupt management. Supports multiple local interrupt controllers for different CPU groups.

Fields§

§local_controllers: Vec<Box<dyn LocalInterruptController>>§external_controller: Option<Box<dyn ExternalInterruptController>>§cpu_to_local_controller: BTreeMap<CpuId, usize>

Implementations§

Source§

impl InterruptControllers

Source

pub fn new() -> Self

Create a new interrupt controller registry

Source

pub fn register_local_controller( &mut self, controller: Box<dyn LocalInterruptController>, cpu_ids: &[CpuId], ) -> usize

Register a local interrupt controller for specific CPUs Returns the controller index

Source

pub fn register_local_controller_for_cpu( &mut self, controller: Box<dyn LocalInterruptController>, cpu_id: CpuId, ) -> usize

Register a local interrupt controller for a single CPU Returns the controller index

Source

pub fn register_local_controller_for_range( &mut self, controller: Box<dyn LocalInterruptController>, cpu_range: Range<CpuId>, ) -> usize

Register a local interrupt controller for a CPU range (convenience function) Returns the controller index

Source

pub fn register_external_controller( &mut self, controller: Box<dyn ExternalInterruptController>, )

Register an external interrupt controller

Source

pub fn local_controller_mut_for_cpu( &mut self, cpu_id: CpuId, ) -> Option<&mut Box<dyn LocalInterruptController>>

Get a mutable reference to the local interrupt controller for a specific CPU

Source

pub fn local_controller_mut( &mut self, index: usize, ) -> Option<&mut Box<dyn LocalInterruptController>>

Get a mutable reference to a specific local interrupt controller by index

Source

pub fn external_controller_mut( &mut self, ) -> Option<&mut Box<dyn ExternalInterruptController>>

Get a mutable reference to the external interrupt controller

Source

pub fn init_local_controllers(&mut self) -> InterruptResult<()>

Initialize all local controllers for their respective CPUs

Source

pub fn init_external_controller(&mut self) -> InterruptResult<()>

Initialize the external controller

Source

pub fn has_local_controller_for_cpu(&self, cpu_id: CpuId) -> bool

Check if local controller is available for a specific CPU

Source

pub fn has_local_controller(&self) -> bool

Check if any local controller is available

Source

pub fn has_external_controller(&self) -> bool

Check if external controller is available

Source

pub fn local_controller_count(&self) -> usize

Get the number of registered local controllers

Source

pub fn cpus_for_controller(&self, controller_index: usize) -> Vec<CpuId>

Get CPU IDs managed by a specific local controller

Trait Implementations§

Auto Trait Implementations§

§

impl Freeze for InterruptControllers

§

impl !RefUnwindSafe for InterruptControllers

§

impl Unpin for InterruptControllers

§

impl !UnwindSafe for InterruptControllers

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.