Module Name:    src
Committed By:   rmind
Date:           Mon Apr 11 19:13:54 UTC 2011

Modified Files:
        src/sys/kern: kern_softint.c

Log Message:
softint_execute: add assert which could catch locking bugs in softint handlers.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/kern/kern_softint.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_softint.c
diff -u src/sys/kern/kern_softint.c:1.33 src/sys/kern/kern_softint.c:1.34
--- src/sys/kern/kern_softint.c:1.33	Mon Dec 20 00:25:46 2010
+++ src/sys/kern/kern_softint.c	Mon Apr 11 19:13:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_softint.c,v 1.33 2010/12/20 00:25:46 matt Exp $	*/
+/*	$NetBSD: kern_softint.c,v 1.34 2011/04/11 19:13:54 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
@@ -176,7 +176,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.33 2010/12/20 00:25:46 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.34 2011/04/11 19:13:54 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -539,6 +539,11 @@
 			havelock = true;
 		}
 		(*sh->sh_func)(sh->sh_arg);
+
+		/* Diagnostic: check that spin-locks have not leaked. */
+		KASSERTMSG(curcpu()->ci_mtx_count == 0,
+		    ("%s: ci_mtx_count (%d) != 0, sh_func %p\n",
+		    __func__, curcpu()->ci_mtx_count, sh->sh_func));
 	
 		(void)splhigh();
 		KASSERT((sh->sh_flags & SOFTINT_ACTIVE) != 0);

Reply via email to