/* * mtime, short for monotonic time, starts from 0 when system starts up. * It is a 64-bit variable counted in units of nanoseconds, which gives * ~584 years of time for the unsigned version. * * mtime is implemented on top of tock. By reading tock values regularly * mtime can be advanced accordingly. * * mtime can be adjusted to achieve high accuracy, either by exploring * intrinsic tock skewing or through external time source. Any adjustment to * mtime will preserve the monotonicity, i.e., no two consecutive * mtime readings will show backward movement in mtime. * * mtimers are timers that expire in mtime. The callback of mtimer * when it expires is in interrupt context. */ #ifndef _LINUX_MTIME_H #define _LINUX_MTIME_H #include #include /* * latch and return current mtime. */ u64 mtime_latch(void); /* * return the last latched mtime. */ u64 mtime_get(void); /* * Adjust mtime with the specified offset. Return the amount of time * actually adjusted. */ s64 mtime_adjust(s64 delta); /* * mtimers */ void mtimer_add(struct mtimer_struct *); void mtimer_del(struct mtimer_struct *); void mtimer_mod(struct mtimer_struct *, u64 new_expire); #endif