diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-10-09 00:00:47 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-10-09 00:00:47 +0000 |
commit | d6434e1042f3b0a6dfe1b1f615af369486f9b1fa (patch) | |
tree | e2be02f33984c48ec019c654051d27964e42c441 /arch/ppc/kernel/time.c | |
parent | 609d1e803baf519487233b765eb487f9ec227a18 (diff) |
Merge with 2.3.19.
Diffstat (limited to 'arch/ppc/kernel/time.c')
-rw-r--r-- | arch/ppc/kernel/time.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c index 5990dad90..d38fa7a22 100644 --- a/arch/ppc/kernel/time.c +++ b/arch/ppc/kernel/time.c @@ -1,5 +1,5 @@ /* - * $Id: time.c,v 1.48 1999/05/22 19:35:57 cort Exp $ + * $Id: time.c,v 1.55 1999/08/31 06:54:09 davem Exp $ * Common time routines among all ppc machines. * * Written by Cort Dougan (cort@cs.nmt.edu) to merge @@ -52,7 +52,7 @@ void smp_local_timer_interrupt(struct pt_regs *); /* keep track of when we need to update the rtc */ -unsigned long last_rtc_update = 0; +time_t last_rtc_update = 0; /* The decrementer counts down by 128 every 128ns on a 601. */ #define DECREMENTER_COUNT_601 (1000000000 / HZ) @@ -110,15 +110,15 @@ void timer_interrupt(struct pt_regs * regs) /* * update the rtc when needed */ - if ( xtime.tv_sec > last_rtc_update + 660 ) + if ( (time_status & STA_UNSYNC) && + ((xtime.tv_sec > last_rtc_update + 60) || + (xtime.tv_sec < last_rtc_update)) ) { - if (ppc_md.set_rtc_time(xtime.tv_sec) == 0) { + if (ppc_md.set_rtc_time(xtime.tv_sec) == 0) last_rtc_update = xtime.tv_sec; - } - else { + else /* do it again in 60 s */ - last_rtc_update = xtime.tv_sec - 60; - } + last_rtc_update = xtime.tv_sec; } } } @@ -176,7 +176,7 @@ void do_settimeofday(struct timeval *tv) } -__initfunc(void time_init(void)) +void __init time_init(void) { if (ppc_md.time_init != NULL) { @@ -196,10 +196,8 @@ __initfunc(void time_init(void)) xtime.tv_usec = 0; set_dec(decrementer_count); - /* mark the rtc/on-chip timer as in sync - * so we don't update right away - */ - last_rtc_update = xtime.tv_sec; + /* allow setting the time right away */ + last_rtc_update = 0; } /* Converts Gregorian date to seconds since 1970-01-01 00:00:00. |