summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-03-05 21:47:31 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-03-05 21:47:31 +0000
commite75c4998288450dd1b5d34f9f77a541d29709de5 (patch)
treeb50970b8bb8f07313d4a73dde7f97bd5468cf926
parent866e902b48c30f21638a6d7adf27f0d243ccd646 (diff)
Lower the ipl to what it was at the time of the trap in general_exception,
instead of remaining at splhigh; from NetBSD ok drahn@
-rw-r--r--sys/arch/sh/sh/trap.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/arch/sh/sh/trap.c b/sys/arch/sh/sh/trap.c
index 53b5489a438..f538a3e05a9 100644
--- a/sys/arch/sh/sh/trap.c
+++ b/sys/arch/sh/sh/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.9 2007/03/02 06:11:54 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.10 2007/03/05 21:47:30 miod Exp $ */
/* $NetBSD: exception.c,v 1.32 2006/09/04 23:57:52 uwe Exp $ */
/* $NetBSD: syscall.c,v 1.6 2006/03/07 07:21:50 thorpej Exp $ */
@@ -163,12 +163,19 @@ void
general_exception(struct proc *p, struct trapframe *tf, uint32_t va)
{
int expevt = tf->tf_expevt;
- int tra;
+ int tra, s;
boolean_t usermode = !KERNELMODE(tf->tf_ssr);
union sigval sv;
uvmexp.traps++;
+ /*
+ * This function is entered at splhigh. Restore the interrupt
+ * level to what it was when the trap occureh.
+ */
+ s = tf->tf_ssr & PSL_IMASK;
+ splx(s);
+
if (usermode) {
if (p == NULL)
goto do_panic;