The Watch device deals with timer interrupts.
More...
#include <device/watch.h>
The Watch device deals with timer interrupts.
Handles LAPIC::Timer interrupts, therefore managing the time slices and triggering a thread switch if necessary.
◆ Watch() [1/2]
◆ Watch() [2/2]
◆ operator=()
◆ windup()
Windup / initialize.
Assigns itself to the Plugbox and initializes the LAPIC::Timer in such a way that regular interrupts are triggered approx. every us
microseconds. However, the LAPIC::Timer is not armed until Watch::activate() is called. Hence, Watch::windup() just sets up all the values. For this purpose, a suitable timer divisor is determined based on the timer frequency determined with LAPIC::Timer::ticks(). This timer divisor has to be as small as possible, but large enough to prevent the 32bit counter from overflowing.
- Parameters
-
us | Desired interrupt interval in microseconds. |
- Returns
- Indicates if the interval could be set.
◆ prologue()
Prologue of timer interrupts.
- Returns
true
if the Watch::epilogue should be executed.
Implements Gate.
◆ epilogue()
◆ interval()
Retrieve the interrupt interval.
- Returns
- Interval in microseconds
◆ activate()
void Watch::activate |
( |
| ) |
const |
Activate the timer on this core.
Activate the LAPIC::Timer using LAPIC::Timer::set(). The core local timer starts with the interval previously configured in windup(). To get timer interrupts on all cores, this method must be called once per core (however, it is sufficient to call windup only once since the APIC-Bus frequency is the same on each core).
◆ block()
◆ unblock()
Allow the previously blocked timer interrupts on this core.
Logical counterpart to Watch::block(). Allows the delivery of core local timer interrupts again.
- Optional:
- Implement for tickless kernel
◆ interv
◆ ticks
◆ div
The documentation for this class was generated from the following files: