|
The Pedigree Project 0.1
|
Inheritance diagram for IntervalTimer:
Collaboration diagram for IntervalTimer: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 | disarm () |
| void | getIntervalAndValue (Time::Timestamp &interval, Time::Timestamp &value) |
| void | consumeCpuTime (Time::Timestamp absoluteTotal) |
| Time::Timestamp | getInterval () const |
| Time::Timestamp | getValue () const |
Private Member Functions | |
| virtual void | timer (uint64_t delta) |
| Time::Timestamp | absoluteTotal () const |
| bool | advanceTimeLocked (Time::Timestamp absoluteTotal) |
| void | armHardwareLocked () |
| void | setArmedLocked (bool armed) |
| void | signal () |
Private Attributes | |
| PosixProcess * | m_Process |
| Mode | m_Mode |
| Time::Timestamp | m_Value |
| Time::Timestamp | m_Interval |
| Time::Timestamp | m_LastTotal |
| Spinlock | m_Lock |
| bool | m_Armed |
| Timer * | m_pTimer |
Definition at line 57 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 59 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 172 of file PosixProcess.cc.
References Machine::getTimer(), and Hardware.
|
virtual |
Definition at line 192 of file PosixProcess.cc.
|
private |
Definition at line 304 of file PosixProcess.cc.
|
private |
Definition at line 317 of file PosixProcess.cc.
|
private |
Definition at line 327 of file PosixProcess.cc.
| void IntervalTimer::consumeCpuTime | ( | Time::Timestamp | absoluteTotal | ) |
Advances a CPU timer to a monotonic absolute process-time snapshot.
Definition at line 288 of file PosixProcess.cc.
References Hardware, and signal().
Referenced by PosixProcess::reportTimesUpdated().
Here is the caller graph for this function:| void IntervalTimer::disarm | ( | ) |
Disarms without delivering an expiry during process teardown.
Definition at line 261 of file PosixProcess.cc.
Referenced by PosixProcess::processTerminated().
Here is the caller graph for this function:| Time::Timestamp IntervalTimer::getInterval | ( | ) | const |
Definition at line 349 of file PosixProcess.cc.
| void IntervalTimer::getIntervalAndValue | ( | Time::Timestamp & | interval, |
| Time::Timestamp & | value | ||
| ) |
Definition at line 273 of file PosixProcess.cc.
| Time::Timestamp IntervalTimer::getValue | ( | ) | const |
Definition at line 353 of file PosixProcess.cc.
|
private |
Definition at line 339 of file PosixProcess.cc.
| 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 201 of file PosixProcess.cc.
References signal().
| void IntervalTimer::setIntervalAndValue | ( | Time::Timestamp | interval, |
| Time::Timestamp | value, | ||
| Time::Timestamp * | prevInterval = nullptr, |
||
| Time::Timestamp * | prevValue = nullptr |
||
| ) |
Set both interval and value atomically.
Definition at line 236 of file PosixProcess.cc.
References signal().
| void IntervalTimer::setTimerValue | ( | Time::Timestamp | value, |
| Time::Timestamp * | prevValue = nullptr |
||
| ) |
Set the current value of the timer.
Definition at line 218 of file PosixProcess.cc.
References signal().
|
private |
Definition at line 381 of file PosixProcess.cc.
References Process::acquireProcessSignalThread(), Hardware, Scheduler::instance(), Profile, PosixSubsystem::sendSignal(), signal(), and Virtual.
Referenced by consumeCpuTime(), setInterval(), setIntervalAndValue(), setTimerValue(), signal(), and timer().
Here is the caller graph for this function:
|
privatevirtual |
Called when the handler is registered with the Timer class and a timer event occurred.
| [in] | delta | time elapsed since the last event, in nanoseconds. |
Implements TimerHandler.
Definition at line 357 of file PosixProcess.cc.
|
private |
Definition at line 111 of file PosixProcess.h.
|
private |
Definition at line 108 of file PosixProcess.h.
|
private |
Definition at line 109 of file PosixProcess.h.
|
private |
Definition at line 110 of file PosixProcess.h.
|
private |
Definition at line 106 of file PosixProcess.h.
|
private |
Definition at line 105 of file PosixProcess.h.
|
private |
Definition at line 112 of file PosixProcess.h.
|
private |
Definition at line 107 of file PosixProcess.h.