diff options
author | 2014-01-30 20:14:27 +0000 | |
---|---|---|
committer | 2014-01-30 20:14:27 +0000 | |
commit | c3fadaac2a3ab07fef60a35462b14e5543a60948 (patch) | |
tree | 1fbf532d3e65b51df47c2906d006bc22380278cd /sys/sys/sched.h | |
parent | Abort traceback when a new ra has not been found, instead of looping on it (diff) | |
download | wireguard-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.h | 8 |
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) |