summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-07-23 13:58:24 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-07-23 13:58:24 +0000
commitbad0a27f90b47800fe7b0ea53b10a1e08604d15f (patch)
treefa868d4d4f486bc9bb3f499c69775fe11a5fccc6 /sys/arch/sparc64
parent50a6fdc056a41e7c48305823c6e97333683ab53d (diff)
When handling an interrupt record the interrupt level we're handling
in a global variable (not mp safe!). Use that value for the reverse splassert check.
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/sparc64/intr.c12
-rw-r--r--sys/arch/sparc64/sparc64/locore.s19
2 files changed, 28 insertions, 3 deletions
diff --git a/sys/arch/sparc64/sparc64/intr.c b/sys/arch/sparc64/sparc64/intr.c
index ec8fd9771ae..7c5ee69c59f 100644
--- a/sys/arch/sparc64/sparc64/intr.c
+++ b/sys/arch/sparc64/sparc64/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.10 2002/05/22 00:58:26 deraadt Exp $ */
+/* $OpenBSD: intr.c,v 1.11 2002/07/23 13:58:23 art Exp $ */
/* $NetBSD: intr.c,v 1.39 2001/07/19 23:38:11 eeh Exp $ */
/*
@@ -81,6 +81,8 @@ 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;
@@ -356,5 +358,13 @@ splassert_check(int wantipl, const char *func)
if (oldipl < wantipl) {
splassert_fail(wantipl, oldipl, func);
}
+
+ if (handled_intr_level > wantipl) {
+ /*
+ * XXX - need to show difference between what's blocked and
+ * what's running.
+ */
+ splassert_fail(wantipl, handled_intr_level, func);
+ }
}
#endif
diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s
index db0c3617140..cab57047d3c 100644
--- a/sys/arch/sparc64/sparc64/locore.s
+++ b/sys/arch/sparc64/sparc64/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.21 2002/07/20 22:39:00 art Exp $ */
+/* $OpenBSD: locore.s,v 1.22 2002/07/23 13:58:23 art Exp $ */
/* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */
/*
@@ -4179,7 +4179,7 @@ _C_LABEL(sparc_interrupt):
stw %g2, [%g1]
1:
#endif
- INTR_SETUP(-CC64FSZ-TF_SIZE)
+ INTR_SETUP(-CC64FSZ-TF_SIZE-8)
! Switch to normal globals so we can save them
wrpr %g0, PSTATE_KERN, %pstate
stx %g1, [%sp + CC64FSZ + STKB + TF_G + ( 1*8)]
@@ -4224,8 +4224,18 @@ _C_LABEL(sparc_interrupt):
STULNG %o0, [%l4]
sll %l3, %l6, %l3 ! Generate IRQ mask
+ sethi %hi(_C_LABEL(handled_intr_level)), %l4
+
wrpr %l6, %pil
+ /*
+ * 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))]
+ st %l7, [%sp + CC64FSZ + STKB + TF_SIZE]
+
sparc_intr_retry:
wr %l3, 0, CLEAR_SOFTINT ! (don't clear possible %tick IRQ)
wrpr %g0, PSTATE_INTR, %pstate ! Reenable interrupts
@@ -4393,6 +4403,11 @@ intrcmplt:
97:
#endif
+ /* Restore old handled_intr_level */
+ sethi %hi(_C_LABEL(handled_intr_level)), %l4
+ ld [%sp + CC64FSZ + STKB + TF_SIZE], %l7
+ st %l7, [%l4 + %lo(_C_LABEL(handled_intr_level))]
+
ldub [%sp + CC64FSZ + STKB + TF_OLDPIL], %l3 ! restore old %pil
wrpr %g0, PSTATE_KERN, %pstate ! Disable interrupts
wrpr %l3, 0, %pil