]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kern/arm/timer-arm.cpp
update: sync
[l4.git] / kernel / fiasco / src / kern / arm / timer-arm.cpp
1 INTERFACE [arm]:
2
3 EXTENSION class Timer
4 {
5 public:
6   static unsigned irq_mode() { return 0; }
7
8 private:
9   static inline void update_one_shot(Unsigned64 wakeup);
10 };
11
12 // ------------------------------------------------------------------------
13 IMPLEMENTATION [arm]:
14
15 #include "config.h"
16 #include "globals.h"
17 #include "kip.h"
18 #include "watchdog.h"
19
20 IMPLEMENT inline NEEDS["kip.h"]
21 void
22 Timer::init_system_clock()
23 {
24   Kip::k()->clock = 0;
25 }
26
27 IMPLEMENT inline NEEDS["config.h", "globals.h", "kip.h", "watchdog.h"]
28 void
29 Timer::update_system_clock(unsigned cpu)
30 {
31   if (cpu == 0)
32     {
33       Kip::k()->clock += Config::Scheduler_granularity;
34       Watchdog::touch();
35     }
36 }
37
38 IMPLEMENT inline NEEDS[Timer::update_one_shot, "config.h"]
39 void
40 Timer::update_timer(Unsigned64 wakeup)
41 {
42   if (Config::Scheduler_one_shot)
43     update_one_shot(wakeup);
44 }