From d1050d4176a9ad3d06d337184f9b0c3006c44231 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 26 Jun 1996 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1996-06-26 --- pc/trap.c | 14 +++++++------- port/proc.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pc/trap.c b/pc/trap.c index 4bd13c904374379d6a33b224ecfb883cb8711ebd..9f35327b4ffc97bcb7285186c0505197d881db66 100644 --- a/pc/trap.c +++ b/pc/trap.c @@ -269,7 +269,7 @@ trap(Ureg *ur) else if(ur->pc <= (ulong)end && *(uchar*)ur->pc == 0xCF) { if(iret_traps++ > 10) panic("iret trap"); - goto out; + goto saveout; } iret_traps = 0; @@ -294,13 +294,12 @@ trap(Ureg *ur) /* a processor or coprocessor error */ if(v <= 16){ if(user){ + spllo(); sprint(buf, "sys: trap: %s", excname[v]); postnote(up, 1, buf, NDebug); goto out; } else { dumpregs(ur); -print("%s pc=0x%lux", excname[v], ur->pc); -for(;;); panic("%s pc=0x%lux", excname[v], ur->pc); } } @@ -316,7 +315,7 @@ for(;;); * In fact, just ignore all such interrupts. */ if((isr & (1<pc, badintr[v]); @@ -326,7 +325,7 @@ for(;;); /* unimplemented traps */ print("illegal trap %d pc=0x%lux\n", v, ur->pc); } - goto out; + goto saveout; } /* there may be multiple handlers on one interrupt level */ @@ -338,10 +337,11 @@ for(;;); /* * check user since syscall does its own notifying */ +out: splhi(); if(v != Syscallvec && user && (up->procctl || up->nnote)) notify(ur); -out: +saveout: scndlastur = lastur; lastur = *ur; } @@ -526,9 +526,9 @@ notify(Ureg *ur) } if(n->flag!=NUser && (up->notified || up->notify==0)){ - qunlock(&up->debug); if(n->flag == NDebug) pprint("suicide: %s\n", n->msg); + qunlock(&up->debug); pexit(n->msg, n->flag!=NDebug); } diff --git a/port/proc.c b/port/proc.c index c2331679f966346cf1e8fdc46c3c44a507ad90d4..a33d83b2ab3747093d924d4dadce6de98c32db3f 100644 --- a/port/proc.c +++ b/port/proc.c @@ -515,7 +515,7 @@ postnote(Proc *p, int dolock, char *n, int flag) ret = 0; if(p->nnote < NNOTE) { - strcpy(p->note[up->nnote].msg, n); + strcpy(p->note[p->nnote].msg, n); p->note[p->nnote++].flag = flag; ret = 1; }