diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-10-16 01:27:23 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 09:43:08 -0700 |
commit | d83d2aa9485d996cfd89f04389b419c6727faacb (patch) | |
tree | 261bd8162d132ae1855127314bf33de7c130511d /arch/um/kernel/time.c | |
parent | 78a26e25ce4837a03ac3b6c32cdae1958e547639 (diff) | |
download | blackbird-op-linux-d83d2aa9485d996cfd89f04389b419c6727faacb.tar.gz blackbird-op-linux-d83d2aa9485d996cfd89f04389b419c6727faacb.zip |
uml: GENERIC_TIME support
Enable CONFIG_GENERIC_TIME.
As a side-effect of this, the UML implementations of do_gettimeofday and
do_settimeofday go away, as these are provided by generic code. set_time also
goes away since it was only used by do_settimeofday.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/kernel/time.c')
-rw-r--r-- | arch/um/kernel/time.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index 758d4f9cb22a..7678bcf830ba 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c @@ -123,46 +123,6 @@ void time_init(void) late_time_init = register_timer; } -void do_gettimeofday(struct timeval *tv) -{ -#ifdef CONFIG_UML_REAL_TIME_CLOCK - unsigned long long nsecs = get_time(); -#else - unsigned long long nsecs = (unsigned long long) xtime.tv_sec * BILLION + - xtime.tv_nsec; -#endif - tv->tv_sec = nsecs / NSEC_PER_SEC; - /* - * Careful about calculations here - this was originally done as - * (nsecs - tv->tv_sec * NSEC_PER_SEC) / NSEC_PER_USEC - * which gave bogus (> 1000000) values. Dunno why, suspect gcc - * (4.0.0) miscompiled it, or there's a subtle 64/32-bit conversion - * problem that I missed. - */ - nsecs -= tv->tv_sec * NSEC_PER_SEC; - tv->tv_usec = (unsigned long) nsecs / NSEC_PER_USEC; -} - -static inline void set_time(unsigned long long nsecs) -{ - unsigned long long now; - unsigned long flags; - - spin_lock_irqsave(&timer_spinlock, flags); - now = os_nsecs(); - local_offset = nsecs - now; - spin_unlock_irqrestore(&timer_spinlock, flags); - - clock_was_set(); -} - -int do_settimeofday(struct timespec *tv) -{ - set_time((unsigned long long) tv->tv_sec * NSEC_PER_SEC + tv->tv_nsec); - - return 0; -} - void timer_handler(int sig, struct uml_pt_regs *regs) { if (current_thread->cpu == 0) |