[PATCH 07/11] Convert um to use read_persistent_clock

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: John Stultz
Date: Tuesday, July 13, 2010 - 5:56 pm

This patch converts the um arch to use read_persistent_clock().
This allows it to avoid accessing xtime and wall_to_monotonic
directly.

This patch is un-tested, so any help by testers or maintainers would
be greatly appreciated!

Signed-off-by: John Stultz <johnstul@us.ibm.com>
CC: Jeff Dike <jdike@addtoit.com>
CC: Thomas Gleixner <tglx@linutronix.de>
---
 arch/um/kernel/time.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index c8b9c46..2b8b262 100644
--- a/arch/um/kernel/time.c
+++ b/arch/um/kernel/time.c
@@ -102,16 +102,17 @@ static void __init setup_itimer(void)
 	clockevents_register_device(&itimer_clockevent);
 }
 
+void read_persistent_clock(struct timespec *ts)
+{
+	nsecs = os_nsecs();
+	set_normalized_timespec(ts, nsecs / NSEC_PER_SEC,
+				nsecs % NSEC_PER_SEC);
+}
+
 void __init time_init(void)
 {
 	long long nsecs;
 
 	timer_init();
-
-	nsecs = os_nsecs();
-	set_normalized_timespec(&wall_to_monotonic, -nsecs / NSEC_PER_SEC,
-				-nsecs % NSEC_PER_SEC);
-	set_normalized_timespec(&xtime, nsecs / NSEC_PER_SEC,
-				nsecs % NSEC_PER_SEC);
 	late_time_init = setup_itimer;
 }
-- 
1.6.0.4

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 02/11] Implement timespec_add, John Stultz, (Tue Jul 13, 5:56 pm)
[PATCH 03/11] time: Kill off CONFIG_GENERIC_TIME, John Stultz, (Tue Jul 13, 5:56 pm)
[PATCH 04/11] powerpc: Simplify update_vsyscall, John Stultz, (Tue Jul 13, 5:56 pm)
[PATCH 05/11] powerpc: Cleanup xtime usage, John Stultz, (Tue Jul 13, 5:56 pm)
[PATCH 07/11] Convert um to use read_persistent_clock, John Stultz, (Tue Jul 13, 5:56 pm)
[tip:timers/clocksource] x86: Fix vtime/file timestamp inc ..., tip-bot for John Stultz, (Tue Jul 27, 3:45 am)
[tip:timers/clocksource] time: Implement timespec_add, tip-bot for John Stultz, (Tue Jul 27, 3:46 am)
[tip:timers/clocksource] time: Kill off CONFIG_GENERIC_TIME, tip-bot for John Stultz, (Tue Jul 27, 3:46 am)
[tip:timers/clocksource] powerpc: Simplify update_vsyscall, tip-bot for John Stultz, (Tue Jul 27, 3:46 am)
[tip:timers/clocksource] powerpc: Cleanup xtime usage, tip-bot for John Stultz, (Tue Jul 27, 3:47 am)
[tip:timers/clocksource] timkeeping: Fix update_vsyscall t ..., tip-bot for John Stultz, (Tue Jul 27, 3:47 am)
[tip:timers/clocksource] um: Convert to use read_persisten ..., tip-bot for John Stultz, (Tue Jul 27, 3:47 am)
[tip:timers/clocksource] hrtimer: Cleanup direct access to ..., tip-bot for John Stultz, (Tue Jul 27, 3:48 am)
Re: [PATCH 04/11] powerpc: Simplify update_vsyscall, Paul Mackerras, (Tue Jul 27, 4:41 pm)
Re: [PATCH 04/11] powerpc: Simplify update_vsyscall, john stultz, (Tue Jul 27, 6:33 pm)