- case SSTOP:
- unsleep(pp);
- break;
- }
- pp->p_flag &= ~STIMO;
- splx(s);
- } else
- psignal(pp, SIGALRM);
- if(pp->p_stat==SSLEEP||pp->p_stat==SSTOP)
- if (pp->p_slptime != 127)
- pp->p_slptime++;
- if (pp->p_flag&SLOAD)
- pp->p_pctcpu = ccpu * pp->p_pctcpu +
- (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)
- a = 0;
- if(a > 255)
- a = 255;
- pp->p_cpu = a;
- (void) setpri(pp);
- s = spl6();
- if(pp->p_pri >= PUSER) {
- if ((pp != u.u_procp || noproc) &&
- pp->p_stat == SRUN &&
- (pp->p_flag & SLOAD) &&
- pp->p_pri != pp->p_usrpri) {
- remrq(pp);
- pp->p_pri = pp->p_usrpri;
- setrq(pp);
- } else
- pp->p_pri = pp->p_usrpri;
- }
- splx(s);
- }
- vmmeter();
- if(runin!=0) {
- runin = 0;
- wakeup((caddr_t)&runin);
- }
- /*
- * If there are pages that have been cleaned,
- * jolt the pageout daemon to process them.
- * We do this here so that these pages will be
- * freed if there is an abundance of memory and the
- * daemon would not be awakened otherwise.
- */
- if (bclnlist != NULL)
- wakeup((caddr_t)&proc[2]);
- if (USERMODE(ps)) {
- pp = u.u_procp;
- if (pp->p_uid)
- 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;
+/*
+ * untimeout is called to remove a function timeout call
+ * from the callout structure.
+ */
+untimeout(func, arg)
+ int (*func)();
+ caddr_t arg;
+{
+ register struct callout *p1, *p2;
+ register int s;
+
+ s = splhigh();
+ for (p1 = &calltodo; (p2 = p1->c_next) != 0; p1 = p2) {
+ if (p2->c_func == func && p2->c_arg == arg) {
+ if (p2->c_next && p2->c_time > 0)
+ p2->c_next->c_time += p2->c_time;
+ p1->c_next = p2->c_next;
+ p2->c_next = callfree;
+ callfree = p2;
+ break;