pub struct GicDistributor { /* private fields */ }
Expand description

The GIC distributor.

The Distributor block performs interrupt prioritization and distribution to the CPU interface blocks that connect to the processors in the system.

The Distributor provides a programming interface for:

  • Globally enabling the forwarding of interrupts to the CPU interfaces.
  • Enabling or disabling each interrupt.
  • Setting the priority level of each interrupt.
  • Setting the target processor list of each interrupt.
  • Setting each peripheral interrupt to be level-sensitive or edge-triggered.
  • Setting each interrupt as either Group 0 or Group 1.
  • Forwarding an SGI to one or more target processors.

In addition, the Distributor provides:

  • visibility of the state of each interrupt
  • a mechanism for software to set or clear the pending state of a peripheral interrupt.

Implementations§

source§

impl GicDistributor

source

pub const fn new(base: *mut u8) -> Self

Construct a new GIC distributor instance from the base address.

source

pub fn cpu_num(&self) -> usize

The number of implemented CPU interfaces.

source

pub fn max_irqs(&self) -> usize

The maximum number of interrupts that the GIC supports

source

pub fn configure_interrupt(&mut self, vector: usize, tm: TriggerMode)

Configures the trigger mode for the given interrupt.

source

pub fn set_enable(&mut self, vector: usize, enable: bool)

Enables or disables the given interrupt.

source

pub fn init(&mut self)

Initializes the GIC distributor.

It disables all interrupts, sets the target of all SPIs to CPU 0, configures all SPIs to be edge-triggered, and finally enables the GICD.

This function should be called only once.

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

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

§

type Error = Infallible

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

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

Performs the conversion.
source§

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

§

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

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

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

Performs the conversion.