summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_cons.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-10-18 02:13:39 +0000
committerrwatson <rwatson@FreeBSD.org>2003-10-18 02:13:39 +0000
commitbf32888a2a941a3b6462ab328ab155738985c61f (patch)
treeaa1cacbc6f61924122f241c976bd9a367800934d /sys/kern/tty_cons.c
parent68dcd813b1ef06ea01356629c68e765c79b7e227 (diff)
downloadFreeBSD-src-bf32888a2a941a3b6462ab328ab155738985c61f.zip
FreeBSD-src-bf32888a2a941a3b6462ab328ab155738985c61f.tar.gz
Add a new cn_flags fields to struct consdev, the low-level console
definition structure. Define one flag, CN_FLAG_NODEBUG, which indicates the console driver cannot be used in the context of the debugger. This may be used, for example, if the console device interacts with kernel services that cannot be used from the debugger context, such as the network stack. These drivers are skipped over for calls to cn_checkc() and cn_putc(), and the calling function simply moves on to the next available console.
Diffstat (limited to 'sys/kern/tty_cons.c')
-rw-r--r--sys/kern/tty_cons.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c
index a8221a4..d94747e 100644
--- a/sys/kern/tty_cons.c
+++ b/sys/kern/tty_cons.c
@@ -538,9 +538,11 @@ cncheckc(void)
return (-1);
STAILQ_FOREACH(cnd, &cn_devlist, cnd_next) {
cn = cnd->cnd_cn;
- c = cn->cn_checkc(cn);
- if (c != -1) {
- return (c);
+ if (!db_active || (cn->cn_flags & CN_FLAG_NODEBUG)) {
+ c = cn->cn_checkc(cn);
+ if (c != -1) {
+ return (c);
+ }
}
}
return (-1);
@@ -557,9 +559,11 @@ cnputc(int c)
return;
STAILQ_FOREACH(cnd, &cn_devlist, cnd_next) {
cn = cnd->cnd_cn;
- if (c == '\n')
- cn->cn_putc(cn, '\r');
- cn->cn_putc(cn, c);
+ if (!db_active || (cn->cn_flags & CN_FLAG_NODEBUG)) {
+ if (c == '\n')
+ cn->cn_putc(cn, '\r');
+ cn->cn_putc(cn, c);
+ }
}
#ifdef DDB
if (console_pausing && !db_active && (c == '\n')) {
OpenPOWER on IntegriCloud