Struct pic::ChainedPics

source ·
pub struct ChainedPics { /* private fields */ }
Expand description

A pair of chained PIC chips, which represents the standard x86 configuration.

Implementations§

source§

impl ChainedPics

source

pub fn init(master_mask: u8, slave_mask: u8) -> ChainedPics

Create a new interface for the standard PIC1 and PIC2 controllers, specifying the desired interrupt offsets. Then, it initializes the PICs in a standard chained fashion, which involved mapping the master PIC to 0x20 and the slave to 0x28 (standard rempaping), because even if we don’t use them (and disable them for APIC instead), we still need to remap them to avoid a spurious interrupt clashing with an exception.

source

pub fn mask_irqs(&self, master_mask: u8, slave_mask: u8)

Each mask is a bitwise mask for each IRQ line, with the master’s IRQ line 2 (0x4) affecting the entire slave IRQ mask. So if the master’s IRQ line 2 is masked (disabled), all slave IRQs (0x28 to 0x2F) are masked. If a bit is set to 1, it is masked (disabled). If set to 0, it is unmasked (enabled).

source

pub fn notify_end_of_interrupt(&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].

source

pub fn read_isr_irr(&self) -> IrqStatusRegisters

Reads the ISR and IRR registers of both the master and slave PIC.

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.