summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-03-13 19:29:34 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-03-13 19:29:34 +0000
commitd97f90c37ff4bad81225eea9980b63e911ea9030 (patch)
tree91c072f07b543ccec7c4ae9ca14a7d9db42f1003
parentd7b07f1fa8960a10e053cf762b13af223242376a (diff)
It is safe to run tlb_exception() at the pre-fault ipl.
-rw-r--r--sys/arch/sh/sh/trap.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/arch/sh/sh/trap.c b/sys/arch/sh/sh/trap.c
index f538a3e05a9..dd8a510e078 100644
--- a/sys/arch/sh/sh/trap.c
+++ b/sys/arch/sh/sh/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.10 2007/03/05 21:47:30 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.11 2007/03/13 19:29:33 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,7 +163,7 @@ void
general_exception(struct proc *p, struct trapframe *tf, uint32_t va)
{
int expevt = tf->tf_expevt;
- int tra, s;
+ int tra;
boolean_t usermode = !KERNELMODE(tf->tf_ssr);
union sigval sv;
@@ -171,10 +171,9 @@ general_exception(struct proc *p, struct trapframe *tf, uint32_t va)
/*
* This function is entered at splhigh. Restore the interrupt
- * level to what it was when the trap occureh.
+ * level to what it was when the trap occured.
*/
- s = tf->tf_ssr & PSL_IMASK;
- splx(s);
+ splx(tf->tf_ssr & PSL_IMASK);
if (usermode) {
if (p == NULL)
@@ -335,6 +334,11 @@ tlb_exception(struct proc *p, struct trapframe *tf, uint32_t va)
} \
} while(/*CONSTCOND*/0)
+ /*
+ * This function is entered at splhigh. Restore the interrupt
+ * level to what it was when the trap occured.
+ */
+ splx(tf->tf_ssr & PSL_IMASK);
usermode = !KERNELMODE(tf->tf_ssr);
if (usermode) {