Struct pic8259::ChainedPics
source · pub struct ChainedPics { /* private fields */ }
Expand description
A pair of chained PICs. This is the standard setup on x86.
Implementations§
source§impl ChainedPics
impl ChainedPics
sourcepub const unsafe fn new(offset1: u8, offset2: u8) -> ChainedPics
pub const unsafe fn new(offset1: u8, offset2: u8) -> ChainedPics
Create a new interface for the standard PIC1 and PIC2, specifying the desired interrupt offsets.
sourcepub const unsafe fn new_contiguous(primary_offset: u8) -> ChainedPics
pub const unsafe fn new_contiguous(primary_offset: u8) -> ChainedPics
Create a new ChainedPics
interface that will map the PICs contiguously starting at the given interrupt offset.
This is a convenience function that maps the PIC1 and PIC2 to a
contiguous set of interrupts. This function is equivalent to
Self::new(primary_offset, primary_offset + 8)
.
sourcepub unsafe fn initialize(&mut self)
pub unsafe fn initialize(&mut self)
Initialize both our PICs. We initialize them together, at the same time, because it’s traditional to do so, and because I/O operations might not be instantaneous on older processors.
sourcepub unsafe fn read_masks(&mut self) -> [u8; 2]
pub unsafe fn read_masks(&mut self) -> [u8; 2]
Reads the interrupt masks of both PICs.
sourcepub unsafe fn write_masks(&mut self, mask1: u8, mask2: u8)
pub unsafe fn write_masks(&mut self, mask1: u8, mask2: u8)
Writes the interrupt masks of both PICs.
sourcepub fn handles_interrupt(&self, interrupt_id: u8) -> bool
pub fn handles_interrupt(&self, interrupt_id: u8) -> bool
Do we handle this interrupt?
sourcepub unsafe fn notify_end_of_interrupt(&mut self, interrupt_id: u8)
pub unsafe fn notify_end_of_interrupt(&mut self, interrupt_id: u8)
Figure out which (if any) PICs in our chain need to know about this
interrupt. This is tricky, because all interrupts from pics[1]
get chained through pics[0]
.