Add a hook to mi_switch() to abort via db_error() if we attempt to

perform a context switch from DDB.

Consulting from:	bde
This commit is contained in:
John Baldwin 2001-08-21 20:09:05 +00:00
parent 82f1838cd9
commit 161778121a

View File

@ -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.