M gnot/trap.c => gnot/trap.c +4 -4
@@ 7,7 7,6 @@
#include "io.h"
#include "errno.h"
-void notify(Ureg*);
void noted(Ureg*, ulong);
void rfnote(Ureg*);
@@ 156,7 155,7 @@ dumpregs(Ureg *ur)
/*
* Call user, if necessary, with note
*/
-void
+int
notify(Ureg *ur)
{
int l;
@@ 165,8 164,8 @@ notify(Ureg *ur)
if(u->p->procctl)
procctl(u->p);
- if(u->nnote==0)
- return;
+ if(u->nnote == 0)
+ return 0;
s = spllo();
qlock(&u->p->debug);
@@ 218,6 217,7 @@ notify(Ureg *ur)
}
qunlock(&u->p->debug);
splx(s);
+ return 1;
}
/*
M pc/trap.c => pc/trap.c +5 -5
@@ 8,7 8,6 @@
#include "errno.h"
void noted(Ureg*, ulong);
-void notify(Ureg*);
void intr0(void), intr1(void), intr2(void), intr3(void);
void intr4(void), intr5(void), intr6(void), intr7(void);
@@ 242,7 241,7 @@ trap(Ureg *ur)
(*ivec[v])(ur);
/*
- * check user since syscall does it's own notifying
+ * check user since syscall does its own notifying
*/
if(user && (u->p->procctl || u->nnote))
notify(ur);
@@ 352,7 351,7 @@ syscall(Ureg *ur)
* Call user, if necessary, with note.
* Pass user the Ureg struct and the note on his stack.
*/
-void
+int
notify(Ureg *ur)
{
int l;
@@ 361,8 360,8 @@ notify(Ureg *ur)
if(u->p->procctl)
procctl(u->p);
- if(u->nnote==0)
- return;
+ if(u->nnote == 0)
+ return 0;
s = spllo();
qlock(&u->p->debug);
@@ 414,6 413,7 @@ notify(Ureg *ur)
}
qunlock(&u->p->debug);
splx(s);
+ return 1;
}
/*
M port/portfns.h => port/portfns.h +1 -1
@@ 143,7 143,7 @@ Segment* newseg(int, ulong, ulong);
Waitq* newwaitq(void);
char* nextelem(char*, char*);
void nexterror(void);
-void notify(Ureg*);
+int notify(Ureg*);
int nrand(int);
void nullput(Queue*, Block*);
int openmode(ulong);
M power/trap.c => power/trap.c +5 -4
@@ 364,7 364,7 @@ dumpregs(Ureg *ur)
/*
* Call user, if necessary, with note
*/
-void
+int
notify(Ureg *ur)
{
int l;
@@ 374,7 374,7 @@ notify(Ureg *ur)
if(u->p->procctl)
procctl(u->p);
if(u->nnote == 0)
- return;
+ return 0;
s = spllo();
qlock(&u->p->debug);
@@ 424,6 424,7 @@ notify(Ureg *ur)
}
qunlock(&u->p->debug);
splx(s);
+ return 1;
}
/*
@@ 544,8 545,8 @@ syscall(Ureg *aur)
splhi();
if(r1!=FORK && (u->p->procctl || u->nnote)){
u->svr1 = ret;
- notify(ur);
- return ur->r1;
+ if(notify(ur))
+ return ur->r1;
}
return ret;
M ss/trap.c => ss/trap.c +6 -6
@@ 7,7 7,6 @@
#include "io.h"
#include "errno.h"
-void notify(Ureg*);
void noted(Ureg**, ulong);
void rfnote(Ureg**);
@@ 226,7 225,7 @@ dumpregs(Ureg *ur)
dumpstack();
}
-void
+int
notify(Ureg *ur)
{
int l;
@@ 235,8 234,8 @@ notify(Ureg *ur)
if(u->p->procctl)
procctl(u->p);
- if(u->nnote==0)
- return;
+ if(u->nnote == 0)
+ return 0;
s = spllo();
qlock(&u->p->debug);
@@ 288,6 287,7 @@ notify(Ureg *ur)
}
qunlock(&u->p->debug);
splx(s);
+ return 1;
}
/*
@@ 408,8 408,8 @@ syscall(Ureg *aur)
splhi();
if(r7!=FORK && (u->p->procctl || u->nnote)){
u->svr7 = ret;
- notify(ur);
- return ur->r7;
+ if(notify(ur))
+ return ur->r7;
}
return ret;
}