]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kern/timer.cpp
02f2a8bf4d90080cff00ddb7b09efd19546f4ac0
[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() FIASCO_INIT_CPU;
16
17   /**
18    * Acknowledges a timer IRQ.
19    *
20    * The implementation is platform specific.
21    */
22   static void acknowledge();
23
24   /**
25    * Enables the intervall timer IRQ.
26    *
27    * The implementation is platform specific.
28    */
29   static void enable();
30
31   /**
32    * Disabled the timer IRQ.
33    */
34   static void disable();
35
36   /**
37    * Initialize the system clock.
38    */
39   static void init_system_clock();
40
41   /**
42    * Advances the system clock.
43    */
44   static void update_system_clock();
45
46   /**
47    * Get the current system clock.
48    */
49   static Unsigned64 system_clock();
50
51   /**
52    * reprogram the one-shot timer to the next event.
53    */
54   static void update_timer(Unsigned64 wakeup);
55
56   static void master_cpu(unsigned cpu) { _cpu = cpu; }
57
58 private:
59   static unsigned _cpu;
60 };
61
62
63 IMPLEMENTATION:
64
65 unsigned Timer::_cpu;