]> git.hungrycats.org Git - linux/commitdiff
PPC32: convert xtime usage from timeval to timespec
authorPaul Mackerras <paulus@samba.org>
Mon, 16 Sep 2002 18:53:35 +0000 (04:53 +1000)
committerPaul Mackerras <paulus@samba.org>
Mon, 16 Sep 2002 18:53:35 +0000 (04:53 +1000)
arch/ppc/kernel/time.c
arch/ppc/platforms/pmac_time.c

index 0f15c00dbc29006797a190f12569a5175d8de5fa..6690e876e1a4f34a410a3978f9484b55adacadf7 100644 (file)
@@ -193,7 +193,7 @@ void timer_interrupt(struct pt_regs * regs)
                 */
                if ( ppc_md.set_rtc_time && (time_status & STA_UNSYNC) == 0 &&
                     xtime.tv_sec - last_rtc_update >= 659 &&
-                    abs(xtime.tv_usec - (1000000-1000000/HZ)) < 500000/HZ &&
+                    abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ &&
                     jiffies - wall_jiffies == 1) {
                        if (ppc_md.set_rtc_time(xtime.tv_sec+1 + time_offset) == 0)
                                last_rtc_update = xtime.tv_sec+1;
@@ -228,7 +228,7 @@ void do_gettimeofday(struct timeval *tv)
 
        read_lock_irqsave(&xtime_lock, flags);
        sec = xtime.tv_sec;
-       usec = xtime.tv_usec;
+       usec = (xtime.tv_nsec / 1000);
 #ifdef CONFIG_PPC_ISERIES
        delta = tb_ticks_per_jiffy - ( next_jiffy_update_tb[0] - get_tb64() );
 #else
@@ -285,7 +285,7 @@ void do_settimeofday(struct timeval *tv)
                new_sec--; 
                new_usec += 1000000;
        }
-       xtime.tv_usec = new_usec;
+       xtime.tv_nsec = (new_usec * 1000);
        xtime.tv_sec = new_sec;
 
        /* In case of a large backwards jump in time with NTP, we want the 
@@ -344,7 +344,7 @@ void __init time_init(void)
                write_lock_irqsave(&xtime_lock, flags);
                xtime.tv_sec = sec;
                last_jiffy_stamp(0) = tb_last_stamp = stamp;
-               xtime.tv_usec = 0;
+               xtime.tv_nsec = 0;
                /* No update now, we just read the time from the RTC ! */
                last_rtc_update = xtime.tv_sec;
                write_unlock_irqrestore(&xtime_lock, flags);
index 650c3e6e23e858fcaf26a901a0dab0038e5d6ef6..5f7029b25ad2a684aeba3b1dd3d90123dbabe532 100644 (file)
@@ -228,7 +228,7 @@ time_sleep_notify(struct pmu_sleep_notifier *self, int when)
        case PBOOK_WAKE:
                write_lock_irqsave(&xtime_lock, flags);
                xtime.tv_sec = pmac_get_rtc_time() + time_diff;
-               xtime.tv_usec = 0;
+               xtime.tv_nsec = 0;
                last_rtc_update = xtime.tv_sec;
                write_unlock_irqrestore(&xtime_lock, flags);
                break;