Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv14997/arch/vax/kernel
Modified Files:
time.c
Log Message:
xtime_lock becomes a seqlock in 2.5.60
Index: time.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/kernel/time.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- time.c 16 Jul 2003 23:14:05 -0000 1.10
+++ time.c 4 Aug 2003 23:37:54 -0000 1.11
@@ -33,7 +33,6 @@
u64 jiffies_64;
spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
-extern rwlock_t xtime_lock;
extern unsigned long wall_jiffies; /* kernel/timer.c */
#define TICK_SIZE (tick_nsec / 1000)
@@ -153,7 +152,7 @@
* the irq version of write_lock because as just said we have irq
* locally disabled. -arca
*/
- write_lock(&xtime_lock);
+ write_seqlock(&xtime_lock);
iccs = __mfpr(PR_ICCS);
@@ -189,7 +188,7 @@
ICCS_RUN, /* ... and go again */
PR_ICCS);
- write_unlock(&xtime_lock);
+ write_sequnlock(&xtime_lock);
}
@@ -215,19 +214,21 @@
void do_gettimeofday(struct timeval *tv)
{
unsigned long flags;
+ unsigned long seq;
unsigned long usec, sec;
- read_lock_irqsave(&xtime_lock, flags);
+ do {
+ seq = read_seqbegin_irqsave(&xtime_lock, flags);
- usec = do_gettimeoffset();
- {
- unsigned long lost = jiffies - wall_jiffies;
- if (lost)
- usec += lost * (1000000 / HZ);
- }
- sec = xtime.tv_sec;
- usec += (xtime.tv_nsec / 1000);
- read_unlock_irqrestore(&xtime_lock, flags);
+ usec = do_gettimeoffset();
+ {
+ unsigned long lost = jiffies - wall_jiffies;
+ if (lost)
+ usec += lost * (1000000 / HZ);
+ }
+ sec = xtime.tv_sec;
+ usec += (xtime.tv_nsec / 1000);
+ } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
while (usec >= 1000000) {
usec -= 1000000;
@@ -240,7 +241,7 @@
void do_settimeofday(struct timeval *tv)
{
- write_lock_irq(&xtime_lock);
+ 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
@@ -261,7 +262,7 @@
time_status |= STA_UNSYNC;
time_maxerror = NTP_PHASE_LIMIT;
time_esterror = NTP_PHASE_LIMIT;
- write_unlock_irq(&xtime_lock);
+ write_sequnlock_irq(&xtime_lock);
}
/* nicked from the i386 port, but we use the same chip, hee hee */
|