diff options
author | phk <phk@FreeBSD.org> | 1998-03-30 09:56:58 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-03-30 09:56:58 +0000 |
commit | 9b703b14551addf9806978973e2ddc427d4908b4 (patch) | |
tree | 91f2de8432f719153d0de9465a9ebeee33c29077 /sys/kern | |
parent | add2782c4ec0d7c4447da2b33d1413a2754f8a3e (diff) | |
download | FreeBSD-src-9b703b14551addf9806978973e2ddc427d4908b4.zip FreeBSD-src-9b703b14551addf9806978973e2ddc427d4908b4.tar.gz |
Eradicate the variable "time" from the kernel, using various measures.
"time" wasn't a atomic variable, so splfoo() protection were needed
around any access to it, unless you just wanted the seconds part.
Most uses of time.tv_sec now uses the new variable time_second instead.
gettime() changed to getmicrotime(0.
Remove a couple of unneeded splfoo() protections, the new getmicrotime()
is atomic, (until Bruce sets a breakpoint in it).
A couple of places needed random data, so use read_random() instead
of mucking about with time which isn't random.
Add a new nfs_curusec() function.
Mark a couple of bogosities involving the now disappeard time variable.
Update ffs_update() to avoid the weird "== &time" checks, by fixing the
one remaining call that passwd &time as args.
Change profiling in ncr.c to use ticks instead of time. Resolution is
the same.
Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call
hzto() which subtracts time" sequences.
Reviewed by: bde
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/init_main.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_clock.c | 45 | ||||
-rw-r--r-- | sys/kern/kern_ntptime.c | 6 | ||||
-rw-r--r-- | sys/kern/kern_tc.c | 45 | ||||
-rw-r--r-- | sys/kern/kern_threads.c | 7 | ||||
-rw-r--r-- | sys/kern/kern_time.c | 34 | ||||
-rw-r--r-- | sys/kern/subr_trap.c | 6 | ||||
-rw-r--r-- | sys/kern/sys_generic.c | 28 | ||||
-rw-r--r-- | sys/kern/sysv_msg.c | 10 | ||||
-rw-r--r-- | sys/kern/sysv_sem.c | 6 | ||||
-rw-r--r-- | sys/kern/sysv_shm.c | 10 | ||||
-rw-r--r-- | sys/kern/tty.c | 6 | ||||
-rw-r--r-- | sys/kern/vfs_aio.c | 7 | ||||
-rw-r--r-- | sys/kern/vfs_export.c | 6 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 6 |
15 files changed, 120 insertions, 106 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index ad779c5..2372c26 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * @(#)init_main.c 8.9 (Berkeley) 1/21/94 - * $Id: init_main.c,v 1.83 1998/02/06 12:13:21 eivind Exp $ + * $Id: init_main.c,v 1.84 1998/02/15 04:16:57 dyson Exp $ */ #include "opt_devfs.h" @@ -447,7 +447,7 @@ proc0_post(dummy) * from the file system. Reset p->p_rtime as it may have been * munched in mi_switch() after the time got set. */ - gettime(&boottime); + getmicrotime(&boottime); proc0.p_stats->p_start = runtime = mono_time = boottime; proc0.p_rtime.tv_sec = proc0.p_rtime.tv_usec = 0; diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 84b9875..35d95bf 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -39,7 +39,7 @@ static volatile int print_tci = 1; * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.58 1998/03/16 10:19:12 phk Exp $ + * $Id: kern_clock.c,v 1.59 1998/03/26 20:51:31 phk Exp $ */ #include <sys/param.h> @@ -97,6 +97,8 @@ long tk_rawcc; struct timecounter *timecounter; +time_t time_second; + /* * Clock handling routines. * @@ -136,7 +138,6 @@ int ticks; static int psdiv, pscnt; /* prof => stat divider */ int psratio; /* ratio: prof / stat */ -struct timeval time; volatile struct timeval mono_time; /* @@ -223,14 +224,10 @@ hardclock(frame) } /* - * Compute number of hz until specified time. Used to - * compute third argument to timeout() from an absolute time. - * XXX this interface is often inconvenient. We often just need the - * number of ticks in a timeval, but to use hzto() for that we have - * to add `time' to the timeval and do everything at splclock(). + * Compute number of ticks in the specified amount of time. */ int -hzto(tv) +tvtohz(tv) struct timeval *tv; { register unsigned long ticks; @@ -257,10 +254,8 @@ hzto(tv) * If ints have 32 bits, then the maximum value for any timeout in * 10ms ticks is 248 days. */ - s = splclock(); - sec = tv->tv_sec - time.tv_sec; - usec = tv->tv_usec - time.tv_usec; - splx(s); + sec = tv->tv_sec; + usec = tv->tv_usec; if (usec < 0) { sec--; usec += 1000000; @@ -271,7 +266,7 @@ hzto(tv) sec++; usec -= 1000000; } - printf("hzto: negative time difference %ld sec %ld usec\n", + printf("tvotohz: negative time difference %ld sec %ld usec\n", sec, usec); #endif ticks = 1; @@ -288,6 +283,24 @@ hzto(tv) return (ticks); } + +/* + * Compute number of hz until specified time. Used to + * compute third argument to timeout() from an absolute time. + */ +int +hzto(tv) + struct timeval *tv; +{ + register long sec, usec; + struct timeval t2; + + getmicrotime(&t2); + t2.tv_sec = tv->tv_sec - t2.tv_sec; + t2.tv_usec = tv->tv_usec - t2.tv_usec; + return (tvtohz(&t2)); +} + /* * Start profiling on a process. * @@ -637,8 +650,7 @@ set_timecounter(struct timespec *ts) tc->offset_nano = (u_int64_t)ts->tv_nsec << 32; tc->offset_micro = ts->tv_nsec / 1000; tc->offset_count = tc->get_timecount(); - time.tv_sec = tc->offset_sec; - time.tv_usec = tc->offset_micro; + time_second = tc->offset_sec; timecounter = tc; splx(s); } @@ -711,8 +723,7 @@ tco_forward(void) tc->offset_micro = (tc->offset_nano / 1000) >> 32; - time.tv_usec = tc->offset_micro; - time.tv_sec = tc->offset_sec; + time_second = tc->offset_sec; timecounter = tc; } diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index 636a5ce..e31022f 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -255,9 +255,9 @@ hardupdate(offset) * multiply/divide should be replaced someday. */ if (time_status & STA_FREQHOLD || time_reftime == 0) - time_reftime = time.tv_sec; - mtemp = time.tv_sec - time_reftime; - time_reftime = time.tv_sec; + time_reftime = time_second; + mtemp = time_second - time_reftime; + time_reftime = time_second; if (time_status & STA_FLL) { if (mtemp >= MINSEC) { ltemp = ((time_offset / mtemp) << (SHIFT_USEC - diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 84b9875..35d95bf 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -39,7 +39,7 @@ static volatile int print_tci = 1; * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.58 1998/03/16 10:19:12 phk Exp $ + * $Id: kern_clock.c,v 1.59 1998/03/26 20:51:31 phk Exp $ */ #include <sys/param.h> @@ -97,6 +97,8 @@ long tk_rawcc; struct timecounter *timecounter; +time_t time_second; + /* * Clock handling routines. * @@ -136,7 +138,6 @@ int ticks; static int psdiv, pscnt; /* prof => stat divider */ int psratio; /* ratio: prof / stat */ -struct timeval time; volatile struct timeval mono_time; /* @@ -223,14 +224,10 @@ hardclock(frame) } /* - * Compute number of hz until specified time. Used to - * compute third argument to timeout() from an absolute time. - * XXX this interface is often inconvenient. We often just need the - * number of ticks in a timeval, but to use hzto() for that we have - * to add `time' to the timeval and do everything at splclock(). + * Compute number of ticks in the specified amount of time. */ int -hzto(tv) +tvtohz(tv) struct timeval *tv; { register unsigned long ticks; @@ -257,10 +254,8 @@ hzto(tv) * If ints have 32 bits, then the maximum value for any timeout in * 10ms ticks is 248 days. */ - s = splclock(); - sec = tv->tv_sec - time.tv_sec; - usec = tv->tv_usec - time.tv_usec; - splx(s); + sec = tv->tv_sec; + usec = tv->tv_usec; if (usec < 0) { sec--; usec += 1000000; @@ -271,7 +266,7 @@ hzto(tv) sec++; usec -= 1000000; } - printf("hzto: negative time difference %ld sec %ld usec\n", + printf("tvotohz: negative time difference %ld sec %ld usec\n", sec, usec); #endif ticks = 1; @@ -288,6 +283,24 @@ hzto(tv) return (ticks); } + +/* + * Compute number of hz until specified time. Used to + * compute third argument to timeout() from an absolute time. + */ +int +hzto(tv) + struct timeval *tv; +{ + register long sec, usec; + struct timeval t2; + + getmicrotime(&t2); + t2.tv_sec = tv->tv_sec - t2.tv_sec; + t2.tv_usec = tv->tv_usec - t2.tv_usec; + return (tvtohz(&t2)); +} + /* * Start profiling on a process. * @@ -637,8 +650,7 @@ set_timecounter(struct timespec *ts) tc->offset_nano = (u_int64_t)ts->tv_nsec << 32; tc->offset_micro = ts->tv_nsec / 1000; tc->offset_count = tc->get_timecount(); - time.tv_sec = tc->offset_sec; - time.tv_usec = tc->offset_micro; + time_second = tc->offset_sec; timecounter = tc; splx(s); } @@ -711,8 +723,7 @@ tco_forward(void) tc->offset_micro = (tc->offset_nano / 1000) >> 32; - time.tv_usec = tc->offset_micro; - time.tv_sec = tc->offset_sec; + time_second = tc->offset_sec; timecounter = tc; } diff --git a/sys/kern/kern_threads.c b/sys/kern/kern_threads.c index 27d7cec..03cc9c9 100644 --- a/sys/kern/kern_threads.c +++ b/sys/kern/kern_threads.c @@ -46,7 +46,7 @@ * in Germany will I accept domestic beer. This code may or may not work * and I certainly make no claims as to its fitness for *any* purpose. * - * $Id: kern_threads.c,v 1.5 1997/11/07 08:52:57 phk Exp $ + * $Id: kern_threads.c,v 1.6 1998/02/25 06:30:15 bde Exp $ */ #include <sys/param.h> @@ -91,10 +91,7 @@ thr_sleep(struct proc *p, struct thr_sleep_args *uap) { p->p_wakeup = 0; return (EINVAL); } - s = splclock(); - timevaladd(&atv, &time); - timo = hzto(&atv); - splx(s); + timo = tvtohz(&atv); } p->p_retval[0] = 0; diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index a1fb4e3..f0897d7 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_time.c 8.1 (Berkeley) 6/10/93 - * $Id: kern_time.c,v 1.42 1998/02/25 04:10:32 bde Exp $ + * $Id: kern_time.c,v 1.43 1998/03/26 20:51:41 phk Exp $ */ #include <sys/param.h> @@ -229,10 +229,7 @@ nanosleep1(p, rqt, rmt) atv.tv_usec = 0; } } - s = splclock(); - timevaladd(&atv, &time); - timo = hzto(&atv); - splx(s); + timo = tvtohz(&atv); p->p_sleepend = &atv; error = tsleep(&nanowait, PWAIT | PCATCH, "nanslp", timo); @@ -257,9 +254,7 @@ nanosleep1(p, rqt, rmt) * problem for small timeouts, but the absolute error may * be large for large timeouts. */ - s = splclock(); - utv = time; - splx(s); + getmicrotime(&utv); if (i != n) { atv.tv_sec += (n - i - 1) * 100000000; timevaladd(&atv, &rtv); @@ -504,12 +499,13 @@ getitimer(p, uap) struct proc *p; register struct getitimer_args *uap; { + struct timeval ctv; struct itimerval aitv; int s; if (uap->which > ITIMER_PROF) return (EINVAL); - s = splclock(); + s = splclock(); /* XXX still needed ? */ if (uap->which == ITIMER_REAL) { /* * Convert from absoulte to relative time in .it_value @@ -518,11 +514,13 @@ getitimer(p, uap) * current time and time for the timer to go off. */ aitv = p->p_realtimer; - if (timerisset(&aitv.it_value)) - if (timercmp(&aitv.it_value, &time, <)) + if (timerisset(&aitv.it_value)) { + getmicrotime(&ctv); + if (timercmp(&aitv.it_value, &ctv, <)) timerclear(&aitv.it_value); else - timevalsub(&aitv.it_value, &time); + timevalsub(&aitv.it_value, &ctv); + } } else aitv = p->p_stats->p_timer[uap->which]; splx(s); @@ -543,6 +541,7 @@ setitimer(p, uap) register struct setitimer_args *uap; { struct itimerval aitv; + struct timeval ctv; register struct itimerval *itvp; int s, error; @@ -563,12 +562,13 @@ setitimer(p, uap) timerclear(&aitv.it_interval); else if (itimerfix(&aitv.it_interval)) return (EINVAL); - s = splclock(); + s = splclock(); /* XXX: still needed ? */ if (uap->which == ITIMER_REAL) { if (timerisset(&p->p_realtimer.it_value)) untimeout(realitexpire, (caddr_t)p, p->p_ithandle); if (timerisset(&aitv.it_value)) { - timevaladd(&aitv.it_value, &time); + getmicrotime(&ctv); + timevaladd(&aitv.it_value, &ctv); p->p_ithandle = timeout(realitexpire, (caddr_t)p, hzto(&aitv.it_value)); } @@ -596,6 +596,7 @@ realitexpire(arg) void *arg; { register struct proc *p; + struct timeval ctv; int s; p = (struct proc *)arg; @@ -605,10 +606,11 @@ realitexpire(arg) return; } for (;;) { - s = splclock(); + s = splclock(); /* XXX: still neeeded ? */ timevaladd(&p->p_realtimer.it_value, &p->p_realtimer.it_interval); - if (timercmp(&p->p_realtimer.it_value, &time, >)) { + getmicrotime(&ctv); + if (timercmp(&p->p_realtimer.it_value, &ctv, >)) { p->p_ithandle = timeout(realitexpire, (caddr_t)p, hzto(&p->p_realtimer.it_value) - 1); diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index f4475bb..e840062 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.123 1998/03/23 19:52:37 jlemon Exp $ + * $Id: trap.c,v 1.124 1998/03/28 10:32:57 bde Exp $ */ /* @@ -519,11 +519,11 @@ kernel_trap: { static unsigned lastalert = 0; - if(time.tv_sec - lastalert > 10) + if(time_second - lastalert > 10) { log(LOG_WARNING, "NMI: power fail\n"); sysbeep(TIMER_FREQ/880, hz); - lastalert = time.tv_sec; + lastalert = time_second; } return; } diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 54dc0a8..c0cb690 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)sys_generic.c 8.5 (Berkeley) 1/21/94 - * $Id: sys_generic.c,v 1.32 1997/11/06 19:29:20 phk Exp $ + * $Id: sys_generic.c,v 1.33 1997/11/23 10:30:50 bde Exp $ */ #include "opt_ktrace.h" @@ -539,7 +539,7 @@ select(p, uap) fd_mask s_selbits[howmany(2048, NFDBITS)]; fd_mask *ibits[3], *obits[3], *selbits, *sbp; struct timeval atv; - int s, ncoll, error, timo; + int s, ncoll, error, timo, term; u_int nbufbytes, ncpbytes, nfdbits; if (uap->nd < 0) @@ -600,12 +600,11 @@ select(p, uap) error = EINVAL; goto done; } - s = splclock(); - timevaladd(&atv, &time); - timo = hzto(&atv); - splx(s); + timo = tvtohz(&atv); } else timo = 0; + if (timo) + term = timo + ticks; retry: ncoll = nselcoll; p->p_flag |= P_SELECT; @@ -613,9 +612,7 @@ retry: if (error || p->p_retval[0]) goto done; s = splhigh(); - /* this should be timercmp(&time, &atv, >=) */ - if (uap->tv && (time.tv_sec > atv.tv_sec || - (time.tv_sec == atv.tv_sec && time.tv_usec >= atv.tv_usec))) { + if (timo && term <= ticks) { splx(s); goto done; } @@ -706,7 +703,7 @@ poll(p, uap) caddr_t bits; char smallbits[32 * sizeof(struct pollfd)]; struct timeval atv; - int s, ncoll, error = 0, timo; + int s, ncoll, error = 0, timo, term; size_t ni; if (SCARG(uap, nfds) > p->p_fd->fd_nfiles) { @@ -728,20 +725,19 @@ poll(p, uap) error = EINVAL; goto done; } - s = splclock(); - timevaladd(&atv, &time); - timo = hzto(&atv); - splx(s); + timo = tvtohz(&atv); } else timo = 0; + if (timo) + term = timo + ticks; retry: ncoll = nselcoll; p->p_flag |= P_SELECT; error = pollscan(p, (struct pollfd *)bits, SCARG(uap, nfds)); if (error || p->p_retval[0]) goto done; - s = splhigh(); - if (timo && timercmp(&time, &atv, >=)) { + s = splhigh(); + if (timo && term <= ticks) { splx(s); goto done; } diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index d439759..d3b8a98 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -1,4 +1,4 @@ -/* $Id: sysv_msg.c,v 1.16 1997/08/02 14:31:37 bde Exp $ */ +/* $Id: sysv_msg.c,v 1.17 1997/11/06 19:29:24 phk Exp $ */ /* * Implementation of SVID messages @@ -272,7 +272,7 @@ msgctl(p, uap) msqptr->msg_perm.mode = (msqptr->msg_perm.mode & ~0777) | (msqbuf.msg_perm.mode & 0777); msqptr->msg_qbytes = msqbuf.msg_qbytes; - msqptr->msg_ctime = time.tv_sec; + msqptr->msg_ctime = time_second; break; case IPC_STAT: @@ -390,7 +390,7 @@ msgget(p, uap) msqptr->msg_lrpid = 0; msqptr->msg_stime = 0; msqptr->msg_rtime = 0; - msqptr->msg_ctime = time.tv_sec; + msqptr->msg_ctime = time_second; } else { #ifdef MSG_DEBUG_OK printf("didn't find it and wasn't asked to create it\n"); @@ -732,7 +732,7 @@ msgsnd(p, uap) msqptr->msg_cbytes += msghdr->msg_ts; msqptr->msg_qnum++; msqptr->msg_lspid = p->p_pid; - msqptr->msg_stime = time.tv_sec; + msqptr->msg_stime = time_second; wakeup((caddr_t)msqptr); p->p_retval[0] = 0; @@ -954,7 +954,7 @@ msgrcv(p, uap) msqptr->msg_cbytes -= msghdr->msg_ts; msqptr->msg_qnum--; msqptr->msg_lrpid = p->p_pid; - msqptr->msg_rtime = time.tv_sec; + msqptr->msg_rtime = time_second; /* * Make msgsz the actual amount that we'll be returning. diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index 4894f8c..d35bbca 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -1,4 +1,4 @@ -/* $Id: sysv_sem.c,v 1.19 1997/08/02 14:31:38 bde Exp $ */ +/* $Id: sysv_sem.c,v 1.20 1997/11/06 19:29:24 phk Exp $ */ /* * Implementation of SVID semaphores @@ -388,7 +388,7 @@ __semctl(p, uap) semaptr->sem_perm.gid = sbuf.sem_perm.gid; semaptr->sem_perm.mode = (semaptr->sem_perm.mode & ~0777) | (sbuf.sem_perm.mode & 0777); - semaptr->sem_ctime = time.tv_sec; + semaptr->sem_ctime = time_second; break; case IPC_STAT: @@ -575,7 +575,7 @@ semget(p, uap) (sema[semid].sem_perm.seq + 1) & 0x7fff; sema[semid].sem_nsems = nsems; sema[semid].sem_otime = 0; - sema[semid].sem_ctime = time.tv_sec; + sema[semid].sem_ctime = time_second; sema[semid].sem_base = &sem[semtot]; semtot += nsems; bzero(sema[semid].sem_base, diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 4d05cad..a52b3d7 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1,4 +1,4 @@ -/* $Id: sysv_shm.c,v 1.33 1997/12/16 17:40:23 eivind Exp $ */ +/* $Id: sysv_shm.c,v 1.34 1998/02/09 06:09:25 eivind Exp $ */ /* $NetBSD: sysv_shm.c,v 1.23 1994/07/04 23:25:12 glass Exp $ */ /* @@ -170,7 +170,7 @@ shm_delete_mapping(p, shmmap_s) if (result != KERN_SUCCESS) return EINVAL; shmmap_s->shmid = -1; - shmseg->shm_dtime = time.tv_sec; + shmseg->shm_dtime = time_second; if ((--shmseg->shm_nattch <= 0) && (shmseg->shm_perm.mode & SHMSEG_REMOVED)) { shm_deallocate_segment(shmseg); @@ -281,7 +281,7 @@ shmat(p, uap) shmmap_s->va = attach_va; shmmap_s->shmid = uap->shmid; shmseg->shm_lpid = p->p_pid; - shmseg->shm_atime = time.tv_sec; + shmseg->shm_atime = time_second; shmseg->shm_nattch++; p->p_retval[0] = attach_va; return 0; @@ -389,7 +389,7 @@ shmctl(p, uap) shmseg->shm_perm.mode = (shmseg->shm_perm.mode & ~ACCESSPERMS) | (inbuf.shm_perm.mode & ACCESSPERMS); - shmseg->shm_ctime = time.tv_sec; + shmseg->shm_ctime = time_second; break; case IPC_RMID: error = ipcperm(cred, &shmseg->shm_perm, IPC_M); @@ -512,7 +512,7 @@ shmget_allocate_segment(p, uap, mode) shmseg->shm_cpid = p->p_pid; shmseg->shm_lpid = shmseg->shm_nattch = 0; shmseg->shm_atime = shmseg->shm_dtime = 0; - shmseg->shm_ctime = time.tv_sec; + shmseg->shm_ctime = time_second; shm_committed += btoc(size); shm_nused++; if (shmseg->shm_perm.mode & SHMSEG_WANTED) { diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 64dcf31..fd57c22 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -38,7 +38,7 @@ static volatile int ttyverbose = 0; * SUCH DAMAGE. * * @(#)tty.c 8.8 (Berkeley) 1/21/94 - * $Id: tty.c,v 1.100 1997/12/16 17:40:24 eivind Exp $ + * $Id: tty.c,v 1.101 1998/03/07 15:36:21 bde Exp $ */ /*- @@ -1499,7 +1499,7 @@ loop: goto sleep; if (qp->c_cc >= m) goto read; - gettime(&timecopy); + getmicrotime(&timecopy); if (!has_stime) { /* first character, start timer */ has_stime = 1; @@ -1519,7 +1519,7 @@ loop: } else { /* m == 0 */ if (qp->c_cc > 0) goto read; - gettime(&timecopy); + getmicrotime(&timecopy); if (!has_stime) { has_stime = 1; stime = timecopy; diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 247eef0..043505e 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -13,7 +13,7 @@ * bad that happens because of using this software isn't the responsibility * of the author. This software is distributed AS-IS. * - * $Id: vfs_aio.c,v 1.25 1998/03/28 10:33:09 bde Exp $ + * $Id: vfs_aio.c,v 1.26 1998/03/28 11:50:04 dufault Exp $ */ /* @@ -1484,10 +1484,7 @@ aio_suspend(struct proc *p, struct aio_suspend_args *uap) TIMESPEC_TO_TIMEVAL(&atv, &ts) if (itimerfix(&atv)) return (EINVAL); - s = splclock(); - timevaladd(&atv, &time); - timo = hzto(&atv); - splx(s); + timo = tvtohz(&atv); } ki = p->p_aioinfo; diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index b507683..2ba465e 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95 - * $Id: vfs_subr.c,v 1.146 1998/03/28 12:04:32 bde Exp $ + * $Id: vfs_subr.c,v 1.147 1998/03/28 13:24:54 bde Exp $ */ /* @@ -920,7 +920,7 @@ sched_sync(void) struct proc *p = updateproc; for (;;) { - starttime = time.tv_sec; + starttime = time_second; /* * Push files whose dirty time has expired. @@ -976,7 +976,7 @@ sched_sync(void) * matter as we are just trying to generally pace the * filesystem activity. */ - if (time.tv_sec == starttime) + if (time_second == starttime) tsleep(&lbolt, PPAUSE, "syncer", 0); } } diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index b507683..2ba465e 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95 - * $Id: vfs_subr.c,v 1.146 1998/03/28 12:04:32 bde Exp $ + * $Id: vfs_subr.c,v 1.147 1998/03/28 13:24:54 bde Exp $ */ /* @@ -920,7 +920,7 @@ sched_sync(void) struct proc *p = updateproc; for (;;) { - starttime = time.tv_sec; + starttime = time_second; /* * Push files whose dirty time has expired. @@ -976,7 +976,7 @@ sched_sync(void) * matter as we are just trying to generally pace the * filesystem activity. */ - if (time.tv_sec == starttime) + if (time_second == starttime) tsleep(&lbolt, PPAUSE, "syncer", 0); } } |