Make want_resched a member of cpu_info.

This commit is contained in:
skrll 2007-10-02 13:49:45 +00:00
parent 0e5d568d01
commit 20d370f9df
3 changed files with 9 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.23 2007/05/17 14:51:18 yamt Exp $ */ /* $NetBSD: cpu.h,v 1.24 2007/10/02 13:49:45 skrll Exp $ */
/* $OpenBSD: cpu.h,v 1.20 2001/01/29 00:01:58 mickey Exp $ */ /* $OpenBSD: cpu.h,v 1.20 2001/01/29 00:01:58 mickey Exp $ */
@ -187,7 +187,6 @@ struct clockframe {
#define cpu_signotify(l) (setsoftast()) #define cpu_signotify(l) (setsoftast())
#define cpu_need_proftick(l) ((l)->l_pflag |= LP_OWEUPC, setsoftast()) #define cpu_need_proftick(l) ((l)->l_pflag |= LP_OWEUPC, setsoftast())
#define cpu_did_resched() do { want_resched = 0; } while(0)
#include <sys/cpu_data.h> #include <sys/cpu_data.h>
struct cpu_info { struct cpu_info {
@ -197,6 +196,7 @@ struct cpu_info {
int ci_cpuid; /* CPU index (see cpus[] array) */ int ci_cpuid; /* CPU index (see cpus[] array) */
int ci_mtx_count; int ci_mtx_count;
int ci_mtx_oldspl; int ci_mtx_oldspl;
int ci_want_resched;
}; };
#include <machine/intr.h> #include <machine/intr.h>
@ -224,8 +224,6 @@ void cpu_boot_secondary_processors(void);
#define HPPA_SID_KERNEL 0 #define HPPA_SID_KERNEL 0
extern int want_resched;
#define DELAY(x) delay(x) #define DELAY(x) delay(x)
static __inline paddr_t static __inline paddr_t

View File

@ -1,4 +1,4 @@
/* $NetBSD: hppa_machdep.c,v 1.9 2007/05/17 14:51:19 yamt Exp $ */ /* $NetBSD: hppa_machdep.c,v 1.10 2007/10/02 13:49:45 skrll Exp $ */
/*- /*-
* Copyright (c) 1997 The NetBSD Foundation, Inc. * Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hppa_machdep.c,v 1.9 2007/05/17 14:51:19 yamt Exp $"); __KERNEL_RCSID(0, "$NetBSD: hppa_machdep.c,v 1.10 2007/10/02 13:49:45 skrll Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -283,9 +283,9 @@ cpu_need_resched(struct cpu_info *ci, int flags)
{ {
bool immed = (flags & RESCHED_IMMED) != 0; bool immed = (flags & RESCHED_IMMED) != 0;
if (want_resched && !immed) if (ci->ci_want_resched && !immed)
return; return;
want_resched = 1; ci->ci_want_resched = 1;
if (ci->ci_curlwp != ci->ci_data.cpu_idlelwp) { if (ci->ci_curlwp != ci->ci_data.cpu_idlelwp) {
/* aston(ci->ci_curlwp); */ /* aston(ci->ci_curlwp); */

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.46 2007/08/15 12:07:24 ad Exp $ */ /* $NetBSD: trap.c,v 1.47 2007/10/02 13:49:45 skrll Exp $ */
/*- /*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -69,7 +69,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.46 2007/08/15 12:07:24 ad Exp $"); __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.47 2007/10/02 13:49:45 skrll Exp $");
/* #define INTRDEBUG */ /* #define INTRDEBUG */
/* #define TRAPDEBUG */ /* #define TRAPDEBUG */
@ -172,7 +172,6 @@ uint8_t fpopmap[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
}; };
int want_resched;
volatile int astpending; volatile int astpending;
void pmap_hptdump(void); void pmap_hptdump(void);
@ -195,7 +194,7 @@ userret(struct lwp *l, register_t pc, u_quad_t oticks)
struct proc *p = l->l_proc; struct proc *p = l->l_proc;
l->l_priority = l->l_usrpri; l->l_priority = l->l_usrpri;
if (want_resched) { if (curcpu()->ci_want_resched) {
preempt(); preempt();
} }