From 5cb38bc47bf370570fce81f89e05e5250169060f Mon Sep 17 00:00:00 2001 From: Jeff Dike Date: Sun, 4 Jun 2006 02:51:46 -0700 Subject: [PATCH] uml: fix wall_to_monotonic initialization From: Jeff Dike 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 Cc: Paolo 'Blaisorblade' Giarrusso Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/um/kernel/time_kern.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'arch/um/kernel') diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c index 528cf623f8b4..86f51d04c98d 100644 --- a/arch/um/kernel/time_kern.c +++ b/arch/um/kernel/time_kern.c @@ -84,6 +84,16 @@ void timer_irq(union uml_pt_regs *regs) } } + +void time_init_kern(void) +{ + unsigned long long nsecs; + + nsecs = os_nsecs(); + set_normalized_timespec(&wall_to_monotonic, -nsecs / BILLION, + -nsecs % BILLION); +} + void do_boot_timer_handler(struct sigcontext * sc) { struct pt_regs regs; -- cgit v1.2.3