X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/260ea6815a856bf13eb266389c458db23e952298..233328fcccc6ee5a686c52f66897a525302bab23:/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 c54911de9f..f021224b6f 100644 --- 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/callo.h" +#include "../h/callout.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/cpu.h" #include "dh.h" #include "dz.h" @@ -51,7 +52,7 @@ hardclock(pc, ps) caddr_t pc; { - register struct callo *p1; + register struct callout *p1; 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 ((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; @@ -120,8 +121,8 @@ out: } } ++lbolt; -#if VAX==780 - if (!BASEPRI(ps)) +#if VAX780 + if (cpu == VAX_780 && !BASEPRI(ps)) unhang(); #endif setsoftclock(); @@ -141,7 +142,7 @@ double ccpu = 0.95122942450071400909; /* exp(-1/20) */ softclock(pc, ps) caddr_t pc; { - register struct callo *p1, *p2; + register struct callout *p1, *p2; register struct proc *pp; register int a, s; @@ -166,10 +167,10 @@ softclock(pc, ps) /* * Drain silos. */ -#if NDH11 > 0 +#if NDH > 0 s = spl5(); dhtimer(); splx(s); #endif -#if NDZ11 > 0 +#if NDZ > 0 s = spl5(); dztimer(); splx(s); #endif @@ -185,7 +186,7 @@ softclock(pc, ps) /* * Run paging daemon and reschedule every 1/4 sec. */ - if (lbolt % (HZ/4) == 0) { + if (lbolt % (hz/4) == 0) { vmpago(); runrun++; aston(); @@ -199,13 +200,13 @@ softclock(pc, ps) * virtual memory metering * kick swapper if processes want in */ - if (lbolt >= HZ) { + if (lbolt >= hz) { if (BASEPRI(ps)) return; - lbolt -= HZ; + lbolt -= hz; ++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++; @@ -232,7 +233,7 @@ softclock(pc, ps) 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) @@ -272,7 +273,7 @@ softclock(pc, ps) 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; @@ -286,10 +287,10 @@ softclock(pc, ps) /* * 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 - * 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 @@ -302,7 +303,7 @@ timeout(fun, arg, tim) int (*fun)(); caddr_t arg; { - register struct callo *p1, *p2, *p3; + register struct callout *p1, *p2, *p3; register int t; int s; @@ -315,7 +316,7 @@ timeout(fun, arg, tim) } p1->c_time -= t; p2 = p1; - p3 = &callout[NCALL-2]; + p3 = callout+(ncallout-2); while(p2->c_func != 0) { if (p2 >= p3) panic("timeout");