From 7c3f1a573237b90ef331267260358a0ec4ac9079 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Sun, 15 Jul 2007 23:39:41 -0700 Subject: Introduce boot based time The commits 411187fb05cd11676b0979d9fbf3291db69dbce2 (GTOD: persistent clock support) c1d370e167d66b10bca3b602d3740405469383de (i386: use GTOD persistent clock support) changed the monotonic time so that it no longer jumps after resume, but it's not possible to use it for boot time and process start time calculations then. Also, the uptime no longer increases during suspend. I add a variable to track the wall_to_monotonic changes, a function to get the real boot time and a function to get the boot based time from the monotonic one. [akpm@linux-foundation.org: remove exports, add comment] Signed-off-by: Tomas Janousek Cc: Tomas Smetana Cc: John Stultz Cc: Thomas Gleixner Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/time.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux/time.h') diff --git a/include/linux/time.h b/include/linux/time.h index dda9be6..4bb05a8 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -116,6 +116,8 @@ extern int do_setitimer(int which, struct itimerval *value, extern unsigned int alarm_setitimer(unsigned int seconds); extern int do_getitimer(int which, struct itimerval *value); extern void getnstimeofday(struct timespec *tv); +extern void getboottime(struct timespec *ts); +extern void monotonic_to_bootbased(struct timespec *ts); extern struct timespec timespec_trunc(struct timespec t, unsigned gran); extern int timekeeping_is_continuous(void); -- cgit v1.1