mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Stultz <johnstul@us.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: John Stultz <johnstul@us.ibm.com>, Jeff Dike <jdike@addtoit.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [RFC][PATCH 4/6] Convert um to use read_persistent_clock
Date: Fri,  4 Jun 2010 19:53:24 -0700	[thread overview]
Message-ID: <1275706406-8111-5-git-send-email-johnstul@us.ibm.com> (raw)
In-Reply-To: <1275706406-8111-4-git-send-email-johnstul@us.ibm.com>

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


  reply	other threads:[~2010-06-05  2:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-05  2:53 [RFC][PATCH 0/6] xtime/wall_to_monotonic cleanups John Stultz
2010-06-05  2:53 ` [RFC][PATCH 1/6] powerpc: Simplify update_vsyscall John Stultz
2010-06-05  2:53   ` [RFC][PATCH 2/6] powerpc: Cleanup xtime usage John Stultz
2010-06-05  2:53     ` [RFC][PATCH 3/6] Fix update_vsyscall to provide wall_to_monotonic offset John Stultz
2010-06-05  2:53       ` John Stultz [this message]
2010-06-05  2:53         ` [RFC][PATCH 5/6] Cleanup hrtimer.c's direct access to wall_to_monotonic John Stultz
2010-06-05  2:53           ` [RFC][PATCH 6/6] Make xtime and wall_to_monotonic static John Stultz
2010-06-05 10:23           ` [RFC][PATCH 5/6] Cleanup hrtimer.c's direct access to wall_to_monotonic Arnd Bergmann
2010-06-05 18:01             ` john stultz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1275706406-8111-5-git-send-email-johnstul@us.ibm.com \
    --to=johnstul@us.ibm.com \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®