projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
alloc tables at boot time version
[unix-history]
/
usr
/
src
/
sys
/
kern
/
kern_clock.c
diff --git
a/usr/src/sys/kern/kern_clock.c
b/usr/src/sys/kern/kern_clock.c
index
c54911d
..
f021224
100644
(file)
--- a/
usr/src/sys/kern/kern_clock.c
+++ b/
usr/src/sys/kern/kern_clock.c
@@
-1,9
+1,9
@@
-/* kern_clock.c 4.
9
%G% */
+/* kern_clock.c 4.
14
%G% */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/dk.h"
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/dk.h"
-#include "../h/callo.h"
+#include "../h/callo
ut
.h"
#include "../h/seg.h"
#include "../h/dir.h"
#include "../h/user.h"
#include "../h/seg.h"
#include "../h/dir.h"
#include "../h/user.h"
@@
-16,6
+16,7
@@
#include "../h/vlimit.h"
#include "../h/mtpr.h"
#include "../h/clock.h"
#include "../h/vlimit.h"
#include "../h/mtpr.h"
#include "../h/clock.h"
+#include "../h/cpu.h"
#include "dh.h"
#include "dz.h"
#include "dh.h"
#include "dz.h"
@@
-51,7
+52,7
@@
hardclock(pc, ps)
caddr_t pc;
{
hardclock(pc, ps)
caddr_t pc;
{
- register struct callo *p1;
+ register struct callo
ut
*p1;
register struct proc *pp;
register int s, cpstate;
register struct proc *pp;
register int s, cpstate;
@@
-85,7
+86,7
@@
out:
}
if (s > u.u_vm.vm_maxrss)
u.u_vm.vm_maxrss = s;
}
if (s > u.u_vm.vm_maxrss)
u.u_vm.vm_maxrss = s;
- if ((u.u_vm.vm_utime+u.u_vm.vm_stime+1)/
HZ
> u.u_limit[LIM_CPU]) {
+ if ((u.u_vm.vm_utime+u.u_vm.vm_stime+1)/
hz
> u.u_limit[LIM_CPU]) {
psignal(u.u_procp, SIGXCPU);
if (u.u_limit[LIM_CPU] < INFINITY - 5)
u.u_limit[LIM_CPU] += 5;
psignal(u.u_procp, SIGXCPU);
if (u.u_limit[LIM_CPU] < INFINITY - 5)
u.u_limit[LIM_CPU] += 5;
@@
-120,8
+121,8
@@
out:
}
}
++lbolt;
}
}
++lbolt;
-#if VAX
==
780
- if (!BASEPRI(ps))
+#if VAX780
+ if (
cpu == VAX_780 &&
!BASEPRI(ps))
unhang();
#endif
setsoftclock();
unhang();
#endif
setsoftclock();
@@
-141,7
+142,7
@@
double ccpu = 0.95122942450071400909; /* exp(-1/20) */
softclock(pc, ps)
caddr_t pc;
{
softclock(pc, ps)
caddr_t pc;
{
- register struct callo *p1, *p2;
+ register struct callo
ut
*p1, *p2;
register struct proc *pp;
register int a, s;
register struct proc *pp;
register int a, s;
@@
-166,10
+167,10
@@
softclock(pc, ps)
/*
* Drain silos.
*/
/*
* Drain silos.
*/
-#if NDH
11
> 0
+#if NDH > 0
s = spl5(); dhtimer(); splx(s);
#endif
s = spl5(); dhtimer(); splx(s);
#endif
-#if NDZ
11
> 0
+#if NDZ > 0
s = spl5(); dztimer(); splx(s);
#endif
s = spl5(); dztimer(); splx(s);
#endif
@@
-185,7
+186,7
@@
softclock(pc, ps)
/*
* Run paging daemon and reschedule every 1/4 sec.
*/
/*
* Run paging daemon and reschedule every 1/4 sec.
*/
- if (lbolt % (
HZ
/4) == 0) {
+ if (lbolt % (
hz
/4) == 0) {
vmpago();
runrun++;
aston();
vmpago();
runrun++;
aston();
@@
-199,13
+200,13
@@
softclock(pc, ps)
* virtual memory metering
* kick swapper if processes want in
*/
* virtual memory metering
* kick swapper if processes want in
*/
- if (lbolt >=
HZ
) {
+ if (lbolt >=
hz
) {
if (BASEPRI(ps))
return;
if (BASEPRI(ps))
return;
- lbolt -=
HZ
;
+ lbolt -=
hz
;
++time;
wakeup((caddr_t)&lbolt);
++time;
wakeup((caddr_t)&lbolt);
- for(pp =
&proc[0]; pp < &proc[NPROC]
; pp++)
+ for(pp =
proc; pp < procNPROC
; pp++)
if (pp->p_stat && pp->p_stat!=SZOMB) {
if(pp->p_time != 127)
pp->p_time++;
if (pp->p_stat && pp->p_stat!=SZOMB) {
if(pp->p_time != 127)
pp->p_time++;
@@
-232,7
+233,7
@@
softclock(pc, ps)
pp->p_slptime++;
if (pp->p_flag&SLOAD)
pp->p_pctcpu = ccpu * pp->p_pctcpu +
pp->p_slptime++;
if (pp->p_flag&SLOAD)
pp->p_pctcpu = ccpu * pp->p_pctcpu +
- (1.0 - ccpu) * (pp->p_cpticks/(float)
HZ
);
+ (1.0 - ccpu) * (pp->p_cpticks/(float)
hz
);
pp->p_cpticks = 0;
a = (pp->p_cpu & 0377)*SCHMAG + pp->p_nice - NZERO;
if(a < 0)
pp->p_cpticks = 0;
a = (pp->p_cpu & 0377)*SCHMAG + pp->p_nice - NZERO;
if(a < 0)
@@
-272,7
+273,7
@@
softclock(pc, ps)
if (USERMODE(ps)) {
pp = u.u_procp;
if (pp->p_uid)
if (USERMODE(ps)) {
pp = u.u_procp;
if (pp->p_uid)
- if (pp->p_nice == NZERO && u.u_vm.vm_utime > 600 *
HZ
)
+ if (pp->p_nice == NZERO && u.u_vm.vm_utime > 600 *
hz
)
pp->p_nice = NZERO+4;
(void) setpri(pp);
pp->p_pri = pp->p_usrpri;
pp->p_nice = NZERO+4;
(void) setpri(pp);
pp->p_pri = pp->p_usrpri;
@@
-286,10
+287,10
@@
softclock(pc, ps)
/*
* timeout is called to arrange that
/*
* timeout is called to arrange that
- * fun(arg) is called in tim/
HZ
seconds.
+ * fun(arg) is called in tim/
hz
seconds.
* An entry is sorted into the callout
* structure. The time in each structure
* An entry is sorted into the callout
* structure. The time in each structure
- * entry is the number of
HZ
's more
+ * entry is the number of
hz
's more
* than the previous entry.
* In this way, decrementing the
* first entry has the effect of
* than the previous entry.
* In this way, decrementing the
* first entry has the effect of
@@
-302,7
+303,7
@@
timeout(fun, arg, tim)
int (*fun)();
caddr_t arg;
{
int (*fun)();
caddr_t arg;
{
- register struct callo *p1, *p2, *p3;
+ register struct callo
ut
*p1, *p2, *p3;
register int t;
int s;
register int t;
int s;
@@
-315,7
+316,7
@@
timeout(fun, arg, tim)
}
p1->c_time -= t;
p2 = p1;
}
p1->c_time -= t;
p2 = p1;
- p3 =
&callout[NCALL-2]
;
+ p3 =
callout+(ncallout-2)
;
while(p2->c_func != 0) {
if (p2 >= p3)
panic("timeout");
while(p2->c_func != 0) {
if (p2 >= p3)
panic("timeout");