timer.h 511 B

12345678910111213141516
  1. /* Timer API: milliseconds since timer_init(). */
  2. #ifndef TIMER_H
  3. #define TIMER_H
  4. unsigned int get_ticks_ms(void);
  5. /* The PIT and AP LAPIC timers run at 1 kHz while a process is running and
  6. * drop to 100 Hz while a CPU is idle, so C2/C3 can be held for 10 ms. The
  7. * global tick counter still advances in milliseconds. */
  8. void timer_set_hz(unsigned int hz);
  9. unsigned int timer_tick_ms(void);
  10. /* Called from the PIT stub: advance the millisecond clock by one tick. */
  11. void timer_tick_advance(void);
  12. #endif