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