diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2006-10-02 16:54:48 +0100 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-10-03 17:59:18 +0100 |
commit | 8db0201026fbb45c383176f539dc8af2a6871ab8 (patch) | |
tree | ea8b3810d13f1e92f00f7e6a4a8cd0a617675011 /arch/mips | |
parent | 3f821640341b86e47b79122d92af365fc99b5d65 (diff) | |
download | linux-8db0201026fbb45c383176f539dc8af2a6871ab8.tar.bz2 |
[MIPS] Fix wreckage after removal of tickadj; convert to GENERIC_TIME.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/Kconfig | 4 | ||||
-rw-r--r-- | arch/mips/dec/time.c | 2 | ||||
-rw-r--r-- | arch/mips/kernel/time.c | 74 |
3 files changed, 4 insertions, 76 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 9fe90507e6c7..bfab055ad7cc 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -803,6 +803,10 @@ config GENERIC_CALIBRATE_DELAY bool default y +config GENERIC_TIME + bool + default y + config SCHED_NO_NO_OMIT_FRAME_POINTER bool default y diff --git a/arch/mips/dec/time.c b/arch/mips/dec/time.c index 57294740c2dd..4cf0c06e2414 100644 --- a/arch/mips/dec/time.c +++ b/arch/mips/dec/time.c @@ -184,8 +184,6 @@ void __init dec_time_init(void) CMOS_WRITE(RTC_REF_CLCK_32KHZ | (16 - __ffs(HZ)), RTC_REG_A); } -EXPORT_SYMBOL(do_settimeofday); - void __init plat_timer_setup(struct irqaction *irq) { setup_irq(dec_interrupt[DEC_IRQ_RTC], irq); diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c index 845c7e55505d..a8340802f2d7 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c @@ -149,80 +149,6 @@ void (*mips_timer_ack)(void); unsigned int (*mips_hpt_read)(void); void (*mips_hpt_init)(unsigned int); - -/* - * This version of gettimeofday has microsecond resolution and better than - * microsecond precision on fast machines with cycle counter. - */ -void do_gettimeofday(struct timeval *tv) -{ - unsigned long seq; - unsigned long usec, sec; - unsigned long max_ntp_tick; - - do { - seq = read_seqbegin(&xtime_lock); - - usec = do_gettimeoffset(); - - /* - * If time_adjust is negative then NTP is slowing the clock - * so make sure not to go into next possible interval. - * Better to lose some accuracy than have time go backwards.. - */ - if (unlikely(time_adjust < 0)) { - max_ntp_tick = (USEC_PER_SEC / HZ) - tickadj; - usec = min(usec, max_ntp_tick); - } - - sec = xtime.tv_sec; - usec += (xtime.tv_nsec / 1000); - - } while (read_seqretry(&xtime_lock, seq)); - - while (usec >= 1000000) { - usec -= 1000000; - sec++; - } - - tv->tv_sec = sec; - tv->tv_usec = usec; -} - -EXPORT_SYMBOL(do_gettimeofday); - -int do_settimeofday(struct timespec *tv) -{ - time_t wtm_sec, sec = tv->tv_sec; - long wtm_nsec, nsec = tv->tv_nsec; - - if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) - return -EINVAL; - - write_seqlock_irq(&xtime_lock); - - /* - * This is revolting. We need to set "xtime" correctly. However, - * the value in this location is the value at the most recent update - * of wall time. Discover what correction gettimeofday() would have - * made, and then undo it! - */ - nsec -= do_gettimeoffset() * NSEC_PER_USEC; - - wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); - wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); - - set_normalized_timespec(&xtime, sec, nsec); - set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec); - - ntp_clear(); - write_sequnlock_irq(&xtime_lock); - clock_was_set(); - return 0; -} - -EXPORT_SYMBOL(do_settimeofday); - /* * Gettimeoffset routines. These routines returns the time duration * since last timer interrupt in usecs. |