1 INTERFACE [hpet_timer]:
8 IMPLEMENTATION [hpet_timer]:
16 #include "std_macros.h"
22 PUBLIC static inline int Timer::irq() { return hpet_irq; }
24 PUBLIC static inline NEEDS["irq_chip.h"]
25 unsigned Timer::irq_mode()
26 { return Irq_base::Trigger_level | Irq_base::Polarity_low; }
30 Timer::init(Cpu_number)
36 hpet_irq = Hpet::int_num();
37 if (hpet_irq == 0 && Hpet::int_avail(2))
40 if (Config::Scheduler_one_shot)
46 // setup hpet for periodic here
49 if (!Config::Scheduler_one_shot)
50 // from now we can save energy in getchar()
51 Config::getchar_does_hlt_works_ok = Config::hlt_works_ok;
56 printf("Using HPET timer on IRQ %d (%s Mode) for scheduling\n",
58 Config::Scheduler_one_shot ? "One-Shot" : "Periodic");
68 Timer::update_one_shot(Unsigned64 /*wakeup*/)
74 Timer::update_timer(Unsigned64 /*wakeup*/)