]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kern/timer.cpp
017111581e8a44d2f59ed23832f5337ab2df5476
[l4.git] / kernel / fiasco / src / kern / timer.cpp
1 INTERFACE:
2
3 #include "initcalls.h"
4 #include "l4_types.h"
5
6 class Timer
7 {
8 public:
9   /**
10    * Static constructor for the interval timer.
11    *
12    * The implementation is platform specific. Two x86 implementations
13    * are timer-pit and timer-rtc.
14    */
15   static void init(unsigned cpu) FIASCO_INIT_CPU;
16
17   /**
18    * Initialize the system clock.
19    */
20   static void init_system_clock();
21
22   /**
23    * Advances the system clock.
24    */
25   static void update_system_clock(unsigned cpu);
26
27   /**
28    * Get the current system clock.
29    */
30   static Unsigned64 system_clock();
31
32   /**
33    * reprogram the one-shot timer to the next event.
34    */
35   static void update_timer(Unsigned64 wakeup);
36
37   static void master_cpu(unsigned cpu) { _cpu = cpu; }
38
39 private:
40   static unsigned _cpu;
41 };
42
43
44 IMPLEMENTATION:
45
46 unsigned Timer::_cpu;