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

source

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.

source

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).

source

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.

source

pub unsafe fn read_masks(&mut self) -> [u8; 2]

Reads the interrupt masks of both PICs.

source

pub unsafe fn write_masks(&mut self, mask1: u8, mask2: u8)

Writes the interrupt masks of both PICs.

source

pub unsafe fn disable(&mut self)

Disables both PICs by masking all interrupts.

source

pub fn handles_interrupt(&self, interrupt_id: u8) -> bool

Do we handle this interrupt?

source

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].

Auto Trait Implementations§

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