summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2000-05-24 16:48:33 +0000
committerthorpej <thorpej@NetBSD.org>2000-05-24 16:48:33 +0000
commit11404682053a44d205aea7911f2f39e67f2e533f (patch)
tree842807c8362c9b8f448c234bf10d0a82e810fe6b /sys
parent99bf72c6bb7e1b7575dc70c3d353012837280a2c (diff)
Use preempt(), not an open-coded equivalent (which won't be
equivalent for long).
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/alpha/trap.c19
-rw-r--r--sys/arch/amiga/amiga/trap.c17
-rw-r--r--sys/arch/arm32/arm32/ast.c20
-rw-r--r--sys/arch/arm32/arm32/undefined.c23
-rw-r--r--sys/arch/arm32/fpe-arm/armfpe_init.c23
-rw-r--r--sys/arch/atari/atari/trap.c17
-rw-r--r--sys/arch/hp300/hp300/trap.c17
-rw-r--r--sys/arch/i386/i386/trap.c17
-rw-r--r--sys/arch/luna68k/luna68k/trap.c19
-rw-r--r--sys/arch/mac68k/mac68k/trap.c17
-rw-r--r--sys/arch/mips/mips/trap.c18
-rw-r--r--sys/arch/mvme68k/mvme68k/trap.c17
-rw-r--r--sys/arch/news68k/news68k/trap.c17
-rw-r--r--sys/arch/next68k/next68k/trap.c17
-rw-r--r--sys/arch/powerpc/powerpc/trap.c18
-rw-r--r--sys/arch/sh3/sh3/trap.c17
-rw-r--r--sys/arch/sparc/sparc/trap.c15
-rw-r--r--sys/arch/sparc64/sparc64/trap.c15
-rw-r--r--sys/arch/sun3/sun3/trap.c17
-rw-r--r--sys/arch/vax/vax/trap.c24
-rw-r--r--sys/arch/x68k/x68k/trap.c17
21 files changed, 87 insertions, 294 deletions
diff --git a/sys/arch/alpha/alpha/trap.c b/sys/arch/alpha/alpha/trap.c
index a56d7d7db71..77970f9f5a2 100644
--- a/sys/arch/alpha/alpha/trap.c
+++ b/sys/arch/alpha/alpha/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.51 2000/03/01 02:22:03 thorpej Exp $ */
+/* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.51 2000/03/01 02:22:03 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -182,7 +182,7 @@ userret(p, pc, oticks)
u_int64_t pc;
u_quad_t oticks;
{
- int sig, s;
+ int sig;
/* Do any deferred user pmap operations. */
PMAP_USERRET(vm_map_pmap(&p->p_vmspace->vm_map));
@@ -193,18 +193,9 @@ userret(p, pc, oticks)
p->p_priority = p->p_usrpri;
if (want_resched) {
/*
- * Since we are curproc, a clock interrupt could
- * change our priority without changing run queues
- * (the running process is not kept on a run queue).
- * If this happened after we setrunqueue ourselves but
- * before we switch()'ed, we might not be on the queue
- * indicated by our priority.
+ * We are being preempted.
*/
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- splx(s);
+ preempt(NULL);
PMAP_USERRET(vm_map_pmap(&p->p_vmspace->vm_map));
while ((sig = CURSIG(p)) != 0)
postsig(sig);
diff --git a/sys/arch/amiga/amiga/trap.c b/sys/arch/amiga/amiga/trap.c
index 8f8fcce3ed5..997ef2d2313 100644
--- a/sys/arch/amiga/amiga/trap.c
+++ b/sys/arch/amiga/amiga/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.72 1999/12/05 11:56:30 ragge Exp $ */
+/* $NetBSD: trap.c,v 1.73 2000/05/24 16:48:34 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -218,7 +218,7 @@ userret(p, pc, oticks)
int pc;
u_quad_t oticks;
{
- int sig, s;
+ int sig;
while ((sig = CURSIG(p)) != 0)
postsig(sig);
@@ -227,18 +227,9 @@ userret(p, pc, oticks)
if (want_resched) {
/*
- * Since we are curproc, clock will normally just change
- * our priority without moving us from one queue to another
- * (since the running process is not on a queue.)
- * If that happened after we setrunqueue ourselves but before
- * we switch'ed, we might not be on the queue indicated by
- * our priority.
+ * We are being preempted.
*/
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- splx(s);
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}
diff --git a/sys/arch/arm32/arm32/ast.c b/sys/arch/arm32/arm32/ast.c
index c61c02f6cdb..d7a14326cef 100644
--- a/sys/arch/arm32/arm32/ast.c
+++ b/sys/arch/arm32/arm32/ast.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ast.c,v 1.16 1999/03/24 05:50:53 mrg Exp $ */
+/* $NetBSD: ast.c,v 1.17 2000/05/24 16:48:34 thorpej Exp $ */
/*
* Copyright (c) 1994,1995 Mark Brinicombe
@@ -68,7 +68,7 @@ userret(p, pc, oticks)
int pc;
u_quad_t oticks;
{
- int sig, s;
+ int sig;
#ifdef DIAGNOSTIC
if (p == NULL)
@@ -99,21 +99,9 @@ userret(p, pc, oticks)
if (want_resched) {
/*
- * Since we are curproc, a clock interrupt could
- * change our priority without changing run queues
- * (the running process is not kept on a run queue).
- * If this happened after we setrunqueue ourselves but
- * before we switch()'ed, we might not be on the queue
- * indicated by our priority
+ * We are being preempted.
*/
-
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
-
- mi_switch();
-
- (void)splx(s);
+ preempt(NULL);
while ((sig = (CURSIG(p))) != 0) {
postsig(sig);
}
diff --git a/sys/arch/arm32/arm32/undefined.c b/sys/arch/arm32/arm32/undefined.c
index 3463c08cece..9cb3fe1499c 100644
--- a/sys/arch/arm32/arm32/undefined.c
+++ b/sys/arch/arm32/arm32/undefined.c
@@ -1,4 +1,4 @@
-/* $NetBSD: undefined.c,v 1.16 1999/03/30 10:10:57 mycroft Exp $ */
+/* $NetBSD: undefined.c,v 1.17 2000/05/24 16:48:35 thorpej Exp $ */
/*
* Copyright (c) 1995 Mark Brinicombe.
@@ -127,7 +127,6 @@ undefinedinstruction(frame)
struct proc *p;
u_int fault_pc;
int fault_instruction;
- int s;
int fault_code;
u_quad_t sticks = 0;
int coprocessor;
@@ -194,7 +193,7 @@ undefinedinstruction(frame)
/* Fault has not been handled */
#ifdef VERBOSE_ARM32
- s = spltty();
+ { s = spltty();
if ((fault_instruction & 0x0f000010) == 0x0e000000) {
printf("CDP\n");
@@ -214,7 +213,7 @@ undefinedinstruction(frame)
disassemble(fault_pc);
}
- (void)splx(s);
+ (void)splx(s); }
#endif
if ((fault_code & FAULT_USER) == 0) {
@@ -250,21 +249,9 @@ undefinedinstruction(frame)
if (want_resched) {
/*
- * Since we are curproc, a clock interrupt could
- * change our priority without changing run queues
- * (the running process is not kept on a run queue).
- * If this happened after we setrunqueue ourselves but
- * before we switch()'ed, we might not be on the queue
- * indicated by our priority
+ * We are being preempted.
*/
-
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
-
- mi_switch();
-
- (void)splx(s);
+ preempt(NULL);
while ((sig = (CURSIG(p))) != 0) {
postsig(sig);
}
diff --git a/sys/arch/arm32/fpe-arm/armfpe_init.c b/sys/arch/arm32/fpe-arm/armfpe_init.c
index 11e831df955..d12987ccbb3 100644
--- a/sys/arch/arm32/fpe-arm/armfpe_init.c
+++ b/sys/arch/arm32/fpe-arm/armfpe_init.c
@@ -1,4 +1,4 @@
-/* $NetBSD: armfpe_init.c,v 1.16 1998/05/01 15:35:43 mark Exp $ */
+/* $NetBSD: armfpe_init.c,v 1.17 2000/05/24 16:48:35 thorpej Exp $ */
/*
* Copyright (C) 1996 Mark Brinicombe
@@ -179,7 +179,6 @@ arm_fpe_postproc(fpframe, frame)
u_int fpframe;
struct trapframe *frame;
{
- register u_int s;
register int sig;
register struct proc *p;
@@ -195,22 +194,10 @@ arm_fpe_postproc(fpframe, frame)
p->p_priority = p->p_usrpri;
if (want_resched) {
- /*
- * Since we are curproc, a clock interrupt could
- * change our priority without changing run queues
- * (the running process is not kept on a run queue).
- * If this happened after we setrunqueue ourselves but
- * before we switch()'ed, we might not be on the queue
- * indicated by our priority
- */
-
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
-
- mi_switch();
-
- (void)splx(s);
+ /*
+ * We are being preempted.
+ */
+ preempt(NULL);
while ((sig = (CURSIG(p))) != 0) {
postsig(sig);
}
diff --git a/sys/arch/atari/atari/trap.c b/sys/arch/atari/atari/trap.c
index d54c7dd0e39..c47ef30f429 100644
--- a/sys/arch/atari/atari/trap.c
+++ b/sys/arch/atari/atari/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.48 2000/03/30 13:28:28 leo Exp $ */
+/* $NetBSD: trap.c,v 1.49 2000/05/24 16:48:35 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -203,7 +203,7 @@ userret(p, fp, oticks, faultaddr, fromtrap)
u_int faultaddr;
int fromtrap;
{
- int sig, s;
+ int sig;
#ifdef M68040
int beenhere = 0;
@@ -215,18 +215,9 @@ again:
p->p_priority = p->p_usrpri;
if (want_resched) {
/*
- * Since we are curproc, clock will normally just change
- * our priority without moving us from one queue to another
- * (since the running process is not on a queue.)
- * If that happened after we put ourselves on the run queue
- * but before we mi_switch()'ed, we might not be on the queue
- * indicated by our priority.
+ * We are being preempted.
*/
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- splx(s);
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}
diff --git a/sys/arch/hp300/hp300/trap.c b/sys/arch/hp300/hp300/trap.c
index 93a10c06c12..5d7da87358e 100644
--- a/sys/arch/hp300/hp300/trap.c
+++ b/sys/arch/hp300/hp300/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.75 1999/12/05 11:56:32 ragge Exp $ */
+/* $NetBSD: trap.c,v 1.76 2000/05/24 16:48:36 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -203,7 +203,7 @@ userret(p, fp, oticks, faultaddr, fromtrap)
u_int faultaddr;
int fromtrap;
{
- int sig, s;
+ int sig;
#ifdef M68040
int beenhere = 0;
@@ -215,18 +215,9 @@ again:
p->p_priority = p->p_usrpri;
if (want_resched) {
/*
- * Since we are curproc, clock will normally just change
- * our priority without moving us from one queue to another
- * (since the running process is not on a queue.)
- * If that happened after we put ourselves on the run queue
- * but before we mi_switch()'ed, we might not be on the queue
- * indicated by our priority.
+ * We are being preempted.
*/
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- splx(s);
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}
diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c
index f1723683a64..e1169e68a02 100644
--- a/sys/arch/i386/i386/trap.c
+++ b/sys/arch/i386/i386/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.135 2000/05/11 16:38:12 jdolecek Exp $ */
+/* $NetBSD: trap.c,v 1.136 2000/05/24 16:48:36 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -179,7 +179,7 @@ userret(p, pc, oticks)
int pc;
u_quad_t oticks;
{
- int sig, s;
+ int sig;
/* take pending signals */
while ((sig = CURSIG(p)) != 0)
@@ -187,18 +187,9 @@ userret(p, pc, oticks)
p->p_priority = p->p_usrpri;
if (want_resched) {
/*
- * Since we are curproc, a clock interrupt could
- * change our priority without changing run queues
- * (the running process is not kept on a run queue).
- * If this happened after we setrunqueue ourselves but
- * before we switch()'ed, we might not be on the queue
- * indicated by our priority.
+ * We are being preempted.
*/
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- splx(s);
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}
diff --git a/sys/arch/luna68k/luna68k/trap.c b/sys/arch/luna68k/luna68k/trap.c
index 222ac441092..3e9e67d9fce 100644
--- a/sys/arch/luna68k/luna68k/trap.c
+++ b/sys/arch/luna68k/luna68k/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.3 2000/01/11 08:24:14 nisimura Exp $ */
+/* $NetBSD: trap.c,v 1.4 2000/05/24 16:48:37 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -44,7 +44,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.3 2000/01/11 08:24:14 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.4 2000/05/24 16:48:37 thorpej Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@@ -161,7 +161,7 @@ userret(p, fp, oticks, faultaddr, fromtrap)
u_int faultaddr;
int fromtrap;
{
- int sig, s;
+ int sig;
#ifdef M68040
int beenhere = 0;
@@ -173,18 +173,9 @@ again:
p->p_priority = p->p_usrpri;
if (want_resched) {
/*
- * Since we are curproc, clock will normally just change
- * our priority without moving us from one queue to another
- * (since the running process is not on a queue.)
- * If that happened after we put ourselves on the run queue
- * but before we mi_switch()'ed, we might not be on the queue
- * indicated by our priority.
+ * We are being preempted.
*/
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- splx(s);
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}
diff --git a/sys/arch/mac68k/mac68k/trap.c b/sys/arch/mac68k/mac68k/trap.c
index 8a643f3d6fc..3f622936135 100644
--- a/sys/arch/mac68k/mac68k/trap.c
+++ b/sys/arch/mac68k/mac68k/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.78 1999/12/12 08:18:49 scottr Exp $ */
+/* $NetBSD: trap.c,v 1.79 2000/05/24 16:48:37 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -184,7 +184,7 @@ userret(p, fp, oticks, faultaddr, fromtrap)
u_int faultaddr;
int fromtrap;
{
- int sig, s;
+ int sig;
#if defined(M68040)
int beenhere = 0;
@@ -198,18 +198,9 @@ again:
if (want_resched) {
/*
- * Since we are curproc, clock will normally just change
- * our priority without moving us from one queue to another
- * (since the running process is not on a queue.)
- * If that happened after we setrunqueue ourselves but before
- * we switch'ed, we might not be on the queue indicated by
- * our priority.
+ * We are being preempted.
*/
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- splx(s);
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}
diff --git a/sys/arch/mips/mips/trap.c b/sys/arch/mips/mips/trap.c
index 3d8878f9751..c17169f1b16 100644
--- a/sys/arch/mips/mips/trap.c
+++ b/sys/arch/mips/mips/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.129 2000/05/15 06:45:44 nisimura Exp $ */
+/* $NetBSD: trap.c,v 1.130 2000/05/24 16:48:39 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -44,7 +44,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.129 2000/05/15 06:45:44 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.130 2000/05/24 16:48:39 thorpej Exp $");
#include "opt_cputype.h" /* which mips CPU levels do we support? */
#include "opt_inet.h"
@@ -197,20 +197,10 @@ userret(p, pc, sticks)
postsig(sig);
p->p_priority = p->p_usrpri;
if (want_resched) {
- int s;
/*
- * Since we are curproc, a clock interrupt could
- * change our priority without changing run queues
- * (the running process is not kept on a run queue).
- * If this happened after we setrunqueue ourselves but
- * before we switch()'ed, we might not be on the queue
- * indicated by our priority.
+ * We are being preempted.
*/
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- splx(s);
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}
diff --git a/sys/arch/mvme68k/mvme68k/trap.c b/sys/arch/mvme68k/mvme68k/trap.c
index 2bc67803fa9..cd6cb84a22c 100644
--- a/sys/arch/mvme68k/mvme68k/trap.c
+++ b/sys/arch/mvme68k/mvme68k/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.36 2000/03/18 22:33:07 scw Exp $ */
+/* $NetBSD: trap.c,v 1.37 2000/05/24 16:48:40 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -207,7 +207,7 @@ userret(p, fp, oticks, faultaddr, fromtrap)
u_int faultaddr;
int fromtrap;
{
- int sig, s;
+ int sig;
#ifdef M68040
int beenhere = 0;
@@ -219,18 +219,9 @@ again:
p->p_priority = p->p_usrpri;
if (want_resched) {
/*
- * Since we are curproc, clock will normally just change
- * our priority without moving us from one queue to another
- * (since the running process is not on a queue.)
- * If that happened after we put ourselves on the run queue
- * but before we mi_switch()'ed, we might not be on the queue
- * indicated by our priority.
+ * We are being preempted.
*/
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- splx(s);
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}
diff --git a/sys/arch/news68k/news68k/trap.c b/sys/arch/news68k/news68k/trap.c
index 84905b7c6a6..a1e1db5983f 100644
--- a/sys/arch/news68k/news68k/trap.c
+++ b/sys/arch/news68k/news68k/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.1 1999/12/09 14:53:18 tsutsui Exp $ */
+/* $NetBSD: trap.c,v 1.2 2000/05/24 16:48:41 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -193,7 +193,7 @@ userret(p, fp, oticks, faultaddr, fromtrap)
u_int faultaddr;
int fromtrap;
{
- int sig, s;
+ int sig;
#ifdef M68040
int beenhere = 0;
@@ -205,18 +205,9 @@ again:
p->p_priority = p->p_usrpri;
if (want_resched) {
/*
- * Since we are curproc, clock will normally just change
- * our priority without moving us from one queue to another
- * (since the running process is not on a queue.)
- * If that happened after we put ourselves on the run queue
- * but before we mi_switch()'ed, we might not be on the queue
- * indicated by our priority.
+ * We are being preempted.
*/
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- splx(s);
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}
diff --git a/sys/arch/next68k/next68k/trap.c b/sys/arch/next68k/next68k/trap.c
index c07bcd102df..873aa306047 100644
--- a/sys/arch/next68k/next68k/trap.c
+++ b/sys/arch/next68k/next68k/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.19 1999/12/05 11:56:33 ragge Exp $ */
+/* $NetBSD: trap.c,v 1.20 2000/05/24 16:48:41 thorpej Exp $ */
/*
* This file was taken from mvme68k/mvme68k/trap.c
@@ -214,7 +214,7 @@ userret(p, fp, oticks, faultaddr, fromtrap)
u_int faultaddr;
int fromtrap;
{
- int sig, s;
+ int sig;
#ifdef M68040
int beenhere = 0;
@@ -226,18 +226,9 @@ again:
p->p_priority = p->p_usrpri;
if (want_resched) {
/*
- * Since we are curproc, clock will normally just change
- * our priority without moving us from one queue to another
- * (since the running process is not on a queue.)
- * If that happened after we put ourselves on the run queue
- * but before we mi_switch()'ed, we might not be on the queue
- * indicated by our priority.
+ * We are being preempted.
*/
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- splx(s);
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}
diff --git a/sys/arch/powerpc/powerpc/trap.c b/sys/arch/powerpc/powerpc/trap.c
index 08d5e3a7904..456fa1e32cb 100644
--- a/sys/arch/powerpc/powerpc/trap.c
+++ b/sys/arch/powerpc/powerpc/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.23 2000/01/19 03:30:13 danw Exp $ */
+/* $NetBSD: trap.c,v 1.24 2000/05/24 16:48:41 thorpej Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -326,21 +326,11 @@ brain_damage:
p->p_priority = p->p_usrpri;
if (want_resched) {
- int s, sig;
-
+ int sig;
/*
- * Since we are curproc, a clock interrupt could
- * change our priority without changing run queues
- * (the running process is not kept on a run queue).
- * If this happened after we setrunqueue ourselves but
- * before switch()'ed, we might not be on the queue
- * indicated by our priority.
+ * We are being preempted.
*/
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- splx(s);
+ preempt(NULL);
while (sig = CURSIG(p))
postsig(sig);
}
diff --git a/sys/arch/sh3/sh3/trap.c b/sys/arch/sh3/sh3/trap.c
index 2614248397e..eadd1a925ca 100644
--- a/sys/arch/sh3/sh3/trap.c
+++ b/sys/arch/sh3/sh3/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.9 2000/04/20 14:02:41 msaitoh Exp $ */
+/* $NetBSD: trap.c,v 1.10 2000/05/24 16:48:42 thorpej Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@@ -99,7 +99,7 @@ userret(p, pc, oticks)
int pc;
u_quad_t oticks;
{
- int sig, s;
+ int sig;
/* take pending signals */
while ((sig = CURSIG(p)) != 0)
@@ -107,18 +107,9 @@ userret(p, pc, oticks)
p->p_priority = p->p_usrpri;
if (want_resched) {
/*
- * Since we are curproc, a clock interrupt could
- * change our priority without changing run queues
- * (the running process is not kept on a run queue).
- * If this happened after we setrunqueue ourselves but
- * before we switch()'ed, we might not be on the queue
- * indicated by our priority.
+ * We are being preempted.
*/
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- splx(s);
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}
diff --git a/sys/arch/sparc/sparc/trap.c b/sys/arch/sparc/sparc/trap.c
index 71751470018..ddadbd416b5 100644
--- a/sys/arch/sparc/sparc/trap.c
+++ b/sys/arch/sparc/sparc/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.88 2000/02/08 03:16:00 mycroft Exp $ */
+/* $NetBSD: trap.c,v 1.89 2000/05/24 16:48:42 thorpej Exp $ */
/*
* Copyright (c) 1996
@@ -228,18 +228,9 @@ userret(p, pc, oticks)
}
if (want_resched) {
/*
- * Since we are curproc, clock will normally just change
- * our priority without moving us from one queue to another
- * (since the running process is not on a queue.)
- * If that happened after we put ourselves on the run queue
- * but before we switched, we might not be on the queue
- * indicated by our priority.
+ * We are being preempted.
*/
- (void) splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- (void) spl0();
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}
diff --git a/sys/arch/sparc64/sparc64/trap.c b/sys/arch/sparc64/sparc64/trap.c
index a667329d6a3..0b6d1b3a75b 100644
--- a/sys/arch/sparc64/sparc64/trap.c
+++ b/sys/arch/sparc64/sparc64/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.38 2000/04/18 02:07:57 eeh Exp $ */
+/* $NetBSD: trap.c,v 1.39 2000/05/24 16:48:43 thorpej Exp $ */
/*
* Copyright (c) 1996
@@ -437,18 +437,9 @@ userret(p, pc, oticks)
}
if (want_resched) {
/*
- * Since we are curproc, clock will normally just change
- * our priority without moving us from one queue to another
- * (since the running process is not on a queue.)
- * If that happened after we put ourselves on the run queue
- * but before we switched, we might not be on the queue
- * indicated by our priority.
+ * We are being preempted.
*/
- (void) splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- (void) spl0();
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}
diff --git a/sys/arch/sun3/sun3/trap.c b/sys/arch/sun3/sun3/trap.c
index 6b9c5af47c1..d617aba335e 100644
--- a/sys/arch/sun3/sun3/trap.c
+++ b/sys/arch/sun3/sun3/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.87 1999/12/05 11:56:36 ragge Exp $ */
+/* $NetBSD: trap.c,v 1.88 2000/05/24 16:48:43 thorpej Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@@ -188,7 +188,7 @@ userret(p, tf, oticks)
register struct trapframe *tf;
u_quad_t oticks;
{
- int sig, s;
+ int sig;
/* take pending signals */
while ((sig = CURSIG(p)) != 0)
@@ -198,18 +198,9 @@ userret(p, tf, oticks)
if (want_resched) {
/*
- * Since we are curproc, clock will normally just change
- * our priority without moving us from one queue to another
- * (since the running process is not on a queue.)
- * If that happened after we put ourselves on the run queue
- * but before we mi_switch()'ed, we might not be on the queue
- * indicated by our priority.
+ * We are being preempted.
*/
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- splx(s);
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}
diff --git a/sys/arch/vax/vax/trap.c b/sys/arch/vax/vax/trap.c
index abd1c3042f5..986373aa401 100644
--- a/sys/arch/vax/vax/trap.c
+++ b/sys/arch/vax/vax/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.48 2000/03/19 14:56:54 ragge Exp $ */
+/* $NetBSD: trap.c,v 1.49 2000/05/24 16:48:44 thorpej Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
* All rights reserved.
@@ -273,16 +273,9 @@ if(faultdebug)printf("trap accflt type %lx, code %lx, pc %lx, psl %lx\n",
if (want_resched) {
#endif
/*
- * Since we are curproc, clock will normally just change
- * our priority without moving us from one queue to another
- * (since the running process is not on a queue.)
- * If that happened after we setrunqueue ourselves but before
- * we swtch()'ed, we might not be on the queue indicated by
- * our priority.
+ * We are being preempted.
*/
- splstatclock();
- setrunqueue(p);
- mi_switch();
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}
@@ -403,16 +396,9 @@ bad:
if (want_resched) {
#endif
/*
- * Since we are curproc, clock will normally just change
- * our priority without moving us from one queue to another
- * (since the running process is not on a queue.)
- * If that happened after we setrunqueue ourselves but before
- * we swtch()'ed, we might not be on the queue indicated by
- * our priority.
+ * We are being preempted.
*/
- splstatclock();
- setrunqueue(p);
- mi_switch();
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}
diff --git a/sys/arch/x68k/x68k/trap.c b/sys/arch/x68k/x68k/trap.c
index 2f31f9d260b..0536c90b392 100644
--- a/sys/arch/x68k/x68k/trap.c
+++ b/sys/arch/x68k/x68k/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.37 2000/04/18 21:06:12 minoura Exp $ */
+/* $NetBSD: trap.c,v 1.38 2000/05/24 16:48:44 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -205,7 +205,7 @@ userret(p, fp, oticks, faultaddr, fromtrap)
u_int faultaddr;
int fromtrap;
{
- int sig, s;
+ int sig;
#ifdef M68040
int beenhere = 0;
@@ -217,18 +217,9 @@ again:
p->p_priority = p->p_usrpri;
if (want_resched) {
/*
- * Since we are curproc, clock will normally just change
- * our priority without moving us from one queue to another
- * (since the running process is not on a queue.)
- * If that happened after we put ourselves on the run queue
- * but before we mi_switch()'ed, we might not be on the queue
- * indicated by our priority.
+ * We are being preempted.
*/
- s = splstatclock();
- setrunqueue(p);
- p->p_stats->p_ru.ru_nivcsw++;
- mi_switch();
- splx(s);
+ preempt(NULL);
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}