diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2007-09-09 08:55:28 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2007-09-09 08:55:28 +0000 |
commit | d0d40dd111278a858f1181d9a4ad45915a42ca1c (patch) | |
tree | b58f1afdebc120a527ce7139b81f5c8f1f87b005 | |
parent | 05d9da80b7b9a00fb64d36fa9019fe0fc8bdbb9a (diff) |
Make handled_intr_level per-cpu.
-rw-r--r-- | sys/arch/sparc64/include/cpu.h | 3 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/genassym.cf | 3 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/intr.c | 9 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/locore.s | 12 |
4 files changed, 14 insertions, 13 deletions
diff --git a/sys/arch/sparc64/include/cpu.h b/sys/arch/sparc64/include/cpu.h index 6331ae2761e..3016de9e581 100644 --- a/sys/arch/sparc64/include/cpu.h +++ b/sys/arch/sparc64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.42 2007/09/08 17:13:17 kettenis Exp $ */ +/* $OpenBSD: cpu.h,v 1.43 2007/09/09 08:55:26 kettenis Exp $ */ /* $NetBSD: cpu.h,v 1.28 2001/06/14 22:56:58 thorpej Exp $ */ /* @@ -106,6 +106,7 @@ struct cpu_info { struct schedstate_percpu ci_schedstate; /* scheduler state */ int ci_want_resched; + int ci_handled_intr_level; /* DEBUG/DIAGNOSTIC stuff */ u_long ci_spin_locks; /* # of spin locks held */ diff --git a/sys/arch/sparc64/sparc64/genassym.cf b/sys/arch/sparc64/sparc64/genassym.cf index 9c7268a3dc4..9e00068528d 100644 --- a/sys/arch/sparc64/sparc64/genassym.cf +++ b/sys/arch/sparc64/sparc64/genassym.cf @@ -1,4 +1,4 @@ -# $OpenBSD: genassym.cf,v 1.18 2007/09/08 17:13:18 kettenis Exp $ +# $OpenBSD: genassym.cf,v 1.19 2007/09/09 08:55:27 kettenis Exp $ # $NetBSD: genassym.cf,v 1.23 2001/08/08 00:09:30 eeh Exp $ # @@ -153,6 +153,7 @@ member ci_fpproc member ci_number member ci_upaid member ci_want_resched +member ci_handled_intr_level member ci_spinup member ci_initstack member ci_paddr diff --git a/sys/arch/sparc64/sparc64/intr.c b/sys/arch/sparc64/sparc64/intr.c index 9ca99eb7cd1..e9c424d1f2f 100644 --- a/sys/arch/sparc64/sparc64/intr.c +++ b/sys/arch/sparc64/sparc64/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.26 2007/05/29 18:10:43 miod Exp $ */ +/* $OpenBSD: intr.c,v 1.27 2007/09/09 08:55:27 kettenis Exp $ */ /* $NetBSD: intr.c,v 1.39 2001/07/19 23:38:11 eeh Exp $ */ /* @@ -79,8 +79,6 @@ int intr_list_handler(void *); int ignore_stray = 1; int straycnt[16]; -int handled_intr_level; /* interrupt level that we're handling now */ - void strayintr(fp, vectored) const struct trapframe64 *fp; @@ -341,6 +339,7 @@ softintr_schedule(cookie) void splassert_check(int wantipl, const char *func) { + struct cpu_info *ci = curcpu(); int oldipl; __asm __volatile("rdpr %%pil,%0" : "=r" (oldipl)); @@ -349,12 +348,12 @@ splassert_check(int wantipl, const char *func) splassert_fail(wantipl, oldipl, func); } - if (handled_intr_level > wantipl) { + if (ci->ci_handled_intr_level > wantipl) { /* * XXX - need to show difference between what's blocked and * what's running. */ - splassert_fail(wantipl, handled_intr_level, func); + splassert_fail(wantipl, ci->ci_handled_intr_level, func); } } #endif diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s index 283dda72c7e..9f06c2a5b80 100644 --- a/sys/arch/sparc64/sparc64/locore.s +++ b/sys/arch/sparc64/sparc64/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.79 2007/09/08 17:13:18 kettenis Exp $ */ +/* $OpenBSD: locore.s,v 1.80 2007/09/09 08:55:27 kettenis Exp $ */ /* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */ /* @@ -3400,7 +3400,7 @@ _C_LABEL(sparc_interrupt): mov 1, %l3 ! Ack softint sll %l3, %l6, %l3 ! Generate IRQ mask - sethi %hi(_C_LABEL(handled_intr_level)), %l4 + sethi %hi(CPUINFO_VA+CI_HANDLED_INTR_LEVEL), %l4 wrpr %l6, %pil @@ -3408,8 +3408,8 @@ _C_LABEL(sparc_interrupt): * Set handled_intr_level and save the old one so we can restore it * later. */ - ld [%l4 + %lo(_C_LABEL(handled_intr_level))], %l7 - st %l6, [%l4 + %lo(_C_LABEL(handled_intr_level))] + ld [%l4 + %lo(CPUINFO_VA+CI_HANDLED_INTR_LEVEL)], %l7 + st %l6, [%l4 + %lo(CPUINFO_VA+CI_HANDLED_INTR_LEVEL)] st %l7, [%sp + CC64FSZ + BIAS + TF_SIZE] sparc_intr_retry: @@ -3501,9 +3501,9 @@ intrcmplt: #endif /* DEBUG */ /* Restore old handled_intr_level */ - sethi %hi(_C_LABEL(handled_intr_level)), %l4 + sethi %hi(CPUINFO_VA+CI_HANDLED_INTR_LEVEL), %l4 ld [%sp + CC64FSZ + BIAS + TF_SIZE], %l7 - st %l7, [%l4 + %lo(_C_LABEL(handled_intr_level))] + st %l7, [%l4 + %lo(CPUINFO_VA+CI_HANDLED_INTR_LEVEL)] ldub [%sp + CC64FSZ + BIAS + TF_OLDPIL], %l3 ! restore old %pil wrpr %g0, PSTATE_KERN, %pstate ! Disable interrupts |