#include <timer.h>
Public Methods | |
| Timer (VoidFunctionPtr timerHandler, int callArg, bool doRandom) | |
| ~Timer () | |
| void | TimerExpired () |
| int | TimeOfNextInterrupt () |
Private Attributes | |
| bool | randomize |
| VoidFunctionPtr | handler |
| int | arg |
|
||||||||||||||||
|
Definition at line 44 of file timer.cc. References arg, handler, randomize, TimeOfNextInterrupt, TimerHandler, TimerInt, and VoidFunctionPtr.
00045 {
00046 randomize = doRandom;
00047 handler = timerHandler;
00048 arg = callArg;
00049
00050 // schedule the first interrupt from the timer device
00051 interrupt->Schedule(TimerHandler, (int) this, TimeOfNextInterrupt(),
00052 TimerInt);
00053 }
|
|
|
Definition at line 32 of file timer.h.
00032 {}
|
|
|
Definition at line 79 of file timer.cc. References Random, and TimerTicks. Referenced by Timer, and TimerExpired.
00080 {
00081 if (randomize)
00082 return 1 + (Random() % (TimerTicks * 2));
00083 else
00084 return TimerTicks;
00085 }
|
|
|
Definition at line 62 of file timer.cc. References TimeOfNextInterrupt, TimerHandler, and TimerInt. Referenced by TimerHandler.
00063 {
00064 // schedule the next timer device interrupt
00065 interrupt->Schedule(TimerHandler, (int) this, TimeOfNextInterrupt(),
00066 TimerInt);
00067
00068 // invoke the Nachos interrupt handler for this device
00069 (*handler)(arg);
00070 }
|
|
|
Definition at line 45 of file timer.h. Referenced by Timer. |
|
|
Definition at line 44 of file timer.h. Referenced by Timer. |
|
|
Definition at line 43 of file timer.h. Referenced by Timer. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002