From 70aa53e2d7b2a3ae286e5d9e54404026e54bd49a Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 15 Dec 1993 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1993-12-15 --- carrera/fns.h | 2 +- pc/fns.h | 2 +- port/portdat.h | 1 + port/proc.c | 5 +++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/carrera/fns.h b/carrera/fns.h index 177de41b6cdc1803e96592efa6f0f718cb5967b6..87141b30fe329fc91b186d2a9ae2867f2ec156ab 100644 --- a/carrera/fns.h +++ b/carrera/fns.h @@ -3,7 +3,7 @@ void DEBUG(void); void addportintr(int(*)(void)); -#define affinity(x) (MACHP(0)) +#define affinity(x) m void allflush(void*, ulong); void arginit(void); int busprobe(ulong); diff --git a/pc/fns.h b/pc/fns.h index 919e9e77400fa4e87c425d3f95967271ecb1ac1c..242f62e1a148b4d7ed840bec647e18bc854a2113 100644 --- a/pc/fns.h +++ b/pc/fns.h @@ -1,7 +1,7 @@ #include "../port/portfns.h" void addconf(char*, char*); -#define affinity(x) (MACHP(0)) +#define affinity(x) m void bbinit(void); void bigcursor(void); void bootargs(ulong); diff --git a/port/portdat.h b/port/portdat.h index 0201ff042779f92bfb1c375aa107e9944a33eda5..cdbe7a9e698f4563b4db17ab4caa213a4e8792fc 100644 --- a/port/portdat.h +++ b/port/portdat.h @@ -577,6 +577,7 @@ struct Schedq Lock; Proc *head; Proc *tail; + int n; }; diff --git a/port/proc.c b/port/proc.c index f9fc533fbd3dd48a3de0097227f1681e2c51da24..4fea4daf981528e63764187080c464f430514c6d 100644 --- a/port/proc.c +++ b/port/proc.c @@ -21,8 +21,8 @@ struct Waitq *free; }waitqalloc; -Schedq runhiq, runloq; int nrdy; +Schedq runhiq; char *statename[] = { /* BUG: generate automatically */ @@ -126,7 +126,7 @@ ready(Proc *p) else rq->head = p; rq->tail = p; - + rq->n++; nrdy++; p->state = Ready; unlock(&runhiq); @@ -160,6 +160,7 @@ loop: if(p->rnext == 0) rq->tail = 0; rq->head = p->rnext; + rq->n--; nrdy--; if(p->state != Ready) print("runproc %s %d %s\n", p->text, p->pid, statename[p->state]);