summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-09-14 14:58:45 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-09-14 14:58:45 +0000
commitf19df634a09da40992c851ffba87756322cfd16a (patch)
treec72e96a5311bafb8509bd0732678a992bf938936 /sys
parent4ae6018f27aaad745bb676def082fd539d086eb3 (diff)
simplify userret
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/hppa/hppa/trap.c16
-rw-r--r--sys/arch/mvme88k/mvme88k/trap.c16
-rw-r--r--sys/arch/powerpc/powerpc/trap.c17
3 files changed, 10 insertions, 39 deletions
diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c
index 897ca32f76d..45a5ae5b58e 100644
--- a/sys/arch/hppa/hppa/trap.c
+++ b/sys/arch/hppa/hppa/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.28 2001/05/05 20:56:37 art Exp $ */
+/* $OpenBSD: trap.c,v 1.29 2001/09/14 14:58:44 art Exp $ */
/*
* Copyright (c) 1998-2000 Michael Shalayeff
@@ -116,20 +116,10 @@ userret (struct proc *p, register_t pc, u_quad_t oticks)
p->p_priority = p->p_usrpri;
if (want_resched) {
- register 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're 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/mvme88k/mvme88k/trap.c b/sys/arch/mvme88k/mvme88k/trap.c
index d1b025a13b1..85110a2602a 100644
--- a/sys/arch/mvme88k/mvme88k/trap.c
+++ b/sys/arch/mvme88k/mvme88k/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.21 2001/08/31 01:52:22 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.22 2001/09/14 14:58:44 art Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -136,7 +136,6 @@ static inline void
userret(struct proc *p, struct m88100_saved_state *frame, u_quad_t oticks)
{
int sig;
- int s;
/* take pending signals */
while ((sig = CURSIG(p)) != 0)
@@ -145,18 +144,9 @@ userret(struct proc *p, struct m88100_saved_state *frame, u_quad_t 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're 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/powerpc/powerpc/trap.c b/sys/arch/powerpc/powerpc/trap.c
index d0421ccce3c..9944452efb8 100644
--- a/sys/arch/powerpc/powerpc/trap.c
+++ b/sys/arch/powerpc/powerpc/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.29 2001/07/09 02:07:49 mickey Exp $ */
+/* $OpenBSD: trap.c,v 1.30 2001/09/14 14:58:44 art Exp $ */
/* $NetBSD: trap.c,v 1.3 1996/10/13 03:31:37 christos Exp $ */
/*
@@ -430,21 +430,12 @@ for (i = 0; i < errnum; i++) {
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're 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);
}