diff options
author | Jeff Dike <jdike@addtoit.com> | 2006-06-04 05:51:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-05 15:29:17 -0400 |
commit | 5cb38bc47bf370570fce81f89e05e5250169060f (patch) | |
tree | 5df71668b2b42b575641c8f7e947769fca4e0602 /arch/um/os-Linux/time.c | |
parent | 65e62974a8a6157140259b26e7156e39f53031b6 (diff) |
[PATCH] uml: fix wall_to_monotonic initialization
From: Jeff Dike <jdike@addtoit.com>
Initialize wall_to_monotonic correctly. This fixes a problem where sleeps
lasted about one secone less than they should. This also called for a bit of
code restructuring, following a patch which Blaisorblade had been keeping.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/os-Linux/time.c')
-rw-r--r-- | arch/um/os-Linux/time.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/arch/um/os-Linux/time.c b/arch/um/os-Linux/time.c index 6f7626775acb..280c4fb9b585 100644 --- a/arch/um/os-Linux/time.c +++ b/arch/um/os-Linux/time.c | |||
@@ -81,20 +81,12 @@ void uml_idle_timer(void) | |||
81 | set_interval(ITIMER_REAL); | 81 | set_interval(ITIMER_REAL); |
82 | } | 82 | } |
83 | 83 | ||
84 | extern void ktime_get_ts(struct timespec *ts); | ||
85 | #define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) | ||
86 | |||
87 | void time_init(void) | 84 | void time_init(void) |
88 | { | 85 | { |
89 | struct timespec now; | ||
90 | |||
91 | if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR) | 86 | if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR) |
92 | panic("Couldn't set SIGVTALRM handler"); | 87 | panic("Couldn't set SIGVTALRM handler"); |
93 | set_interval(ITIMER_VIRTUAL); | 88 | set_interval(ITIMER_VIRTUAL); |
94 | 89 | time_init_kern(); | |
95 | do_posix_clock_monotonic_gettime(&now); | ||
96 | wall_to_monotonic.tv_sec = -now.tv_sec; | ||
97 | wall_to_monotonic.tv_nsec = -now.tv_nsec; | ||
98 | } | 90 | } |
99 | 91 | ||
100 | unsigned long long os_nsecs(void) | 92 | unsigned long long os_nsecs(void) |