From 79b17505546f0b3f105ccb671f9d95dd4e7bc4b5 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 13 Nov 1990 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1990-11-13 --- gnot/fault.c | 4 +--- gnot/l.s | 1 + gnot/stream.c | 6 ++++++ port/devdk.c | 18 ++++++++++++++++-- port/devpipe.c | 9 ++++++++- port/fault.c | 4 +--- port/stream.c | 10 ++++++++++ power/l.s | 2 +- power/trap.c | 1 + 9 files changed, 45 insertions(+), 10 deletions(-) diff --git a/gnot/fault.c b/gnot/fault.c index ae99c75761d7b27cee00d6e11ae0f8ab883594a3..30809fa594eb87788cb0227d60067dcfd1ab26b1 100644 --- a/gnot/fault.c +++ b/gnot/fault.c @@ -166,9 +166,7 @@ fault(Ureg *ur, FFrame *f) qunlock(o->chan); pg->o = 0; pg->ref--; - if(user) - pexit("Interrupt", 0); - goto cant; + pexit("load i/o error", 0); } o->chan->offset = (addr-o->va) + o->minca; l = (char*)VA(k); diff --git a/gnot/l.s b/gnot/l.s index bfbb5af2fa7730352d132ce2d3be6726b807ee06..420fd6f8c7b25231f590e02dc4b408d0e5fd46fb 100644 --- a/gnot/l.s +++ b/gnot/l.s @@ -156,6 +156,7 @@ TEXT rfnote(SB), $0 MOVL A0, USP MOVEM (A7), $0x7FFF ADDL $((8+8+1)*BY2WD), A7 + MOVL $-1, R0 /* note causes error in sys call */ RTE TEXT illegal(SB), $0 diff --git a/gnot/stream.c b/gnot/stream.c index 0ce324ff2eebf7155a2a261218ab6650441ff08f..b089a1a1739187f9d645a16560c87d616c524376 100644 --- a/gnot/stream.c +++ b/gnot/stream.c @@ -139,6 +139,7 @@ allocb(ulong size) } tsleep(&bcp->r, isblock, (void *)bcp, 250); qunlock(bcp); + poperror(); lock(bcp); } bp = bcp->first; @@ -1061,8 +1062,13 @@ void flowctl(Queue *q) { qlock(&q->rlock); + if(waserror()){ + qunlock(&q->rlock); + nexterror(); + } sleep(&q->r, notfull, q->next); qunlock(&q->rlock); + poperror(); } /* diff --git a/port/devdk.c b/port/devdk.c index 0727297a45bf67112e3daf70eed3ba2b66d13e5f..dc3721909326f35e658fe70833032ddc7837db05 100644 --- a/port/devdk.c +++ b/port/devdk.c @@ -202,7 +202,14 @@ static void dkmuxopen(Queue *, Stream *); static void dkmuxclose(Queue *); static void dkmuxoput(Queue *, Block *); static void dkmuxiput(Queue *, Block *); -Qinfo dkmuxinfo = { dkmuxiput, dkmuxoput, dkmuxopen, dkmuxclose, "dkmux" }; +Qinfo dkmuxinfo = +{ + dkmuxiput, + dkmuxoput, + dkmuxopen, + dkmuxclose, + "dkmux" +}; /* * Look for a dk struct with a name. If none exists, create one. @@ -357,7 +364,14 @@ static void dkstopen(Queue *, Stream *); static void dkstclose(Queue *); static void dkoput(Queue *, Block *); static void dkiput(Queue *, Block *); -Qinfo dkinfo = { dkiput, dkoput, dkstopen, dkstclose, "dk" }; +Qinfo dkinfo = +{ + dkiput, + dkoput, + dkstopen, + dkstclose, + "dk" +}; /* * open and save a pointer to the conversation diff --git a/port/devpipe.c b/port/devpipe.c index c06096092f07aece864346f1d7da1d41facc455e..5f6ced88435a35555edfa07e5ff239debafdfca8 100644 --- a/port/devpipe.c +++ b/port/devpipe.c @@ -27,7 +27,14 @@ struct Pipealloc static void pipeiput(Queue*, Block*); static void pipeoput(Queue*, Block*); static void pipestclose(Queue *); -Qinfo pipeinfo = { pipeiput, pipeoput, 0, pipestclose, "pipe" }; +Qinfo pipeinfo = +{ + pipeiput, + pipeoput, + 0, + pipestclose, + "pipe" +}; Dirtab pipedir[]={ "data", Sdataqid, 0, 0600, diff --git a/port/fault.c b/port/fault.c index 644cea5857402348ba5951eaccdc1c9e8429d1a3..80e5d4defd07330945deb3cd9aa4efc8d9102e03 100644 --- a/port/fault.c +++ b/port/fault.c @@ -98,9 +98,7 @@ fault(Ureg *ur, int user, int code) qunlock(o->chan); pg->o = 0; pg->ref--; - if(user) - pexit("Interrupt", 0); - goto cant; + pexit("load i/o error", 0); } o->chan->offset = (addr-o->va) + o->minca; l = (char*)(pg->pa|KZERO); diff --git a/port/stream.c b/port/stream.c index 4a7bccc8fb8a4a16a6526a0d47bd52e1bd317d41..b089a1a1739187f9d645a16560c87d616c524376 100644 --- a/port/stream.c +++ b/port/stream.c @@ -133,8 +133,13 @@ allocb(ulong size) while(bcp->first == 0){ unlock(bcp); qlock(bcp); + if(waserror()){ + qunlock(bcp); + nexterror(); + } tsleep(&bcp->r, isblock, (void *)bcp, 250); qunlock(bcp); + poperror(); lock(bcp); } bp = bcp->first; @@ -1057,8 +1062,13 @@ void flowctl(Queue *q) { qlock(&q->rlock); + if(waserror()){ + qunlock(&q->rlock); + nexterror(); + } sleep(&q->r, notfull, q->next); qunlock(&q->rlock); + poperror(); } /* diff --git a/power/l.s b/power/l.s index b04f6835a0aa8f4ce9375015d53522fd7385dd8c..c09691de7228fead5b6b538b1a6dc48b61544d98 100644 --- a/power/l.s +++ b/power/l.s @@ -405,7 +405,7 @@ TEXT restregs(SB), $-4 TEXT rfnote(SB), $0 MOVW 0(FP), R26 /* 1st arg is &uregpointer */ SUBU $(BY2WD), R26, SP /* pc hole */ - BNE R26, restore + JMP restore TEXT clrfpintr(SB), $0 diff --git a/power/trap.c b/power/trap.c index 9fe1849b5fadd258ceff096aaf903a2570886571..65abf479fbec2b428990d1cb28f6aa4af3210963 100644 --- a/power/trap.c +++ b/power/trap.c @@ -385,6 +385,7 @@ noted(Ureg **urp) } u->notified = 0; memcpy(*urp, u->ureg, sizeof(Ureg)); + (*urp)->r1 = -1; /* return error from the interrupted call */ unlock(&u->p->debug); splhi(); rfnote(urp);