summaryrefslogtreecommitdiffstats
path: root/sys/sys/sched.h
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2014-01-30 20:14:27 +0000
committermiod <miod@openbsd.org>2014-01-30 20:14:27 +0000
commitc3fadaac2a3ab07fef60a35462b14e5543a60948 (patch)
tree1fbf532d3e65b51df47c2906d006bc22380278cd /sys/sys/sched.h
parentAbort traceback when a new ra has not been found, instead of looping on it (diff)
downloadwireguard-openbsd-c3fadaac2a3ab07fef60a35462b14e5543a60948.tar.xz
wireguard-openbsd-c3fadaac2a3ab07fef60a35462b14e5543a60948.zip
On MULTIPROCESSOR kernels, have SCHED_ASSERT_LOCKED assert both the lock being
held and ipl being >= IPL_SCHED.
Diffstat (limited to 'sys/sys/sched.h')
-rw-r--r--sys/sys/sched.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/sys/sched.h b/sys/sys/sched.h
index c514cffc1f6..1e3142777e9 100644
--- a/sys/sys/sched.h
+++ b/sys/sys/sched.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sched.h,v 1.33 2013/06/04 22:17:34 tedu Exp $ */
+/* $OpenBSD: sched.h,v 1.34 2014/01/30 20:14:27 miod Exp $ */
/* $NetBSD: sched.h,v 1.2 1999/02/28 18:14:58 ross Exp $ */
/*-
@@ -185,7 +185,11 @@ void remrunqueue(struct proc *);
*/
extern struct __mp_lock sched_lock;
-#define SCHED_ASSERT_LOCKED() KASSERT(__mp_lock_held(&sched_lock))
+#define SCHED_ASSERT_LOCKED() \
+do { \
+ splassert(IPL_SCHED); \
+ KASSERT(__mp_lock_held(&sched_lock)); \
+} while (0)
#define SCHED_ASSERT_UNLOCKED() KASSERT(__mp_lock_held(&sched_lock) == 0)
#define SCHED_LOCK_INIT() __mp_lock_init(&sched_lock)