Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Mar 2010 15:19:54 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r204760 - stable/7/sys/kern
Message-ID:  <201003051519.o25FJsL2034509@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Fri Mar  5 15:19:53 2010
New Revision: 204760
URL: http://svn.freebsd.org/changeset/base/204760

Log:
  MFC r203061: KASSERT contract of return value of interrupt filter

Modified:
  stable/7/sys/kern/kern_intr.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/kern/kern_intr.c
==============================================================================
--- stable/7/sys/kern/kern_intr.c	Fri Mar  5 14:34:33 2010	(r204759)
+++ stable/7/sys/kern/kern_intr.c	Fri Mar  5 15:19:53 2010	(r204760)
@@ -1329,6 +1329,12 @@ intr_event_handle(struct intr_event *ie,
 			ret = ih->ih_filter(frame);
 		else
 			ret = ih->ih_filter(ih->ih_argument);
+		KASSERT(ret == FILTER_STRAY ||
+		    ((ret & (FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) != 0 &&
+		    (ret & ~(FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) == 0),
+		    ("%s: incorrect return value %#x from %s", __func__, ret,
+		    ih->ih_name));
+
 		/* 
 		 * Wrapper handler special handling:
 		 *
@@ -1492,7 +1498,11 @@ intr_filter_loop(struct intr_event *ie, 
 			thread_only = 1;
 			continue;
 		}
-
+		KASSERT(ret == FILTER_STRAY ||
+		    ((ret & (FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) != 0 &&
+		    (ret & ~(FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) == 0),
+		    ("%s: incorrect return value %#x from %s", __func__, ret,
+		    ih->ih_name));
 		if (ret & FILTER_STRAY)
 			continue;
 		else { 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003051519.o25FJsL2034509>