diff options
author | yokota <yokota@FreeBSD.org> | 2000-01-11 14:54:01 +0000 |
---|---|---|
committer | yokota <yokota@FreeBSD.org> | 2000-01-11 14:54:01 +0000 |
commit | 715966bf8adb1f06117b0690700bed09936230f4 (patch) | |
tree | 43bfbc350096f38a69febf5012643dcc32e4077e /sys/kern | |
parent | ddf2890cdfae4bd1cd3a719341689d029d64b580 (diff) | |
download | FreeBSD-src-715966bf8adb1f06117b0690700bed09936230f4.zip FreeBSD-src-715966bf8adb1f06117b0690700bed09936230f4.tar.gz |
Add a new mechanism, cndbctl(), to tell the console driver that
ddb is entered. Don't refer to `in_Debugger' to see if we
are in the debugger. (The variable used to be static in Debugger()
and wasn't updated if ddb is entered via traps and panic anyway.)
- Don't refer to `in_Debugger'.
- Add `db_active' to i386/i386/db_interface.d (as in
alpha/alpha/db_interface.c).
- Remove cnpollc() stub from ddb/db_input.c.
- Add the dbctl function to syscons, pcvt, and sio. (The function for
pcvt and sio is noop at the moment.)
Jointly developed by: bde and me
(The final version was tweaked by me and not reviewed by bde. Thus,
if there is any error in this commit, that is entirely of mine, not
his.)
Some changes were obtained from: NetBSD
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/subr_trap.c | 6 | ||||
-rw-r--r-- | sys/kern/tty_cons.c | 18 |
2 files changed, 19 insertions, 5 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index e1bfac4..4199346 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -90,9 +90,7 @@ #include <machine/vm86.h> -#ifdef DDB - extern int in_Debugger, debugger_on_panic; -#endif +#include <ddb/ddb.h> #include "isa.h" #include "npx.h" @@ -900,7 +898,7 @@ trap_fatal(frame, eva) return; #endif #ifdef DDB - if ((debugger_on_panic || in_Debugger) && kdb_trap(type, 0, frame)) + if ((debugger_on_panic || db_active) && kdb_trap(type, 0, frame)) return; #endif printf("trap number = %d\n", type); diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c index bac3312..32656f8 100644 --- a/sys/kern/tty_cons.c +++ b/sys/kern/tty_cons.c @@ -97,7 +97,7 @@ static d_open_t *cn_phys_open; /* physical device open function */ struct consdev *cn_tab; /* physical console device info */ static dev_t condev_t; /* represents the device private info */ -CONS_DRIVER(cons, NULL, NULL, NULL, NULL, NULL, NULL); +CONS_DRIVER(cons, NULL, NULL, NULL, NULL, NULL, NULL, NULL); void cninit() @@ -423,6 +423,22 @@ cnputc(c) } } +void +cndbctl(on) + int on; +{ + static int refcount; + + if (cn_tab == NULL) + return; + if (!on) + refcount--; + if (refcount == 0 && cn_tab->cn_dbctl != NULL) + (*cn_tab->cn_dbctl)(cn_tab->cn_dev, on); + if (on) + refcount++; +} + static void cn_drvinit(void *unused) { |