Lines Matching +full:per +full:- +full:console

1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
87 static MALLOC_DEFINE(M_TTYCONS, "tty console", "tty console handling");
100 int cons_avail_mask = 0; /* Bit mask. Each registered low level console
108 "State of the console muting");
112 struct msgbuf consmsgbuf; /* message buffer for console tty */
116 struct tty *constty; /* pointer to console "window" tty */
130 * of kbd.c is contingent on any number of keyboard/console drivers being
146 printf("-- Muting boot messages --\n"); in mute_console()
160 * Check if we should mute the console (for security reasons perhaps) in cninit()
171 * Bring up the kbd layer just in time for cnprobe. Console drivers in cninit()
179 * Find the first console with the highest priority. in cninit()
186 if (cn->cn_ops == NULL) in cninit()
188 cn->cn_ops->cn_probe(cn); in cninit()
189 if (cn->cn_pri == CN_DEAD) in cninit()
191 if (best_cn == NULL || cn->cn_pri > best_cn->cn_pri) in cninit()
195 * Initialize console, and attach to it. in cninit()
197 cn->cn_ops->cn_init(cn); in cninit()
204 best_cn->cn_ops->cn_init(best_cn); in cninit()
210 * Make the best console the preferred console. in cninit()
216 * Release early console. in cninit()
229 /* add a new physical console to back the virtual console */
237 if (cnd->cnd_cn == cn) in cnadd()
241 if (cnd->cnd_cn == NULL) in cnadd()
244 if (cnd->cnd_cn != NULL) in cnadd()
246 cnd->cnd_cn = cn; in cnadd()
247 if (cn->cn_name[0] == '\0') { in cnadd()
249 printf("WARNING: console at %p has no name\n", cn); in cnadd()
253 ttyconsdev_select(cnd->cnd_cn->cn_name); in cnadd()
256 cnavailable(cn, (cn->cn_flags & CN_FLAG_NOAVAIL) == 0); in cnadd()
268 if (cnd->cnd_cn != cn) in cnremove()
273 cnd->cnd_cn = NULL; in cnremove()
284 * syscons gets really confused if console resources are in cnremove()
287 if (cn->cn_term != NULL) in cnremove()
288 cn->cn_ops->cn_term(cn); in cnremove()
300 if (cnd->cnd_cn != cn) in cnselect()
306 ttyconsdev_select(cnd->cnd_cn->cn_name); in cnselect()
323 cn->cn_flags &= ~CN_FLAG_NOAVAIL; in cnavailable()
327 cn->cn_flags |= CN_FLAG_NOAVAIL; in cnavailable()
357 sbuf_printf(sb, "%s,", cnd->cnd_cn->cn_name); in sysctl_kern_console()
361 if (cp->cn_name[0] != '\0') in sysctl_kern_console()
362 sbuf_printf(sb, "%s,", cp->cn_name); in sysctl_kern_console()
366 if (error == 0 && req->newptr != NULL) { in sysctl_kern_console()
370 if (*p == '-') { in sysctl_kern_console()
376 if (strcmp(p, cp->cn_name) != 0) in sysctl_kern_console()
393 SYSCTL_PROC(_kern, OID_AUTO, console,
396 "Console device control");
405 cn = cnd->cnd_cn; in cngrab()
406 if (!kdb_active || !(cn->cn_flags & CN_FLAG_NODEBUG)) in cngrab()
407 cn->cn_ops->cn_grab(cn); in cngrab()
418 cn = cnd->cnd_cn; in cnungrab()
419 if (!kdb_active || !(cn->cn_flags & CN_FLAG_NODEBUG)) in cnungrab()
420 cn->cn_ops->cn_ungrab(cn); in cnungrab()
431 cn = cnd->cnd_cn; in cnresume()
432 if (cn->cn_ops->cn_resume != NULL) in cnresume()
433 cn->cn_ops->cn_resume(cn); in cnresume()
438 * Low level console routines.
446 return (-1); in cngetc()
447 while ((c = cncheckc()) == -1) in cngetc()
450 c = '\n'; /* console input is always ICRNL */ in cngetc()
462 return (-1); in cncheckc()
464 cn = cnd->cnd_cn; in cncheckc()
465 if (!kdb_active || !(cn->cn_flags & CN_FLAG_NODEBUG)) { in cncheckc()
466 c = cn->cn_ops->cn_getc(cn); in cncheckc()
467 if (c != -1) in cncheckc()
471 return (-1); in cncheckc()
483 end = cp + size - 1; in cngets()
498 lp--; in cngets()
541 cn = cnd->cnd_cn; in cnputc()
542 if (!kdb_active || !(cn->cn_flags & CN_FLAG_NODEBUG)) { in cnputc()
544 cn->cn_ops->cn_putc(cn, '\r'); in cnputc()
545 cn->cn_ops->cn_putc(cn, c); in cnputc()
571 * console driver clients can cause the "cnputs_mtx" in cnputsn()
595 0, "Console tty buffer size");
598 * Redirect console output to a tty.
637 * Disable console redirection to a tty.
651 while ((c = msgbuf_getchar(&consmsgbuf)) != -1) in constty_clear()
657 /* Times per second to check for pending console tty messages. */
661 "Times per second to check for pending console tty messages");
670 while ((c = msgbuf_getchar(&consmsgbuf)) != -1) { in constty_timeout()
743 0, "Console vty driver");