|
The Pedigree Project 0.1
|
#include <Timer.h>
Inheritance diagram for Timer:
Collaboration diagram for Timer:Public Member Functions | |
| virtual size_t | getYear ()=0 |
| virtual uint8_t | getMonth ()=0 |
| virtual uint8_t | getDayOfMonth ()=0 |
| virtual uint8_t | getDayOfWeek ()=0 |
| virtual uint8_t | getHour ()=0 |
| virtual uint8_t | getMinute ()=0 |
| virtual uint8_t | getSecond ()=0 |
| virtual uint64_t | getNanosecond ()=0 |
| virtual uint64_t | getTickCount ()=0 |
| virtual uint64_t | getTickCountNano () |
| virtual uint64_t | getTickCountNanoFast () |
| virtual Time::CpuTimeSample | sampleCpuTime () |
| virtual Time::Timestamp | getUnixTimestamp () |
| virtual bool | registerHandler (TimerHandler *handler)=0 |
| virtual bool | unregisterHandler (TimerHandler *handler)=0 |
| virtual bool | armHandler (TimerHandler *, uint64_t) |
| virtual bool | supportsDeadlines () const |
| virtual void | deadlineInterrupt () |
| virtual void | addAlarm (class Event *pEvent, size_t alarmSecs, size_t alarmUsecs=0)=0 |
| virtual void | removeAlarm (class Event *pEvent)=0 |
| virtual size_t | removeAlarm (class Event *pEvent, bool bRetZero)=0 |
| virtual void | synchronise (bool tohw=false) |
| Synchronises the timer with the hardware. Useful for updating the fields returned by get*, especially if IRQs are not enabled. | |
Protected Member Functions | |
| Timer () | |
| virtual | ~Timer () |
Private Member Functions | |
| Timer (const Timer &) | |
| Timer & | operator= (const Timer &) |
Timer for the time-keeping
Definition at line 32 of file include/pedigree/kernel/machine/Timer.h.
|
inlineprotected |
The default constructor
Definition at line 125 of file include/pedigree/kernel/machine/Timer.h.
|
inlineprotectedvirtual |
The destructor
Definition at line 127 of file include/pedigree/kernel/machine/Timer.h.
|
private |
The copy-constructor
|
pure virtual |
Dispatches the Event pEvent to the current thread in alarmSecs time.
| pEvent | Event to dispatch. |
| alarmSecs | Number of seconds to wait. |
Implemented in HostedTimer, Rtc, and VirtTimer.
|
inlinevirtual |
Arms a registered handler for one callback at an absolute monotonic nanosecond deadline. A zero deadline disarms it. The handler may rearm itself from its callback.
Reimplemented in Rtc.
Definition at line 86 of file include/pedigree/kernel/machine/Timer.h.
Referenced by CacheManager::initialise(), RequestQueue::resume(), Uhci::timer(), Ib700Watchdog::timer(), CacheManager::timer(), and RequestQueue::RequestQueueOverrunChecker::timer().
Here is the caller graph for this function:
|
inlinevirtual |
Notifies the timekeeper of a clockevent from hard interrupt context.
Reimplemented in Rtc.
Definition at line 96 of file include/pedigree/kernel/machine/Timer.h.
Referenced by PerProcessorScheduler::timer().
Here is the caller graph for this function:
|
pure virtual |
Get the current day of month
Implemented in HostedTimer, Rtc, and VirtTimer.
Referenced by getUnixTimestamp().
Here is the caller graph for this function:
|
pure virtual |
Get the current day of week
Implemented in HostedTimer, Rtc, and VirtTimer.
|
pure virtual |
Get the current hour
Implemented in HostedTimer, Rtc, and VirtTimer.
Referenced by getUnixTimestamp().
Here is the caller graph for this function:
|
pure virtual |
Get the current minute
Implemented in HostedTimer, Rtc, and VirtTimer.
Referenced by getUnixTimestamp().
Here is the caller graph for this function:
|
pure virtual |
Get the current month
Implemented in HostedTimer, Rtc, and VirtTimer.
Referenced by getUnixTimestamp().
Here is the caller graph for this function:
|
pure virtual |
Get the current nanosecond
Implemented in HostedTimer, Rtc, and VirtTimer.
|
pure virtual |
Get the current second
Implemented in HostedTimer, Rtc, and VirtTimer.
Referenced by getUnixTimestamp().
Here is the caller graph for this function:
|
pure virtual |
Get the Tick count (time elapsed since system bootup)
Implemented in HostedTimer, Rtc, and VirtTimer.
Referenced by getTickCountNano(), and Log::LogEntry::operator<<().
Here is the caller graph for this function:
|
inlinevirtual |
Get the Tick count (time elapsed since system bootup) in nanosconds.
Reimplemented in HostedTimer, Rtc, and VirtTimer.
Definition at line 64 of file include/pedigree/kernel/machine/Timer.h.
References getTickCount().
Referenced by getTickCountNanoFast().
Here is the caller graph for this function:
|
inlinevirtual |
Get the tick count while the caller already owns the IRQ-disabled window.
Reimplemented in Rtc, and VirtTimer.
Definition at line 68 of file include/pedigree/kernel/machine/Timer.h.
References getTickCountNano().
Referenced by sampleCpuTime().
Here is the caller graph for this function:
|
virtual |
Get the time in UNIX timestamp form (seconds since Jan 1st, 1970).
Reimplemented in Rtc, and VirtTimer.
Definition at line 29 of file Timer.cc.
References getDayOfMonth(), getHour(), getMinute(), getMonth(), getSecond(), and getYear().
Referenced by Rtc::getUnixTimestamp().
Here is the caller graph for this function:
|
pure virtual |
Get the current year
Implemented in HostedTimer, Rtc, and VirtTimer.
Referenced by getUnixTimestamp().
Here is the caller graph for this function:
|
pure 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. |
Implemented in HostedTimer, Rtc, and VirtTimer.
|
pure 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 |
Implemented in HostedTimer, Rtc, and VirtTimer.
|
virtual |
Samples nanoseconds and CPU identity while the caller keeps interrupts disabled.
Reimplemented in Rtc.
Definition at line 24 of file Timer.cc.
References getTickCountNanoFast(), and ProcessorBase::index().
|
inlinevirtual |
Whether absolute handler deadlines are available on this timer.
Reimplemented in Rtc.
Definition at line 91 of file include/pedigree/kernel/machine/Timer.h.
Referenced by CacheManager::initialise(), RequestQueue::resume(), Uhci::timer(), Ib700Watchdog::timer(), HidInputManager::timer(), CacheManager::timer(), and RequestQueue::RequestQueueOverrunChecker::timer().
Here is the caller graph for this function:
|
inlinevirtual |
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 in HostedTimer, Rtc, and VirtTimer.
Definition at line 121 of file include/pedigree/kernel/machine/Timer.h.