Add md_astpending to struct mdlwp and use it.

This commit is contained in:
skrll 2010-04-03 07:46:01 +00:00
parent e11dcd85ce
commit 0be33f66cf
6 changed files with 25 additions and 24 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.43 2010/04/02 19:33:16 skrll Exp $ */
/* $NetBSD: cpu.h,v 1.44 2010/04/03 07:46:01 skrll Exp $ */
/* $OpenBSD: cpu.h,v 1.55 2008/07/23 17:39:35 kettenis Exp $ */
@ -216,8 +216,8 @@ struct clockframe {
#define CLKF_INTR(framep) ((framep)->cf_flags & TFF_INTR)
#define CLKF_USERMODE(framep) ((framep)->cf_flags & T_USER)
#define cpu_signotify(l) (setsoftast())
#define cpu_need_proftick(l) ((l)->l_pflag |= LP_OWEUPC, setsoftast())
#define cpu_signotify(l) (setsoftast(l))
#define cpu_need_proftick(l) ((l)->l_pflag |= LP_OWEUPC, setsoftast(l))
#include <sys/cpu_data.h>
struct cpu_info {

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.h,v 1.16 2010/03/31 12:56:14 skrll Exp $ */
/* $NetBSD: intr.h,v 1.17 2010/04/03 07:46:01 skrll Exp $ */
/* $OpenBSD: intr.h,v 1.26 2009/12/29 13:11:40 jsing Exp $ */
/*-
@ -57,9 +57,6 @@
/* The priority level masks. */
extern int imask[NIPL];
/* The asynchronous system trap flag. */
extern volatile int astpending;
/* splraise()/spllower() are in locore.S */
int splraise(int);
void spllower(int);
@ -91,7 +88,7 @@ splraiseipl(ipl_cookie_t icookie)
#include <sys/spl.h>
#define setsoftast() (astpending = 1)
#define setsoftast(l) ((l)->l_md.md_astpending = 1)
#define setsoftnet() hp700_intr_schedule(softnetmask)
void hp700_intr_schedule(int);

View File

@ -1,4 +1,4 @@
/* $NetBSD: hppa_machdep.c,v 1.20 2010/03/16 16:20:19 skrll Exp $ */
/* $NetBSD: hppa_machdep.c,v 1.21 2010/04/03 07:46:02 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.20 2010/03/16 16:20:19 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: hppa_machdep.c,v 1.21 2010/04/03 07:46:02 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -351,6 +351,10 @@ hppa_ras(struct lwp *l)
}
}
/*
* Preempt the current LWP if in interrupt from user mode,
* or after the current trap/syscall if in system mode.
*/
void
cpu_need_resched(struct cpu_info *ci, int flags)
{
@ -359,8 +363,7 @@ 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();
setsoftast(ci->ci_data.cpu_onproc);
#ifdef MULTIPROCESSOR
if (ci->ci_curlwp != ci->ci_data.cpu_idlelwp) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.85 2010/03/31 12:56:14 skrll Exp $ */
/* $NetBSD: trap.c,v 1.86 2010/04/03 07:46:02 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.85 2010/03/31 12:56:14 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.86 2010/04/03 07:46:02 skrll Exp $");
/* #define INTRDEBUG */
/* #define TRAPDEBUG */
@ -174,8 +174,6 @@ uint8_t fpopmap[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
volatile int astpending;
void pmap_hptdump(void);
void syscall(struct trapframe *, int *);
@ -205,11 +203,12 @@ userret(struct lwp *l, register_t pc, u_quad_t oticks)
{
struct proc *p = l->l_proc;
if (astpending) {
astpending = 0;
if (curcpu()->ci_want_resched) {
if (l->l_md.md_astpending) {
l->l_md.md_astpending = 0;
uvmexp.softs++;
if (curcpu()->ci_want_resched)
preempt();
}
}
mi_userret(l);

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.43 2010/04/01 12:09:39 skrll Exp $ */
/* $NetBSD: vm_machdep.c,v 1.44 2010/04/03 07:46:02 skrll Exp $ */
/* $OpenBSD: vm_machdep.c,v 1.64 2008/09/30 18:54:26 miod Exp $ */
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.43 2010/04/01 12:09:39 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.44 2010/04/03 07:46:02 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -93,6 +93,7 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize,
pcb1 = lwp_getpcb(l1);
pcb2 = lwp_getpcb(l2);
l2->l_md.md_astpending = 0;
l2->l_md.md_flags = 0;
/* Flush the parent LWP out of the FPU. */

View File

@ -1,6 +1,6 @@
/* $NetBSD: proc.h,v 1.9 2010/03/31 06:40:30 skrll Exp $ */
/* $NetBSD: proc.h,v 1.10 2010/04/03 07:46:02 skrll Exp $ */
/* $OpenBSD: proc.h,v 1.1 1998/07/07 21:32:44 mickey Exp $ */
/* $OpenBSD: proc.h,v 1.4 2009/12/29 13:11:40 jsing Exp $ */
/*
* Copyright (c) 1992, 1993
@ -43,6 +43,7 @@
*/
struct mdlwp {
struct trapframe *md_regs; /* registers on current frame */
volatile int md_astpending; /* AST pending for this LWP */
int md_flags; /* machine-dependent flags */
vaddr_t md_bpva;