
Class abstracting a single HPET comparator. More...
#include <machine/hpet_timer.h>
Public Member Functions | |
Timer (const Timer &)=delete | |
Timer (Timer &&)=delete | |
Timer & | operator= (const Timer &)=delete |
Timer & | operator= (Timer &&)=delete |
void | enable () |
Activates interrupts (for the current comparator). | |
void | disable () |
Deactivates interrupts (for the current comparator). | |
bool | isEnabled () |
Checks whether interrupts are enabled for the current comparator. | |
TriggerMode | getInterruptMode () |
void | setInterruptMode (TriggerMode mode) |
bool | isPeriodicCapable () |
Checks whether this timer is able to handle periodic timers. More... | |
TimerMode | getMode () |
bool | setMode (TimerMode mode) |
Sets the mode of operation. More... | |
uint64_t | getValue () |
void | setValue (uint64_t value) |
CounterSize | getCounterSize () |
Returns the size of the value register. | |
bool | setCounterSize (CounterSize size) |
Sets the size of the value register. More... | |
Class abstracting a single HPET comparator.
Abstracts the access to comparators. This class does not have any constructor, as it is used to encapsulate hardware structures already residing in memory. Use HPET::GetTimer to obtain an instance for a particular HPET Timer.
bool HPET::Timer::isPeriodicCapable | ( | ) |
Checks whether this timer is able to handle periodic timers.
bool HPET::Timer::setMode | ( | TimerMode | mode | ) |
Sets the mode of operation.
Sets the mode of operation and returns true
on success. This is due to some comparators not supporting the periodic mode.
bool HPET::Timer::setCounterSize | ( | CounterSize | size | ) |
Sets the size of the value register.
Sets the size of this comparators' value register and returns whether the operation was successful.
The HPET specification requires that 64-bit implementations support a 32-bit compatibility mode (i.e., it can be configured to function like the 32-bit counterpart). The limitation to 32 bits is needed to properly support architectures that are not able to read 64-bit values atomically.
The other way round, however, a 32-bit implementation does not need to support a 64-bit mode, in which case this function would return false.