pub struct El0PhysicalTimer();Expand description
Represents our Generic Physical Timer when we are running at EL0.
Note that for most of these APIs to work, EL0 needs to have been granted access using methods like El1PhysicalTimer::el0_access_physical_counter.
Implementations§
Source§impl El0PhysicalTimer
impl El0PhysicalTimer
Sourcepub unsafe fn new() -> El0PhysicalTimer
pub unsafe fn new() -> El0PhysicalTimer
Create an EL0 Timer handle for the Physical Timer.
EL2/EL1 has to grant permission for EL0 to use the Physical Timer, so check they did that.
§Safety
Only create one of these at any given time, as they access shared mutable state within the processor and do read-modify-writes on that state.
Trait Implementations§
Source§impl GenericTimer for El0PhysicalTimer
impl GenericTimer for El0PhysicalTimer
Source§fn frequency_hz(&self) -> u32
fn frequency_hz(&self) -> u32
Get the timer frequency
Source§fn counter_compare(&self) -> u64
fn counter_compare(&self) -> u64
Get the counter compare value.
Source§fn counter_compare_set(&mut self, value: u64)
fn counter_compare_set(&mut self, value: u64)
Set the counter compare value. Read more
Source§fn countdown_set(&mut self, duration_ticks: u32)
fn countdown_set(&mut self, duration_ticks: u32)
Set the value of the count-down timer. Read more
Source§fn interrupt_masked(&self) -> bool
fn interrupt_masked(&self) -> bool
Is this timer’s interrupt masked?
Source§fn interrupt_mask(&mut self, mask: bool)
fn interrupt_mask(&mut self, mask: bool)
Mask (or unmask) this timer’s interrupt.
Source§fn interrupt_status(&self) -> bool
fn interrupt_status(&self) -> bool
Has this timer’s interrupt fired?
Source§fn delay_ticks(&mut self, ticks: u32)
fn delay_ticks(&mut self, ticks: u32)
Wait for some number of clock ticks