summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_synch.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-08-21 20:09:05 +0000
committerjhb <jhb@FreeBSD.org>2001-08-21 20:09:05 +0000
commit2d8b87461880a28413751515a0b56b29bf14efad (patch)
tree9aafc7dcbc6133830fb173811e9073e45b8c9121 /sys/kern/kern_synch.c
parent478fdbdcbc1d3ff9459bb8b2dc7050b32a724e81 (diff)
downloadFreeBSD-src-2d8b87461880a28413751515a0b56b29bf14efad.zip
FreeBSD-src-2d8b87461880a28413751515a0b56b29bf14efad.tar.gz
Add a hook to mi_switch() to abort via db_error() if we attempt to
perform a context switch from DDB. Consulting from: bde
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r--sys/kern/kern_synch.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 6a20e10..e39ee45 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -39,6 +39,7 @@
* $FreeBSD$
*/
+#include "opt_ddb.h"
#include "opt_ktrace.h"
#include <sys/param.h>
@@ -58,6 +59,9 @@
#include <sys/vmmeter.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
+#ifdef DDB
+#include <ddb/ddb.h>
+#endif
#ifdef KTRACE
#include <sys/uio.h>
#include <sys/ktrace.h>
@@ -664,6 +668,14 @@ mi_switch()
(int64_t)1000000;
}
+#ifdef DDB
+ /*
+ * Don't perform context switches from the debugger.
+ */
+ if (db_active)
+ db_error("Context switches not allowed in the debugger.");
+#endif
+
#if 0
/*
* Check if the process exceeds its cpu resource allocation.
OpenPOWER on IntegriCloud