|
The Pedigree Project 0.1
|
Inheritance diagram for HostedTimer:
Collaboration diagram for HostedTimer:Classes | |
| class | Alarm |
Public Member Functions | |
| virtual bool | registerHandler (TimerHandler *handler) |
| virtual bool | unregisterHandler (TimerHandler *handler) |
| virtual void | addAlarm (class Event *pEvent, size_t alarmSecs, size_t alarmUsecs=0) |
| virtual void | removeAlarm (class Event *pEvent) |
| virtual size_t | removeAlarm (class Event *pEvent, bool bRetZero) |
| virtual size_t | getYear () |
| virtual uint8_t | getMonth () |
| virtual uint8_t | getDayOfMonth () |
| virtual uint8_t | getDayOfWeek () |
| virtual uint8_t | getHour () |
| virtual uint8_t | getMinute () |
| virtual uint8_t | getSecond () |
| virtual uint64_t | getNanosecond () |
| virtual uint64_t | getTickCount () |
| virtual uint64_t | getTickCountNano () |
| bool | initialise1 () INITIALISATION_ONLY |
| bool | initialise3 () |
| virtual void | synchronise (bool tohw=false) |
| void | uninitialise () |
Public Member Functions inherited from Timer | |
| virtual uint64_t | getTickCountNanoFast () |
| virtual Time::CpuTimeSample | sampleCpuTime () |
| virtual Time::Timestamp | getUnixTimestamp () |
| virtual bool | armHandler (TimerHandler *, uint64_t) |
| virtual bool | supportsDeadlines () const |
| virtual void | deadlineInterrupt () |
Static Public Member Functions | |
| static HostedTimer & | instance () |
Protected Member Functions | |
| HostedTimer () INITIALISATION_ONLY | |
| virtual | ~HostedTimer () |
Protected Member Functions inherited from Timer | |
| Timer () | |
| virtual | ~Timer () |
Private Member Functions | |
| HostedTimer (const HostedTimer &) | |
| HostedTimer & | operator= (const HostedTimer &) |
| 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 |
| void | processTimerBatch (uint64_t delta) |
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 () |
Private Attributes | |
| size_t | m_Year |
| uint8_t | m_Month |
| uint8_t | m_DayOfMonth |
| uint8_t | m_DayOfWeek |
| uint8_t | m_Hour |
| uint8_t | m_Minute |
| uint8_t | m_Second |
| uint64_t | m_Nanosecond |
| HostedTickSource | m_TickSource |
| irq_id_t | m_IrqId |
| IrqEventCounter | m_PendingExpirations |
| TimerHandlerRegistry | m_HandlerRegistry |
| List< Alarm * > | m_Alarms |
| Spinlock | m_AlarmLock |
| bool | m_bInitialized = false |
| bool | m_bPrepared = false |
Static Private Attributes | |
| static HostedTimer | m_Instance |
Additional Inherited Members | |
Private Types inherited from SplitIrqHandler | |
| enum class | HardStageDisposition : size_t { NotHandled , Handled , Deferred } |
Definition at line 38 of file kernel/machine/hosted/Timer.h.
|
protected |
The default constructor
Definition at line 317 of file hosted/Timer.cc.
|
protectedvirtual |
|
private |
The copy-constructor
|
virtual |
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 69 of file hosted/Timer.cc.
References getTickCountNano(), ProcessorBase::information(), m_AlarmLock, and m_Alarms.
|
virtual |
Get the current day of month
Implements Timer.
Definition at line 180 of file hosted/Timer.cc.
References m_DayOfMonth.
|
virtual |
Get the current day of week
Implements Timer.
Definition at line 184 of file hosted/Timer.cc.
References m_DayOfWeek.
|
virtual |
Get the current hour
Implements Timer.
Definition at line 188 of file hosted/Timer.cc.
References m_Hour.
|
virtual |
Get the current minute
Implements Timer.
Definition at line 192 of file hosted/Timer.cc.
References m_Minute.
|
virtual |
Get the current month
Implements Timer.
Definition at line 176 of file hosted/Timer.cc.
References m_Month.
|
virtual |
Get the current nanosecond
Implements Timer.
Definition at line 200 of file hosted/Timer.cc.
References m_Nanosecond.
|
virtual |
Get the current second
Implements Timer.
Definition at line 196 of file hosted/Timer.cc.
References m_Second.
|
virtual |
Get the Tick count (time elapsed since system bootup)
Implements Timer.
Definition at line 204 of file hosted/Timer.cc.
References getTickCountNano().
|
virtual |
Get the Tick count (time elapsed since system bootup) in nanosconds.
Reimplemented from Timer.
Definition at line 208 of file hosted/Timer.cc.
Referenced by addAlarm(), getTickCount(), processTimerBatch(), and removeAlarm().
Here is the caller graph for this function:
|
virtual |
Get the current year
Implements Timer.
Definition at line 172 of file hosted/Timer.cc.
References m_Year.
|
overrideprivatevirtual |
Runs in hard IRQ context and must be bounded and nonblocking.
Implements SplitIrqHandler.
Definition at line 334 of file hosted/Timer.cc.
References m_PendingExpirations, m_TickSource, and IrqEventCounter::recordFromInterrupt().
| bool HostedTimer::initialise1 | ( | ) |
Prepares the unarmed POSIX timer
Definition at line 214 of file hosted/Timer.cc.
References m_bInitialized, m_bPrepared, m_HandlerRegistry, m_TickSource, TimerHandlerRegistry::reset(), and synchronise().
| bool HostedTimer::initialise3 | ( | ) |
Starts the timer bottom half before enabling periodic delivery.
Definition at line 229 of file hosted/Timer.cc.
References SplitIrqHandler::initialiseSplitIrq(), m_bInitialized, m_bPrepared, m_IrqId, m_PendingExpirations, m_TickSource, SplitIrqHandler::registerIsaSplitIrq(), and SplitIrqHandler::shutdownSplitIrq().
|
inlinestatic |
Definition at line 40 of file kernel/machine/hosted/Timer.h.
|
private |
The assignment operator
|
private |
Applies one captured expiration batch in ordinary thread context.
Definition at line 391 of file hosted/Timer.cc.
References Spinlock::acquire(), TimerHandlerRegistry::dispatch(), TargetInfo::getPageSize(), Machine::getSerial(), getTickCountNano(), m_AlarmLock, m_Alarms, m_HandlerRegistry, m_Nanosecond, Spinlock::release(), Thread::sendEvent(), synchronise(), IrqManager::tick(), and UNLIKELY.
Referenced by threadedIrq().
Here is the caller graph for this function:
|
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 382 of file hosted/Timer.cc.
References m_TickSource.
|
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 386 of file hosted/Timer.cc.
|
virtual |
Implements Timer.
Definition at line 122 of file hosted/Timer.cc.
|
virtual |
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 78 of file hosted/Timer.cc.
References m_AlarmLock, and m_Alarms.
|
virtual |
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 90 of file hosted/Timer.cc.
References getTickCountNano(), m_AlarmLock, and m_Alarms.
|
virtual |
Synchronise the time/date with the hardware
Reimplemented from Timer.
Definition at line 268 of file hosted/Timer.cc.
References m_DayOfMonth, m_DayOfWeek, m_Hour, m_Minute, m_Month, m_Nanosecond, m_Second, and m_Year.
Referenced by initialise1(), processTimerBatch(), and uninitialise().
Here is the caller graph for this function:
|
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 363 of file hosted/Timer.cc.
References m_PendingExpirations, processTimerBatch(), and IrqEventCounter::takeAll().
| void HostedTimer::uninitialise | ( | ) |
Uninitialises the class
Definition at line 288 of file hosted/Timer.cc.
References m_AlarmLock, m_Alarms, m_bInitialized, m_bPrepared, m_HandlerRegistry, m_IrqId, m_TickSource, TimerHandlerRegistry::reset(), SplitIrqHandler::shutdownSplitIrq(), and synchronise().
Referenced by HostedMachine::deinitialise(), and ~HostedTimer().
Here is the caller graph for this function:
|
virtual |
Implements Timer.
Definition at line 126 of file hosted/Timer.cc.
|
private |
Alarm modification lock.
Definition at line 177 of file kernel/machine/hosted/Timer.h.
Referenced by addAlarm(), processTimerBatch(), removeAlarm(), removeAlarm(), and uninitialise().
List of alarms.
Definition at line 174 of file kernel/machine/hosted/Timer.h.
Referenced by addAlarm(), processTimerBatch(), removeAlarm(), removeAlarm(), and uninitialise().
|
private |
Are we init-ed?
Definition at line 184 of file kernel/machine/hosted/Timer.h.
Referenced by initialise1(), initialise3(), and uninitialise().
|
private |
Has the unarmed POSIX timer been created?
Definition at line 187 of file kernel/machine/hosted/Timer.h.
Referenced by initialise1(), initialise3(), and uninitialise().
|
private |
The current day of month
Definition at line 132 of file kernel/machine/hosted/Timer.h.
Referenced by getDayOfMonth(), and synchronise().
|
private |
The current day of week
Definition at line 134 of file kernel/machine/hosted/Timer.h.
Referenced by getDayOfWeek(), and synchronise().
|
private |
Timer handlers and their callback lifetime state.
Definition at line 157 of file kernel/machine/hosted/Timer.h.
Referenced by initialise1(), processTimerBatch(), and uninitialise().
|
private |
The current hour
Definition at line 136 of file kernel/machine/hosted/Timer.h.
Referenced by getHour(), and synchronise().
|
staticprivate |
The HostedTimer class instance
Definition at line 154 of file kernel/machine/hosted/Timer.h.
|
private |
Registered handler.
Definition at line 148 of file kernel/machine/hosted/Timer.h.
Referenced by initialise3(), and uninitialise().
|
private |
The current minute
Definition at line 138 of file kernel/machine/hosted/Timer.h.
Referenced by getMinute(), and synchronise().
|
private |
The current month
Definition at line 130 of file kernel/machine/hosted/Timer.h.
Referenced by getMonth(), and synchronise().
|
private |
The current nanosecond
Definition at line 142 of file kernel/machine/hosted/Timer.h.
Referenced by getNanosecond(), processTimerBatch(), and synchronise().
|
private |
Delivered expirations preserved across worker coalescing.
Definition at line 151 of file kernel/machine/hosted/Timer.h.
Referenced by hardIrq(), initialise3(), and threadedIrq().
|
private |
The current second
Definition at line 140 of file kernel/machine/hosted/Timer.h.
Referenced by getSecond(), and synchronise().
|
private |
Periodic signal source.
Definition at line 145 of file kernel/machine/hosted/Timer.h.
Referenced by hardIrq(), initialise1(), initialise3(), quiesceIrqSources(), and uninitialise().
|
private |
The current year
Definition at line 128 of file kernel/machine/hosted/Timer.h.
Referenced by getYear(), and synchronise().