diff options
author | dg <dg@FreeBSD.org> | 1993-11-04 15:05:41 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1993-11-04 15:05:41 +0000 |
commit | 89898c034bb2400803837ab0803609c52548f3cc (patch) | |
tree | 94a9bad3c4d6bade3ef60848db5a4f8db070c11c /sys/kern/subr_trap.c | |
parent | a75aa5402e113401e3981b7b512c90761b6b4f8a (diff) | |
download | FreeBSD-src-89898c034bb2400803837ab0803609c52548f3cc.zip FreeBSD-src-89898c034bb2400803837ab0803609c52548f3cc.tar.gz |
splnone()'s in the trap code can be deadly. Save/restore previous priority
instead.
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r-- | sys/kern/subr_trap.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 5066c9b..c224396 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.4 1993/10/15 10:34:27 rgrimes Exp $ + * $Id: trap.c,v 1.5 1993/11/01 11:51:29 chmr Exp $ */ /* @@ -368,6 +368,7 @@ out: psig(i); p->p_pri = p->p_usrpri; if (want_resched) { + int s; /* * Since we are curproc, clock will normally just change * our priority without moving us from one queue to another @@ -376,11 +377,11 @@ out: * swtch()'ed, we might not be on the queue indicated by * our priority. */ - (void) splclock(); + s = splclock(); setrq(p); p->p_stats->p_ru.ru_nivcsw++; swtch(); - (void) splnone(); + splx(s); while (i = CURSIG(p)) psig(i); } @@ -535,6 +536,7 @@ done: psig(i); p->p_pri = p->p_usrpri; if (want_resched) { + int s; /* * Since we are curproc, clock will normally just change * our priority without moving us from one queue to another @@ -543,11 +545,11 @@ done: * swtch()'ed, we might not be on the queue indicated by * our priority. */ - (void) splclock(); + s = splclock(); setrq(p); p->p_stats->p_ru.ru_nivcsw++; swtch(); - (void) splnone(); + splx(s); while (i = CURSIG(p)) psig(i); } |