diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2020-01-12 06:07:54 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2020-01-12 06:07:54 +0000 |
commit | 879e0604ee6ac0ded87f6754141e7af25f4b7d5a (patch) | |
tree | 377214dcbc05356fc2c2709c00fb9f037b59573b /sys/kern/kern_lock.c | |
parent | 76a49ebaa6f20a6d11c310fd675b53bfb99360f3 (diff) | |
download | src-879e0604ee6ac0ded87f6754141e7af25f4b7d5a.tar.gz src-879e0604ee6ac0ded87f6754141e7af25f4b7d5a.zip |
Add KERNEL_PANICKED macro for use in place of direct panicstr tests
Notes
Notes:
svn path=/head/; revision=356655
Diffstat (limited to 'sys/kern/kern_lock.c')
-rw-r--r-- | sys/kern/kern_lock.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 2831de60c7d8..ae3598000edb 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -558,7 +558,7 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, int contested = 0; #endif - if (__predict_false(panicstr != NULL)) + if (KERNEL_PANICKED()) goto out; tid = (uintptr_t)curthread; @@ -700,7 +700,7 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, int contested = 0; #endif - if (__predict_false(panicstr != NULL)) + if (KERNEL_PANICKED()) goto out; tid = (uintptr_t)curthread; @@ -882,7 +882,7 @@ lockmgr_upgrade(struct lock *lk, u_int flags, struct lock_object *ilk, int wakeup_swapper = 0; int op; - if (__predict_false(panicstr != NULL)) + if (KERNEL_PANICKED()) goto out; tid = (uintptr_t)curthread; @@ -941,7 +941,7 @@ lockmgr_lock_fast_path(struct lock *lk, u_int flags, struct lock_object *ilk, u_int op; bool locked; - if (__predict_false(panicstr != NULL)) + if (KERNEL_PANICKED()) return (0); op = flags & LK_TYPE_MASK; @@ -1003,7 +1003,7 @@ lockmgr_sunlock_hard(struct lock *lk, uintptr_t x, u_int flags, struct lock_obje { int wakeup_swapper = 0; - if (__predict_false(panicstr != NULL)) + if (KERNEL_PANICKED()) goto out; wakeup_swapper = wakeupshlk(lk, file, line); @@ -1022,7 +1022,7 @@ lockmgr_xunlock_hard(struct lock *lk, uintptr_t x, u_int flags, struct lock_obje u_int realexslp; int queue; - if (__predict_false(panicstr != NULL)) + if (KERNEL_PANICKED()) goto out; tid = (uintptr_t)curthread; @@ -1126,7 +1126,7 @@ lockmgr_unlock_fast_path(struct lock *lk, u_int flags, struct lock_object *ilk) const char *file; int line; - if (__predict_false(panicstr != NULL)) + if (KERNEL_PANICKED()) return (0); file = __FILE__; @@ -1254,7 +1254,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, int contested = 0; #endif - if (panicstr != NULL) + if (KERNEL_PANICKED()) return (0); error = 0; @@ -1662,7 +1662,7 @@ _lockmgr_assert(const struct lock *lk, int what, const char *file, int line) { int slocked = 0; - if (panicstr != NULL) + if (KERNEL_PANICKED()) return; switch (what) { case KA_SLOCKED: |