Skip to main content

IntId

Struct IntId 

Source
pub struct IntId(/* private fields */);
Expand description

A GIC interrupt identifier (raw INTID).

Use the named constructors to translate from FDT-cell offsets — never reach for a u32 directly. The internal value is the raw INTID: SPIs are 32..=1019, PPIs are 16..=31.

Implementations§

Source§

impl IntId

Source

pub const fn from_spi_intid(intid: u32) -> Result<Self, IntIdError>

Construct from a raw SPI INTID (32..=1019). For values written as cell-offsets in an FDT, prefer Self::from_spi_cell.

§Errors

IntIdError::SpiOutOfRange if intid is outside the SPI range.

Source

pub const fn from_ppi_intid(intid: u32) -> Result<Self, IntIdError>

Construct from a raw PPI INTID (16..=31).

§Errors

IntIdError::PpiOutOfRange if intid is outside the PPI range.

Source

pub const fn from_spi_cell(cell_offset: u32) -> Result<Self, IntIdError>

Construct an SPI from an FDT cell offset (raw INTID = 32 + offset).

Use this whenever you are reading or emitting an FDT — the cell number is what appears in the FDT text, the raw INTID is what the kernel and HVF speak.

§Errors

IntIdError::SpiCellOffsetOutOfRange if 32 + cell_offset > SPI_INTID_MAX.

Source

pub const fn from_ppi_cell(cell_offset: u32) -> Result<Self, IntIdError>

Construct a PPI from an FDT cell offset (raw INTID = 16 + offset).

§Errors

IntIdError::PpiCellOffsetOutOfRange if cell_offset > 15.

Source

pub const fn as_raw(self) -> u32

Raw INTID — what hv_gic_set_spi and friends consume.

Source

pub const fn is_spi(self) -> bool

true if this is an SPI (32..=1019).

Source

pub const fn is_ppi(self) -> bool

true if this is a PPI (16..=31).

Source

pub const fn fdt_cell_type(self) -> u32

FDT cell type field (0 for SPI, 1 for PPI).

§Errors

Returns the original IntIdError from the malformed branch — if self is neither a valid SPI nor PPI (which the constructors disallow), this is treated as an SPI out-of-range.

Source

pub const fn fdt_cell_offset(self) -> u32

FDT cell offset (INTID − 32 for SPI, INTID − 16 for PPI).

Trait Implementations§

Source§

impl Clone for IntId

Source§

fn clone(&self) -> IntId

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IntId

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for IntId

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for IntId

Source§

fn eq(&self, other: &IntId) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for IntId

Source§

impl Eq for IntId

Source§

impl StructuralPartialEq for IntId

Auto Trait Implementations§

§

impl Freeze for IntId

§

impl RefUnwindSafe for IntId

§

impl Send for IntId

§

impl Sync for IntId

§

impl Unpin for IntId

§

impl UnsafeUnpin for IntId

§

impl UnwindSafe for IntId

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.