From 20d370f9dfdae6bcbe2ddab2aafcfbdf23e0f4d4 Mon Sep 17 00:00:00 2001 From: skrll Date: Tue, 2 Oct 2007 13:49:45 +0000 Subject: [PATCH] Make want_resched a member of cpu_info. --- sys/arch/hp700/include/cpu.h | 6 ++---- sys/arch/hppa/hppa/hppa_machdep.c | 8 ++++---- sys/arch/hppa/hppa/trap.c | 7 +++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/sys/arch/hp700/include/cpu.h b/sys/arch/hp700/include/cpu.h index 6759a24c0c04..cd4b21f84ae2 100644 --- a/sys/arch/hp700/include/cpu.h +++ b/sys/arch/hp700/include/cpu.h @@ -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 $ */ @@ -187,7 +187,6 @@ struct clockframe { #define cpu_signotify(l) (setsoftast()) #define cpu_need_proftick(l) ((l)->l_pflag |= LP_OWEUPC, setsoftast()) -#define cpu_did_resched() do { want_resched = 0; } while(0) #include struct cpu_info { @@ -197,6 +196,7 @@ struct cpu_info { int ci_cpuid; /* CPU index (see cpus[] array) */ int ci_mtx_count; int ci_mtx_oldspl; + int ci_want_resched; }; #include @@ -224,8 +224,6 @@ void cpu_boot_secondary_processors(void); #define HPPA_SID_KERNEL 0 -extern int want_resched; - #define DELAY(x) delay(x) static __inline paddr_t diff --git a/sys/arch/hppa/hppa/hppa_machdep.c b/sys/arch/hppa/hppa/hppa_machdep.c index 595d64dac762..091d536bf658 100644 --- a/sys/arch/hppa/hppa/hppa_machdep.c +++ b/sys/arch/hppa/hppa/hppa_machdep.c @@ -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. @@ -34,7 +34,7 @@ */ #include -__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 #include @@ -283,9 +283,9 @@ cpu_need_resched(struct cpu_info *ci, int flags) { bool immed = (flags & RESCHED_IMMED) != 0; - if (want_resched && !immed) + if (ci->ci_want_resched && !immed) return; - want_resched = 1; + ci->ci_want_resched = 1; if (ci->ci_curlwp != ci->ci_data.cpu_idlelwp) { /* aston(ci->ci_curlwp); */ diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c index e220e33cb52b..0693ef8d4ee7 100644 --- a/sys/arch/hppa/hppa/trap.c +++ b/sys/arch/hppa/hppa/trap.c @@ -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. @@ -69,7 +69,7 @@ */ #include -__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 TRAPDEBUG */ @@ -172,7 +172,6 @@ uint8_t fpopmap[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -int want_resched; volatile int astpending; 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; l->l_priority = l->l_usrpri; - if (want_resched) { + if (curcpu()->ci_want_resched) { preempt(); }