aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/systm.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sys/systm.h')
-rw-r--r--sys/sys/systm.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index 7e537ee4a082..bf8ab3ba9d17 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -47,6 +47,7 @@
extern int cold; /* nonzero if we are doing a cold boot */
extern int rebooting; /* kern_reboot() has been called. */
+extern int stop_scheduler; /* only one thread runs after panic */
extern const char *panicstr; /* panic message */
extern char version[]; /* system version */
extern char copyright[]; /* system copyright */
@@ -109,6 +110,14 @@ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN };
((uintptr_t)&(var) & (sizeof(void *) - 1)) == 0, msg)
/*
+ * If we have already panic'd and this is the thread that called
+ * panic(), then don't block on any mutexes but silently succeed.
+ * Otherwise, the kernel will deadlock since the scheduler isn't
+ * going to run the thread that holds any lock we need.
+ */
+#define SCHEDULER_STOPPED() __predict_false(stop_scheduler)
+
+/*
* XXX the hints declarations are even more misplaced than most declarations
* in this file, since they are needed in one file (per arch) and only used
* in two files.