The Pedigree Project
0.1
|
Public Types | |
enum | Mode { Hardware = 0, Virtual, Profile } |
Public Member Functions | |
IntervalTimer (PosixProcess *pProcess, Mode mode=Hardware) | |
void | setInterval (Time::Timestamp interval, Time::Timestamp *prevInterval=nullptr) |
void | setTimerValue (Time::Timestamp value, Time::Timestamp *prevValue=nullptr) |
Set the current value of the timer. | |
void | setIntervalAndValue (Time::Timestamp interval, Time::Timestamp value, Time::Timestamp *prevInterval=nullptr, Time::Timestamp *prevValue=nullptr) |
Set both interval and value atomically. | |
void | getIntervalAndValue (Time::Timestamp &interval, Time::Timestamp &value) |
void | adjustValue (int64_t adjustment) |
Adjust the current value directly. | |
Time::Timestamp | getInterval () const |
Time::Timestamp | getValue () const |
Private Member Functions | |
virtual void | timer (uint64_t delta, InterruptState &state) |
void | signal () |
Private Attributes | |
PosixProcess * | m_Process |
Mode | m_Mode |
Time::Timestamp | m_Value |
Time::Timestamp | m_Interval |
Spinlock | m_Lock |
bool | m_Armed |
Definition at line 74 of file PosixProcess.h.
enum IntervalTimer::Mode |
Enumerator | |
---|---|
Hardware |
Hardware-backed timer (wall time). |
Virtual |
CPU time in user mode only. |
Profile |
CPU time in user and system. |
Definition at line 77 of file PosixProcess.h.
IntervalTimer::IntervalTimer | ( | PosixProcess * | pProcess, |
Mode | mode = Hardware |
||
) |
Setting hw=true will use hardware. hw=false requires adjust() to be called to be able to trigger timers.
Definition at line 232 of file PosixProcess.cc.
References Machine::getTimer(), and Hardware.
void IntervalTimer::setInterval | ( | Time::Timestamp | interval, |
Time::Timestamp * | prevInterval = nullptr |
||
) |
Set the interval for the timer, which is loaded once the timer expires. Set zero to make a non-reloading timer.
Definition at line 258 of file PosixProcess.cc.
|
private |
Definition at line 391 of file PosixProcess.cc.
References Process::getThread(), Hardware, Profile, PosixSubsystem::sendSignal(), and Virtual.
Referenced by adjustValue(), and timer().
|
privatevirtual |
Called when the handler is registered with the Timer/SchedulerTimer class and a timer event occured
[in] | delta | time elapsed since the last event, in nanoseconds |
[in,out] | state | the state of the processor when the event occurred. |
Implements TimerHandler.
Definition at line 355 of file PosixProcess.cc.