Trait Control

Source
pub trait Control {
    type Registers: Debug + Display;

    // Required methods
    unsafe fn disable(&mut self);
    unsafe fn enable(&mut self);
    fn is_enabled(&self) -> bool;
    fn register_handlers<H>(&mut self) -> Result<(), RegistrationError>
       where H: Handlers<Self::Registers>;

    // Provided method
    fn enter_critical(&mut self) -> CriticalGuard<'_, Self> { ... }
}
Expand description

An interrupt controller for a platform.

Required Associated Types§

Required Methods§

Source

unsafe fn disable(&mut self)

Disable all interrupts.

§Safety

This may cause a fault if called when interrupts are already disabled (depending on the platform). It does not guarantee that interrupts will ever be unmasked.

Source

unsafe fn enable(&mut self)

Enable all interrupts.

§Safety

This may cause a fault if called when interrupts are already enabled (depending on the platform).

Source

fn is_enabled(&self) -> bool

Returns true if interrupts are enabled.

Source

fn register_handlers<H>(&mut self) -> Result<(), RegistrationError>
where H: Handlers<Self::Registers>,

Provided Methods§

Source

fn enter_critical(&mut self) -> CriticalGuard<'_, Self>

Enter a critical section, returning a guard.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

impl Control for Idt

impl Control for CascadedPic