From: tony@bakeyournoodle.com (Tony Breeds)
To: Linux Kernel ML <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH] Add per clocksource hook to settimeofday().
Date: Wed, 13 Jun 2007 16:07:11 +1000 [thread overview]
Message-ID: <20070613060711.GM15955@bakeyournoodle.com> (raw)
I'm working on a clocksource implementation for all powerpc platforms.
some of these platforms needs to do a little work as part of the
settimeofday() syscall and I can't see a way to do that without adding
this hook to clocksource.
From: Tony Breeds <tony@bakeyournoodle.com>
Add per clocksource hook to settimeofday().
Some clocksources need to do extra work as part of the settimeofday call, this
hook make it easy to do so.
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
include/linux/clocksource.h | 3 +++
kernel/time/timekeeping.c | 3 +++
2 files changed, 6 insertions(+)
Index: working/include/linux/clocksource.h
===================================================================
--- working.orig/include/linux/clocksource.h
+++ working/include/linux/clocksource.h
@@ -50,6 +50,7 @@ struct clocksource;
* @flags: flags describing special properties
* @vread: vsyscall based read
* @resume: resume function for the clocksource, if necessary
+ * @settimeofday: [Optional] Do arch specific work during do_settimeofday
* @cycle_interval: Used internally by timekeeping core, please ignore.
* @xtime_interval: Used internally by timekeeping core, please ignore.
*/
@@ -68,6 +69,8 @@ struct clocksource {
cycle_t (*vread)(void);
void (*resume)(void);
+ void (*settimeofday)(struct clocksource *cs, struct timespec *ts);
+
/* timekeeping specific data, ignore */
cycle_t cycle_interval;
u64 xtime_interval;
Index: working/kernel/time/timekeeping.c
===================================================================
--- working.orig/kernel/time/timekeeping.c
+++ working/kernel/time/timekeeping.c
@@ -151,6 +151,9 @@ int do_settimeofday(struct timespec *tv)
clock->error = 0;
ntp_clear();
+ if (clock->settimeofday)
+ clock->settimeofday(clock, tv);
+
update_vsyscall(&xtime, clock);
write_sequnlock_irqrestore(&xtime_lock, flags);
Yours Tony
linux.conf.au http://linux.conf.au/ || http://lca2008.linux.org.au/
Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!
reply other threads:[~2007-06-13 6:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20070613060711.GM15955@bakeyournoodle.com \
--to=tony@bakeyournoodle.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®