]> err.no Git - linux-2.6/commitdiff
uml: GENERIC_TIME support
authorJeff Dike <jdike@addtoit.com>
Tue, 16 Oct 2007 08:27:23 +0000 (01:27 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 16 Oct 2007 16:43:08 +0000 (09:43 -0700)
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>
arch/um/Kconfig
arch/um/kernel/ksyms.c
arch/um/kernel/time.c

index 4aabb334a84e9349543053ec0ba030776cbd62ac..53597bbcd7b0e5b879e1454cee215fa70a6562ac 100644 (file)
@@ -55,6 +55,10 @@ config GENERIC_BUG
        default y
        depends on BUG
 
+config GENERIC_TIME
+       bool
+       default y
+
 # Used in kernel/irq/manage.c and include/linux/irq.h
 config IRQ_RELEASE_METHOD
        bool
@@ -75,6 +79,7 @@ config STATIC_LINK
 
 source "arch/um/Kconfig.arch"
 source "mm/Kconfig"
+source "kernel/time/Kconfig"
 
 config LD_SCRIPT_STATIC
        bool
index 4b750014925d635dd0a9a70d7e38ccb4eed474ae..1b388b41d95d4baee359fa21b5079f582b785501 100644 (file)
@@ -67,9 +67,6 @@ EXPORT_SYMBOL(run_helper);
 EXPORT_SYMBOL(start_thread);
 EXPORT_SYMBOL(dump_thread);
 
-EXPORT_SYMBOL(do_gettimeofday);
-EXPORT_SYMBOL(do_settimeofday);
-
 #ifdef CONFIG_SMP
 
 /* required for SMP */
index 758d4f9cb22a3e63b5a0a0875bf2812467b16fb0..7678bcf830bae011f52e62eb4d804ae1f22fabcc 100644 (file)
@@ -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)