From cc5860356e27da189a21c545cacb4027c5bb1dfe Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 16 Feb 1993 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1993-02-16 --- pc/ether2000.c | 4 +++- pc/trap.c | 2 +- port/devcons.c | 9 +++++++-- port/proc.c | 2 +- ss/segment.h | 11 +---------- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/pc/ether2000.c b/pc/ether2000.c index a87820139ef241453f2608da49495c796a8e4dd1..fe8c176e111892fde8d2e552c862f820834f7896 100644 --- a/pc/ether2000.c +++ b/pc/ether2000.c @@ -40,7 +40,9 @@ reset(Ctlr *ctlr) * Reset the board. This is done by doing a read * followed by a write to the Reset address. */ - outb(ctlr->card.io+Reset, inb(ctlr->card.io+Reset)); + buf[0] = inb(ctlr->card.io+Reset); + delay(2); + outb(ctlr->card.io+Reset, buf[0]); /* * Init the (possible) chip, then use the (possible) diff --git a/pc/trap.c b/pc/trap.c index ea1824f46fe2a14d48f0e0dbf82e633a4988a0b1..984d1e265c3c55d01c0d270976b3a0a711bd60b2 100644 --- a/pc/trap.c +++ b/pc/trap.c @@ -215,9 +215,9 @@ trap(Ureg *ur) */ c = v&~0x7; if(c==Int0vec || c==Int1vec){ + outb(Int0ctl, EOI); if(c == Int1vec) outb(Int1ctl, EOI); - outb(Int0ctl, EOI); if(v != Uart0vec) uartintr0(ur); } diff --git a/port/devcons.c b/port/devcons.c index 195e4dd6556f410a96338572104c13fe154b2465..b2514b1b2c58184df2de9d433ad413c6a0ce1dfd 100644 --- a/port/devcons.c +++ b/port/devcons.c @@ -184,8 +184,13 @@ pprint(char *fmt, ...) return 0; c = u->p->fgrp->fd[2]; - if(c==0 || (c->mode!=OWRITE && c->mode!=ORDWR)) + if(c == 0 || (c->mode!=OWRITE && c->mode!=ORDWR)) return 0; + + /* Can't afford to take an error in notify */ + if(waserror()) + return 0; + n = sprint(buf, "%s %d: ", u->p->text, u->p->pid); n = doprint(buf+n, buf+sizeof(buf), fmt, (&fmt+1)) - buf; @@ -194,7 +199,7 @@ pprint(char *fmt, ...) lock(c); c->offset += n; unlock(c); - + poperror(); return n; } diff --git a/port/proc.c b/port/proc.c index 286b4ea766b1db60a4615eae9604d38b0a5b6b0a..6cbbcadd465fc3963c88f6bb6508e49a8fde6fe4 100644 --- a/port/proc.c +++ b/port/proc.c @@ -454,11 +454,11 @@ postnote(Proc *p, int dolock, char *n, int flag) for(d = *l; d; d = d->rendhash) { if(d == p) { *l = p->rendhash; + ready(p); break; } l = &d->rendhash; } - ready(p); } unlock(p->pgrp); return ret; diff --git a/ss/segment.h b/ss/segment.h index 8855766b263dadef9594e41f3adb21bd6cee5dbc..7526c3e4ac9dc037f81d2dce7573ae1682db084e 100644 --- a/ss/segment.h +++ b/ss/segment.h @@ -2,16 +2,7 @@ * Attach segment types */ -typedef struct Physseg Physseg; -struct Physseg -{ - ulong attr; /* Segment attributes */ - char *name; /* Attach name */ - ulong pa; /* Physical address */ - ulong size; /* Maximum segment size in pages */ - Page *(*pgalloc)(Segment*, ulong); /* Allocation if we need it */ - void (*pgfree)(Page*); -}physseg[] = { +Physseg physseg[] = { { SG_SHARED, "shared", 0, SEGMAXSIZE, 0, 0 }, { SG_PHYSICAL, "kmem", KZERO, SEGMAXSIZE, 0, 0 }, { SG_BSS, "memory", 0, SEGMAXSIZE, 0, 0 },