|
The Pedigree Project 0.1
|
#include <Timer.h>
Inheritance diagram for VirtTimer:
Collaboration diagram for VirtTimer:Classes | |
| struct | Alarm |
Public Member Functions | |
| bool | initialise1 () |
| bool | initialise3 () |
| void | uninitialise () |
| size_t | getYear () override |
| uint8_t | getMonth () override |
| uint8_t | getDayOfMonth () override |
| uint8_t | getDayOfWeek () override |
| uint8_t | getHour () override |
| uint8_t | getMinute () override |
| uint8_t | getSecond () override |
| uint64_t | getNanosecond () override |
| uint64_t | getTickCount () override |
| uint64_t | getTickCountNano () override |
| uint64_t | getTickCountNanoFast () override |
| Time::Timestamp | getUnixTimestamp () override |
| void | synchronise (bool tohw=false) override |
| Synchronises the timer with the hardware. Useful for updating the fields returned by get*, especially if IRQs are not enabled. | |
| bool | registerHandler (TimerHandler *handler) override |
| bool | unregisterHandler (TimerHandler *handler) override |
| void | addAlarm (Event *event, size_t seconds, size_t microseconds=0) override |
| void | removeAlarm (Event *event) override |
| size_t | removeAlarm (Event *event, bool returnZero) override |
Public Member Functions inherited from Timer | |
| virtual Time::CpuTimeSample | sampleCpuTime () |
| virtual bool | armHandler (TimerHandler *, uint64_t) |
| virtual bool | supportsDeadlines () const |
| virtual void | deadlineInterrupt () |
Static Public Member Functions | |
| static VirtTimer & | instance () |
Private Member Functions | |
| HardStageDisposition | hardIrq (irq_id_t number, InterruptState &state, size_t &work) override |
| void | threadedIrq (size_t work) override |
| bool | quiesceIrqSources () override |
| void | rearmIrqSources (size_t work) override |
| uint64_t | ticksToNanoseconds (uint64_t ticks) const |
| void | processElapsed (uint64_t nanoseconds) |
| void | updateCivilTime (uint64_t seconds) |
Private Member Functions inherited from SplitIrqHandler | |
| SplitIrqHandler (const String &name) | |
| bool | initialiseSplitIrq () |
| irq_id_t | registerIsaSplitIrq (IrqManager &manager, uint8_t irq, const IrqPolicy &policy) |
| irq_id_t | registerPciSplitIrq (IrqManager &manager, Device &device, const IrqPolicy &policy) |
| bool | shutdownSplitIrq () |
Static Private Member Functions | |
| static uint64_t | counter () |
Private Attributes | |
| uint64_t | m_Frequency |
| uint64_t | m_BootCount |
| uint64_t | m_LastCount |
| uint64_t | m_RtcBaseCount |
| uint64_t | m_RtcBaseSeconds |
| uint64_t | m_ElapsedSinceSync |
| uint32_t | m_IntervalTicks |
| irq_id_t | m_IrqId |
| size_t | m_Year |
| uint8_t | m_Month |
| uint8_t | m_Day |
| uint8_t | m_DayOfWeek |
| uint8_t | m_Hour |
| uint8_t | m_Minute |
| uint8_t | m_Second |
| bool | m_Prepared |
| bool | m_Initialised |
| TimerHandlerRegistry | m_Handlers |
| List< Alarm * > | m_Alarms |
| Spinlock | m_AlarmLock |
Static Private Attributes | |
| static VirtTimer | m_Instance |
Additional Inherited Members | |
Protected Member Functions inherited from Timer | |
| Timer () | |
| virtual | ~Timer () |
Private Types inherited from SplitIrqHandler | |
| enum class | HardStageDisposition : size_t { NotHandled , Handled , Deferred } |
Monotonic architectural counter, PL031 wall clock, and 1 ms timer worker.
Definition at line 20 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 46 of file mach_virt/Timer.cc.
|
overrideprivate |
Definition at line 69 of file mach_virt/Timer.cc.
|
overridevirtual |
Dispatches the Event pEvent to the current thread in alarmSecs time.
| pEvent | Event to dispatch. |
| alarmSecs | Number of seconds to wait. |
Implements Timer.
Definition at line 260 of file mach_virt/Timer.cc.
References getTickCountNano(), and ProcessorBase::information().
|
staticprivate |
Definition at line 73 of file mach_virt/Timer.cc.
|
overridevirtual |
Get the current day of month
Implements Timer.
Definition at line 232 of file mach_virt/Timer.cc.
|
overridevirtual |
Get the current day of week
Implements Timer.
Definition at line 236 of file mach_virt/Timer.cc.
|
overridevirtual |
Get the current hour
Implements Timer.
Definition at line 240 of file mach_virt/Timer.cc.
|
overridevirtual |
Get the current minute
Implements Timer.
Definition at line 244 of file mach_virt/Timer.cc.
|
overridevirtual |
Get the current month
Implements Timer.
Definition at line 228 of file mach_virt/Timer.cc.
|
overridevirtual |
Get the current nanosecond
Implements Timer.
Definition at line 188 of file mach_virt/Timer.cc.
|
overridevirtual |
Get the current second
Implements Timer.
Definition at line 248 of file mach_virt/Timer.cc.
|
overridevirtual |
Get the Tick count (time elapsed since system bootup)
Implements Timer.
Definition at line 172 of file mach_virt/Timer.cc.
References getTickCountNano().
|
overridevirtual |
Get the Tick count (time elapsed since system bootup) in nanosconds.
Reimplemented from Timer.
Definition at line 176 of file mach_virt/Timer.cc.
Referenced by addAlarm(), getTickCount(), getTickCountNanoFast(), and removeAlarm().
Here is the caller graph for this function:
|
overridevirtual |
Get the tick count while the caller already owns the IRQ-disabled window.
Reimplemented from Timer.
Definition at line 180 of file mach_virt/Timer.cc.
References getTickCountNano().
|
overridevirtual |
Get the time in UNIX timestamp form (seconds since Jan 1st, 1970).
Reimplemented from Timer.
Definition at line 184 of file mach_virt/Timer.cc.
|
overridevirtual |
Get the current year
Implements Timer.
Definition at line 224 of file mach_virt/Timer.cc.
|
overrideprivatevirtual |
Runs in hard IRQ context and must be bounded and nonblocking.
Implements SplitIrqHandler.
Definition at line 144 of file mach_virt/Timer.cc.
| bool VirtTimer::initialise1 | ( | ) |
Definition at line 85 of file mach_virt/Timer.cc.
| bool VirtTimer::initialise3 | ( | ) |
Definition at line 105 of file mach_virt/Timer.cc.
|
static |
Definition at line 42 of file mach_virt/Timer.cc.
|
private |
Definition at line 291 of file mach_virt/Timer.cc.
|
overrideprivatevirtual |
Prevents new device interrupts before registry admission is closed. This runs in thread context and must be idempotent across failed retries.
Implements SplitIrqHandler.
Definition at line 163 of file mach_virt/Timer.cc.
|
overrideprivatevirtual |
Rearms drained device sources unless shutdown has begun.
This runs in thread context with interrupts disabled and is serialised against quiesceIrqSources(). It must be bounded and nonblocking.
Implements SplitIrqHandler.
Definition at line 168 of file mach_virt/Timer.cc.
|
overridevirtual |
Implements Timer.
Definition at line 252 of file mach_virt/Timer.cc.
|
overridevirtual |
Removes the event pEvent from the alarm queue. Once this returns, the timer will not begin another delivery of this event.
| pEvent | Event to remove alarm for. |
Implements Timer.
Definition at line 268 of file mach_virt/Timer.cc.
References removeAlarm().
Referenced by removeAlarm().
Here is the caller graph for this function:
|
overridevirtual |
Removes the event pEvent from the alarm queue. Once this returns, the timer will not begin another delivery of this event.
| pEvent | Event to remove alarm for. |
| bRetZero | If true, returns zero rather the time until firing |
Implements Timer.
Definition at line 272 of file mach_virt/Timer.cc.
References getTickCountNano().
|
overridevirtual |
Synchronises the timer with the hardware. Useful for updating the fields returned by get*, especially if IRQs are not enabled.
| tohw | If true, syncs back to the hardware, instead of from it. |
Reimplemented from Timer.
Definition at line 213 of file mach_virt/Timer.cc.
|
overrideprivatevirtual |
Runs in ordinary thread context and may use blocking APIs. The owned worker normally calls it; teardown may call it synchronously after the worker is joined to drain a rejected publication. It must not re-enable an interrupt source.
Implements SplitIrqHandler.
Definition at line 153 of file mach_virt/Timer.cc.
|
private |
Definition at line 77 of file mach_virt/Timer.cc.
| void VirtTimer::uninitialise | ( | ) |
Definition at line 122 of file mach_virt/Timer.cc.
|
overridevirtual |
Implements Timer.
Definition at line 256 of file mach_virt/Timer.cc.
|
private |
Definition at line 192 of file mach_virt/Timer.cc.
|
private |
Definition at line 87 of file kernel/machine/mach_virt/Timer.h.
Definition at line 86 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 69 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 78 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 79 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 73 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 68 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 85 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 80 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 84 of file kernel/machine/mach_virt/Timer.h.
|
staticprivate |
Definition at line 89 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 74 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 75 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 70 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 81 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 77 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 83 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 71 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 72 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 82 of file kernel/machine/mach_virt/Timer.h.
|
private |
Definition at line 76 of file kernel/machine/mach_virt/Timer.h.