M gnot/fault.c => gnot/fault.c +1 -3
@@ 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);
M gnot/l.s => gnot/l.s +1 -0
@@ 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
M gnot/stream.c => gnot/stream.c +6 -0
@@ 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();
}
/*
M port/devdk.c => port/devdk.c +16 -2
@@ 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
M port/devpipe.c => port/devpipe.c +8 -1
@@ 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,
M port/fault.c => port/fault.c +1 -3
@@ 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);
M port/stream.c => port/stream.c +10 -0
@@ 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();
}
/*
M power/l.s => power/l.s +1 -1
@@ 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
M power/trap.c => power/trap.c +1 -0
@@ 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);