Tweak astpending handling.

This commit is contained in:
skrll 2010-01-16 13:29:47 +00:00
parent 2e0bcc8d3b
commit 8c8e2e46ed
2 changed files with 16 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: hppa_machdep.c,v 1.18 2009/11/21 15:36:33 rmind Exp $ */
/* $NetBSD: hppa_machdep.c,v 1.19 2010/01/16 13:29:47 skrll Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hppa_machdep.c,v 1.18 2009/11/21 15:36:33 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: hppa_machdep.c,v 1.19 2010/01/16 13:29:47 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -363,10 +363,14 @@ cpu_need_resched(struct cpu_info *ci, int flags)
if (ci->ci_want_resched && !immed)
return;
ci->ci_want_resched = 1;
/* setsoftast(ci->ci_data.cpu_onproc); */
setsoftast();
#ifdef MULTIPROCESSOR
if (ci->ci_curlwp != ci->ci_data.cpu_idlelwp) {
/* aston(ci->ci_curlwp); */
setsoftast();
if (ci->ci_curlwp != ci->ci_data.cpu_idlelwp) {
if (immed && ci != curcpu()) {
/* XXX send IPI */
}
}
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.69 2010/01/16 07:56:16 skrll Exp $ */
/* $NetBSD: trap.c,v 1.70 2010/01/16 13:29:47 skrll Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.69 2010/01/16 07:56:16 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.70 2010/01/16 13:29:47 skrll Exp $");
/* #define INTRDEBUG */
/* #define TRAPDEBUG */
@ -206,8 +206,11 @@ userret(struct lwp *l, register_t pc, u_quad_t oticks)
{
struct proc *p = l->l_proc;
if (curcpu()->ci_want_resched) {
preempt();
if (astpending) {
astpending = 0;
if (curcpu()->ci_want_resched) {
preempt();
}
}
mi_userret(l);