diff options
author | Kazutaka YOKOTA <yokota@FreeBSD.org> | 2000-01-11 14:54:01 +0000 |
---|---|---|
committer | Kazutaka YOKOTA <yokota@FreeBSD.org> | 2000-01-11 14:54:01 +0000 |
commit | 35e61cbd71f82f4d81f75d39a54c90e52d1bd056 (patch) | |
tree | 571b01b68ca2a971bee51816a2fc6b3cb4bf2d21 /sys/kern/tty_cons.c | |
parent | 3c47fb79228ffdb32ee27e5c00f55deb2419da55 (diff) | |
download | src-35e61cbd71f82f4d81f75d39a54c90e52d1bd056.tar.gz src-35e61cbd71f82f4d81f75d39a54c90e52d1bd056.zip |
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
Notes
Notes:
svn path=/head/; revision=55823
Diffstat (limited to 'sys/kern/tty_cons.c')
-rw-r--r-- | sys/kern/tty_cons.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c index bac331205c41..32656f889307 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) { |