[][src]Struct kernel::plic::Plic

pub struct Plic {}

Implementations

impl Plic[src]

pub const fn new() -> Self[src]

pub fn next(&mut self) -> Option<u32>[src]

Get the next available interrupt. This is the "claim" process. The plic will automatically sort by priority and hand us the ID of the interrupt. For example, if the UART is interrupting and it's next, we will get the value 10.

pub fn complete(&mut self, id: u32)[src]

Complete a pending interrupt by id. The id should come from the next() function above.

pub unsafe fn init(&mut self, id: u32)[src]

Initialize PLIC. Enable interrupt.

pub unsafe fn is_pending(&mut self, id: u32) -> bool[src]

See if a given interrupt id is pending.

Should only be called with lock.

pub fn enable(&mut self, id: u32)[src]

Enable a given interrupt id

pub fn set_threshold(&mut self, tsh: u8)[src]

Set the global threshold. The threshold can be a value [0..7]. The PLIC will mask any interrupts at or below the given threshold. This means that a threshold of 7 will mask ALL interrupts and a threshold of 0 will allow ALL interrupts.

pub fn set_priority(&mut self, id: u32, prio: u8)[src]

Set a given interrupt priority to the given priority. The priority must be [0..7]