From 9d3c58daadbbf85d6bab95ac8302f21551d7601e Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 8 Jan 1992 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1992-01-08 --- gnot/trap.c | 8 ++++---- pc/trap.c | 10 +++++----- port/portfns.h | 2 +- power/trap.c | 9 +++++---- ss/trap.c | 12 ++++++------ 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/gnot/trap.c b/gnot/trap.c index dc50a367a3efa2cd0a5c9b165af44854e4945e5c..046faa2c1b7854009b397ce3747c8b5ef34947c1 100644 --- a/gnot/trap.c +++ b/gnot/trap.c @@ -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; } /* diff --git a/pc/trap.c b/pc/trap.c index 1c9aab201e19bc6701ff4c21c50be922366ae00d..1fb754a54829244ae8b262f9750938672c3b1ff8 100644 --- a/pc/trap.c +++ b/pc/trap.c @@ -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; } /* diff --git a/port/portfns.h b/port/portfns.h index de3735387a44c64ade3a9801b762c00462630e45..ee006bae21e8ca9b857cba2241f56d3dc9b3f057 100644 --- a/port/portfns.h +++ b/port/portfns.h @@ -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); diff --git a/power/trap.c b/power/trap.c index 0c86ed21314821a7e1f9392147eeee99d1c8ac8f..5f176eefa77e53927663a31eafb88ab5476379ff 100644 --- a/power/trap.c +++ b/power/trap.c @@ -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; diff --git a/ss/trap.c b/ss/trap.c index 677b424b0edf31528df1ecdb514e1795e8dcb727..d2f501eed188f6dcb7520b234e557f5cf3b57cc8 100644 --- a/ss/trap.c +++ b/ss/trap.c @@ -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; }