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
impl IntId
Sourcepub const fn from_spi_intid(intid: u32) -> Result<Self, IntIdError>
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.
Sourcepub const fn from_ppi_intid(intid: u32) -> Result<Self, IntIdError>
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.
Sourcepub const fn from_spi_cell(cell_offset: u32) -> Result<Self, IntIdError>
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.
Sourcepub const fn from_ppi_cell(cell_offset: u32) -> Result<Self, IntIdError>
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.
Sourcepub const fn fdt_cell_type(self) -> u32
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.
Sourcepub const fn fdt_cell_offset(self) -> u32
pub const fn fdt_cell_offset(self) -> u32
FDT cell offset (INTID − 32 for SPI, INTID − 16 for PPI).