From fbdabd05516dc11a806d6815a59aca4ede54a5d4 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Fri, 26 Mar 1999 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1999-03-26 --- carrera/screen.c | 3 +++ port/proc.c | 16 +++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/carrera/screen.c b/carrera/screen.c index 58f8f5292604125fa5531ba90f5635de2f62297b..a9823fb88e60a46b9ea6e73ddf664abb850aee06 100644 --- a/carrera/screen.c +++ b/carrera/screen.c @@ -586,6 +586,7 @@ cursoron(int dolock) { Dac *d; Point p; + int s; p = mousexy(); @@ -593,6 +594,7 @@ cursoron(int dolock) if(dolock) lock(&cursor); + s = splhi(); p.x += 296; /* adjusted by experiment */ p.y += 9; /* adjusted by experiment */ @@ -603,6 +605,7 @@ cursoron(int dolock) d->cr2 = p.y&0xFF; d->cr2 = (p.y>>8)&0xF; + splx(s); if(dolock) unlock(&cursor); return 0; diff --git a/port/proc.c b/port/proc.c index 0cae3894ac1cd3b1617d2f99c6b6763df2190e04..ea26f0afdbbaf68a9012ce91826cbf5547fd4635 100644 --- a/port/proc.c +++ b/port/proc.c @@ -30,7 +30,6 @@ typedef struct } Schedq; int nrdy; -int lastreadied; Schedq runq[Nrq]; char *statename[] = @@ -122,11 +121,16 @@ anyready(void) int anyhigher(void) { - int x; + Schedq *rq; + + if(nrdy == 0) + return 0; - x = lastreadied; - lastreadied = 0; - return nrdy && x >= up->priority; + for(rq = &runq[Nrq-1]; rq > &runq[up->priority]; rq--) + if(rq->head != nil) + return 1; + + return 0; } enum @@ -177,8 +181,6 @@ ready(Proc *p) nrdy++; p->readytime = m->ticks; p->state = Ready; - if(p->priority > lastreadied) - lastreadied = p->priority; unlock(runq); splx(s); }