X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/15f789eaa09d58cbf06b92b82357da8397681e9e..233328fcccc6ee5a686c52f66897a525302bab23:/usr/src/sys/kern/kern_synch.c diff --git a/usr/src/sys/kern/kern_synch.c b/usr/src/sys/kern/kern_synch.c index 746f983720..b7c6516890 100644 --- a/usr/src/sys/kern/kern_synch.c +++ b/usr/src/sys/kern/kern_synch.c @@ -1,4 +1,4 @@ -/* kern_synch.c 4.1 %G% */ +/* kern_synch.c 4.8 %G% */ #include "../h/param.h" #include "../h/systm.h" @@ -10,7 +10,7 @@ #include "../h/vm.h" #include "../h/pte.h" #include "../h/inline.h" - +#include "../h/mtpr.h" #define SQSIZE 0100 /* Must be power of 2 */ #define HASH(x) (( (int) x >> 5) & (SQSIZE-1)) @@ -55,10 +55,6 @@ caddr_t chan; goto out; rp->p_stat = SSLEEP; (void) spl0(); - if(runin != 0) { - runin = 0; - wakeup((caddr_t)&runin); - } swtch(); if(ISSIG(rp)) goto psig; @@ -171,16 +167,12 @@ restart: if (p->p_stat == SSLEEP) { /* OPTIMIZED INLINE EXPANSION OF setrun(p) */ p->p_stat = SRUN; - if (p->p_flag & SLOAD) { -#ifndef FASTVAX - p->p_link = runq; - runq = p->p_link; -#else + if (p->p_flag & SLOAD) setrq(p); -#endif - } - if(p->p_pri < curpri) + if(p->p_pri < curpri) { runrun++; + aston(); + } if(runout != 0 && (p->p_flag&SLOAD) == 0) { runout = 0; wakeup((caddr_t)&runout); @@ -194,7 +186,6 @@ restart: splx(s); } -#ifdef FASTVAX /* * Initialize the (doubly-linked) run queues * to be empty. @@ -206,7 +197,6 @@ rqinit() for (i = 0; i < NQS; i++) qs[i].ph_link = qs[i].ph_rlink = (struct proc *)&qs[i]; } -#endif /* * Set the process running; @@ -239,8 +229,10 @@ register struct proc *p; if (p->p_flag & SLOAD) setrq(p); splx(s); - if(p->p_pri < curpri) + if(p->p_pri < curpri) { runrun++; + aston(); + } if(runout != 0 && (p->p_flag&SLOAD) == 0) { runout = 0; wakeup((caddr_t)&runout); @@ -262,8 +254,10 @@ register struct proc *pp; p += PUSER + 2*(pp->p_nice - NZERO); if(p > 127) p = 127; - if(p < curpri) + if(p < curpri) { runrun++; + aston(); + } pp->p_usrpri = p; return(p); } @@ -292,7 +286,7 @@ retry: mpid = 0; goto retry; } - for(rpp = &proc[0]; rpp < &proc[NPROC]; rpp++) { + for(rpp = proc; rpp < procNPROC; rpp++) { if(rpp->p_stat == NULL && p==NULL) p = rpp; if (rpp->p_pid==mpid || rpp->p_pgrp==mpid) @@ -357,9 +351,17 @@ retry: for(n=0; nf_count++; - if(!isvfork && u.u_vrpages[n]) - u.u_ofile[n]->f_inode->i_vfdcnt++; +#ifdef UCBIPC + if (u.u_pofile[n] & ISPORT) + u.u_oport[n]->pt_count++; + else { +#endif + u.u_ofile[n]->f_count++; + if(!isvfork && u.u_vrpages[n]) + u.u_ofile[n]->f_inode->i_vfdcnt++; +#ifdef UCBIPC + } +#endif UCBIPC } u.u_cdir->i_count++; @@ -376,10 +378,10 @@ retry: if (procdup(rpp, isvfork)) return (1); - spl6(); + (void) spl6(); rpp->p_stat = SRUN; setrq(rpp); - spl0(); + (void) spl0(); /* SSWAP NOT NEEDED IN THIS CASE AS u.u_pcb.pcb_sswap SUFFICES */ /* rpp->p_flag |= SSWAP; */ rip->p_flag &= ~SKEEP;