From f606b0be00a8d31a01f0f7f6e4d83a40204f732e Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 28 Jul 1993 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1993-07-28 --- port/fault.c | 29 ----------------------------- port/portdat.h | 3 +-- port/qio.c | 7 ++++--- 3 files changed, 5 insertions(+), 34 deletions(-) diff --git a/port/fault.c b/port/fault.c index f7f3e17cc17409f230b2d4e03d93c1915a44cc49..747604620ec8f50ab47dfbe27eb74787d63ff93a 100644 --- a/port/fault.c +++ b/port/fault.c @@ -7,35 +7,6 @@ void faulterror(char*); -ulong -getpte(ulong addr) -{ - Pte **p, *etp; - Segment *s; - Page **pg; - ulong soff; - - s = seg(up, addr, 1); - if(s == 0) - return -1; - - addr &= ~(BY2PG-1); - soff = addr-s->base; - p = &s->map[soff/PTEMAPMEM]; - if(*p == 0) { - qunlock(&s->lk); - return -1; - } - etp = *p; - pg = &etp->pages[(soff&(PTEMAPMEM-1))/BY2PG]; - if(*pg == 0) { - qunlock(&s->lk); - return -1; - } - qunlock(&s->lk); - return (*pg)->pa; -} - int fault(ulong addr, int read) { diff --git a/port/portdat.h b/port/portdat.h index b60e486a8cf35c3ed8d9e6d41e55a27edc4e082d..ebd998d7f63ef666f089e78720182fd42f58ea73 100644 --- a/port/portdat.h +++ b/port/portdat.h @@ -599,8 +599,7 @@ struct Proc void *dbgreg; /* User registers for devproc */ ulong svstatus; ulong svr1; -int entpc; -int entr31; + /* * machine specific MMU */ diff --git a/port/qio.c b/port/qio.c index 1dc7481033a81366d158d24c9a00789e9d0a051a..a3a9706e8aa603c0708a1efa70a2892233499629 100644 --- a/port/qio.c +++ b/port/qio.c @@ -404,15 +404,16 @@ qread(Queue *q, void *vp, int len) x = splhi(); lock(q); + b = q->bfirst; + if(b) + break; + if(q->state & Qclosed){ unlock(q); splx(x); return 0; } - b = q->bfirst; - if(b) - break; q->state |= Qstarve; unlock(q); splx(x);