diff options
-rw-r--r-- | sys/arch/sparc64/include/cpu.h | 7 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/genassym.cf | 3 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/locore.s | 8 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/trap.c | 4 |
4 files changed, 11 insertions, 11 deletions
diff --git a/sys/arch/sparc64/include/cpu.h b/sys/arch/sparc64/include/cpu.h index 9f5cc50ed1a..52eced2f583 100644 --- a/sys/arch/sparc64/include/cpu.h +++ b/sys/arch/sparc64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.39 2007/05/02 18:46:06 kettenis Exp $ */ +/* $OpenBSD: cpu.h,v 1.40 2007/05/14 21:38:08 kettenis Exp $ */ /* $NetBSD: cpu.h,v 1.28 2001/06/14 22:56:58 thorpej Exp $ */ /* @@ -105,6 +105,8 @@ struct cpu_info { int ci_upaid; struct schedstate_percpu ci_schedstate; /* scheduler state */ + int ci_want_resched; + /* DEBUG/DIAGNOSTIC stuff */ u_long ci_spin_locks; /* # of spin locks held */ u_long ci_simple_locks;/* # of simple locks held */ @@ -163,8 +165,7 @@ extern int want_ast; * Preempt the current process if in interrupt from user mode, * or after the current trap/syscall if in system mode. */ -extern int want_resched; /* resched() was called */ -#define need_resched(ci) (want_resched = 1, want_ast = 1) +#define need_resched(ci) (ci->ci_want_resched = 1, want_ast = 1) /* * This is used during profiling to integrate system time. diff --git a/sys/arch/sparc64/sparc64/genassym.cf b/sys/arch/sparc64/sparc64/genassym.cf index 170bb345012..683ead3ddb3 100644 --- a/sys/arch/sparc64/sparc64/genassym.cf +++ b/sys/arch/sparc64/sparc64/genassym.cf @@ -1,4 +1,4 @@ -# $OpenBSD: genassym.cf,v 1.14 2005/03/29 19:34:07 kettenis Exp $ +# $OpenBSD: genassym.cf,v 1.15 2007/05/14 21:38:08 kettenis Exp $ # $NetBSD: genassym.cf,v 1.23 2001/08/08 00:09:30 eeh Exp $ # @@ -154,6 +154,7 @@ member ci_next member ci_fpproc member ci_number member ci_upaid +member ci_want_resched member ci_spinup member ci_initstack member ci_paddr diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s index 30fb2e09d00..11ddc12251c 100644 --- a/sys/arch/sparc64/sparc64/locore.s +++ b/sys/arch/sparc64/sparc64/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.74 2007/05/14 19:20:11 kettenis Exp $ */ +/* $OpenBSD: locore.s,v 1.75 2007/05/14 21:38:08 kettenis Exp $ */ /* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */ /* @@ -5536,8 +5536,6 @@ Lcopyfault: .data _ALIGN - .comm _C_LABEL(want_resched),4 - /* * Switch statistics (for later tweaking): * nswitchdiff = p1 => p2 (i.e., chose different process) @@ -5917,8 +5915,8 @@ Lsw_scan: #endif /* defined(MULTIPROCESSOR) */ mov SONPROC, %o0 ! p->p_stat = SONPROC stb %o0, [%l3 + P_STAT] - sethi %hi(_C_LABEL(want_resched)), %o0 - st %g0, [%o0 + %lo(_C_LABEL(want_resched))] ! want_resched = 0; + sethi %hi(CPUINFO_VA+CI_WANT_RESCHED), %o0 + st %g0, [%o0 + %lo(CPUINFO_VA+CI_WANT_RESCHED)] ! want_resched = 0; ldx [%l3 + P_ADDR], %l1 ! newpcb = p->p_addr; stx %g0, [%l3 + 8] ! p->p_back = NULL; #if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) diff --git a/sys/arch/sparc64/sparc64/trap.c b/sys/arch/sparc64/sparc64/trap.c index 9a26947e7e5..bb37a8135e5 100644 --- a/sys/arch/sparc64/sparc64/trap.c +++ b/sys/arch/sparc64/sparc64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.49 2007/05/02 18:46:07 kettenis Exp $ */ +/* $OpenBSD: trap.c,v 1.50 2007/05/14 21:38:08 kettenis Exp $ */ /* $NetBSD: trap.c,v 1.73 2001/08/09 01:03:01 eeh Exp $ */ /* @@ -495,7 +495,7 @@ badtrap: if (p->p_flag & P_OWEUPC) { ADDUPROF(p); } - if (want_resched) + if (curcpu()->ci_want_resched) preempt(NULL); break; |