mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
Removed volatile' from declaration of
time', and removed the resulting
null casts. `time' is nonvolatile for accesses within a region locked by splclock()/splx(). Accesses outside such a region are invalid, and splx() must have the side effect of potentially changing all global variables (since there are hundreds of sort of volatile variables like `time'), so declaring `time' as volatile didn't have any real benefits.
This commit is contained in:
parent
3c81694426
commit
774fce94c0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24102
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)kern_time.c 8.1 (Berkeley) 6/10/93
|
||||
* $Id$
|
||||
* $Id: kern_time.c,v 1.21 1997/02/22 09:39:13 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -267,8 +267,7 @@ getitimer(p, uap, retval)
|
||||
if (timercmp(&aitv.it_value, &time, <))
|
||||
timerclear(&aitv.it_value);
|
||||
else
|
||||
timevalsub(&aitv.it_value,
|
||||
(struct timeval *)&time);
|
||||
timevalsub(&aitv.it_value, &time);
|
||||
} else
|
||||
aitv = p->p_stats->p_timer[uap->which];
|
||||
splx(s);
|
||||
@ -310,7 +309,7 @@ setitimer(p, uap, retval)
|
||||
if (uap->which == ITIMER_REAL) {
|
||||
untimeout(realitexpire, (caddr_t)p);
|
||||
if (timerisset(&aitv.it_value)) {
|
||||
timevaladd(&aitv.it_value, (struct timeval *)&time);
|
||||
timevaladd(&aitv.it_value, &time);
|
||||
timeout(realitexpire, (caddr_t)p, hzto(&aitv.it_value));
|
||||
}
|
||||
p->p_realtimer = aitv;
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)sys_generic.c 8.5 (Berkeley) 1/21/94
|
||||
* $Id$
|
||||
* $Id: sys_generic.c,v 1.23 1997/02/22 09:39:19 peter Exp $
|
||||
*/
|
||||
|
||||
#include "opt_ktrace.h"
|
||||
@ -598,7 +598,7 @@ select(p, uap, retval)
|
||||
goto done;
|
||||
}
|
||||
s = splclock();
|
||||
timevaladd(&atv, (struct timeval *)&time);
|
||||
timevaladd(&atv, &time);
|
||||
timo = hzto(&atv);
|
||||
/*
|
||||
* Avoid inadvertently sleeping forever.
|
||||
|
@ -39,7 +39,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)kernel.h 8.3 (Berkeley) 1/21/94
|
||||
* $Id$
|
||||
* $Id: kernel.h,v 1.25 1997/02/22 09:45:25 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_KERNEL_H_
|
||||
@ -60,7 +60,7 @@ extern char kernelname[MAXPATHLEN];
|
||||
extern volatile struct timeval mono_time;
|
||||
extern struct timeval boottime;
|
||||
extern struct timeval runtime;
|
||||
extern volatile struct timeval time;
|
||||
extern struct timeval time; /* nonvolatile at ipl >= splclock() */
|
||||
extern struct timezone tz; /* XXX */
|
||||
|
||||
extern int tick; /* usec per tick (1000000 / hz) */
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)lfs_syscalls.c 8.5 (Berkeley) 4/20/94
|
||||
* $Id$
|
||||
* $Id: lfs_syscalls.c,v 1.17 1997/02/22 09:47:24 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -432,7 +432,7 @@ lfs_segwait(p, uap, retval)
|
||||
if (itimerfix(&atv))
|
||||
return (EINVAL);
|
||||
s = splclock();
|
||||
timevaladd(&atv, (struct timeval *)&time);
|
||||
timevaladd(&atv, &time);
|
||||
timeout = hzto(&atv);
|
||||
splx(s);
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user