Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/i386 Only take the kernel lock if we interrupt...



details:   https://anonhg.NetBSD.org/src/rev/b2b5be0d3dcc
branches:  trunk
changeset: 539831:b2b5be0d3dcc
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Wed Nov 27 00:43:12 2002 +0000

description:
Only take the kernel lock if we interrupted while < IPL_SCHED. Handlers
at higher levels must therefore provide their own locking. Currently
this is only serial interrupts (com), which has COM_MPLOCK for this
purpose.

diffstat:

 sys/arch/i386/i386/intr.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r 4c9c80416bad -r b2b5be0d3dcc sys/arch/i386/i386/intr.c
--- a/sys/arch/i386/i386/intr.c Wed Nov 27 00:41:59 2002 +0000
+++ b/sys/arch/i386/i386/intr.c Wed Nov 27 00:43:12 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.c,v 1.3 2002/11/25 02:10:28 enami Exp $   */
+/*     $NetBSD: intr.c,v 1.4 2002/11/27 00:43:12 fvdl Exp $    */
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -626,15 +626,17 @@
 
 #ifdef MULTIPROCESSOR
 void
-i386_intlock(void)
+i386_intlock(struct intrframe iframe)
 {
-       spinlockmgr(&kernel_lock, LK_EXCLUSIVE|LK_CANRECURSE, 0);
+       if (iframe.if_ppl < IPL_SCHED)
+               spinlockmgr(&kernel_lock, LK_EXCLUSIVE|LK_CANRECURSE, 0);
 }
 
 void
-i386_intunlock(void)
+i386_intunlock(struct intrframe iframe)
 {
-       spinlockmgr(&kernel_lock, LK_RELEASE, 0);
+       if (iframe.if_ppl < IPL_SCHED)
+               spinlockmgr(&kernel_lock, LK_RELEASE, 0);
 }
 #endif
 



Home | Main Index | Thread Index | Old Index