The Pedigree Project
0.1
|
#include <GPTimer.h>
Classes | |
class | Alarm |
Public Member Functions | |
GPTimer () | |
virtual | ~GPTimer () |
void | initialise (size_t timer, uintptr_t base) |
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 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) |
Public Member Functions inherited from Timer | |
virtual uint64_t | getTickCountNano () |
virtual Time::Timestamp | getUnixTimestamp () |
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. More... | |
Private Types | |
enum | Registers { TIDR = 0x00 / 4, TIOCP_CFG = 0x10 / 4, TISTAT = 0x14 / 4, TISR = 0x18 / 4, TIER = 0x1C / 4, TWER = 0x20 / 4, TCLR = 0x24 / 4, TCRR = 0x28 / 4, TLDR = 0x2C / 4, TTGR = 0x30 / 4, TWPS = 0x34 / 4, TMAR = 0x38 / 4, TCAR1 = 0x3C / 4, TSICR = 0x40 / 4, TCAR2 = 0x44 / 4, TPIR = 0x48 / 4, TNIR = 0x4C / 4, TCVR = 0x50 / 4, TOCR = 0x54 / 4, TOWR = 0x58 / 4 } |
Private Member Functions | |
GPTimer (const Timer &) | |
GPTimer & | operator= (const Timer &) |
virtual void | interrupt (size_t nInterruptnumber, InterruptState &state) |
Private Attributes | |
MemoryRegion | m_MmioBase |
bool | m_bIrqInstalled |
size_t | m_Irq |
TimerHandler * | m_Handlers [MAX_TIMER_HANDLERS] |
List< Alarm * > | m_Alarms |
uint64_t | m_TickCount |
Additional Inherited Members | |
Protected Member Functions inherited from Timer | |
Timer () | |
virtual | ~Timer () |
Protected Member Functions inherited from SchedulerTimer | |
SchedulerTimer () | |
virtual | ~SchedulerTimer () |
Protected Member Functions inherited from InterruptHandler | |
virtual | ~InterruptHandler () |
Driver for a general purpose timer - provide the MMIO base during initialisation and it'll be able to generate IRQs and call handlers and all that good stuff.
|
private |
|
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 175 of file GPTimer.cc.
References Processor::information().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
void GPTimer::initialise | ( | size_t | timer, |
uintptr_t | base | ||
) |
Initialises this timer
Definition at line 60 of file GPTimer.cc.
References Spinlock::acquire(), PhysicalMemoryManager::continuous, Dec, Hex, InterruptManager::instance(), PhysicalMemoryManager::instance(), VirtualAddressSpace::KernelMode, NOTICE, InterruptManager::registerInterruptHandler(), Spinlock::release(), Prcm::SelectClockPER(), Prcm::SetFuncClockPER(), Prcm::SetIfaceClockPER(), MemoryRegion::virtualAddress(), and VirtualAddressSpace::Write.
|
privatevirtual |
Called when the handler is registered with the interrupt manager and the interrupt occurred
[in] | nInterruptNumber | the interrupt number |
[in] | state | reference to the state before the interrupt |
Implements InterruptHandler.
Definition at line 236 of file GPTimer.cc.
References Thread::sendEvent(), and MemoryRegion::virtualAddress().
|
virtual |
Removes the event pEvent
from the alarm queue.
pEvent | Event to remove alarm for. |
Implements Timer.
Definition at line 185 of file GPTimer.cc.
|
virtual |
Removes the event pEvent
from the alarm queue.
pEvent | Event to remove alarm for. |
bRetZero | If true, returns zero rather the time until firing |
Implements Timer.
Definition at line 200 of file GPTimer.cc.
|
private |
|
private |
|
private |
|
private |