[][src]Struct sunrise_kernel::devices::pic::Pic

pub struct Pic {
    master: SpinLockIRQ<InternalPic>,
    slave: SpinLockIRQ<InternalPic>,
}

A master/slave PIC setup, as commonly found on IBM PCs.

Fields

master: SpinLockIRQ<InternalPic>

The master PIC.

slave: SpinLockIRQ<InternalPic>

The slave PIC, cascaded on line 2 of .master

Implementations

impl Pic[src]

unsafe fn new() -> Pic[src]

Creates a new PIC, and initializes it.

Interrupts will be mapped to IRQ [32..48]

Safety

This should only be called once! If called more than once, then both Pics instances will share the same underlying Pios, but different mutexes protecting them!

pub fn mask(&self, irq: u8)[src]

Mask the given IRQ number. Will redirect the call to the right Pic device.

pub fn unmask(&self, irq: u8)[src]

Unmask the given IRQ number. Will redirect the call to the right Pic device.

pub fn get_mask(&self) -> u16[src]

Reads the PIC interrupt mask. Used for debug purposes.

LSB is irq 0, MSB is irq 15.

pub fn acknowledge(&self, irq: u8)[src]

Acknowledges an IRQ, allowing the PIC to send a new IRQ on the next cycle.

Trait Implementations

impl Debug for Pic[src]

Auto Trait Implementations

impl !RefUnwindSafe for Pic

impl Send for Pic

impl Sync for Pic

impl Unpin for Pic

impl UnwindSafe for Pic

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.