FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_ddb.h"
#include "opt_syscons.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/conf.h>
#include <sys/cons.h>
#include <sys/fcntl.h>
#include <sys/kbio.h>
#include <sys/kdb.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/msgbuf.h>
#include <sys/namei.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/queue.h>
#include <sys/reboot.h>
#include <sys/sysctl.h>
#include <sys/sbuf.h>
#include <sys/tty.h>
#include <sys/uio.h>
#include <sys/vnode.h>
#include <ddb/ddb.h>
#include <dev/kbd/kbdreg.h>
#include <machine/cpu.h>
#include <machine/clock.h>
Go to the source code of this file.
Data Structures | |
struct | cn_device |
Macros | |
#define | CNDEVPATHMAX 32 |
#define | CNDEVTAB_SIZE 4 |
Functions | |
__FBSDID ("$FreeBSD$") | |
static | MALLOC_DEFINE (M_TTYCONS, "tty console", "tty console handling") |
static | STAILQ_HEAD (cn_device) |
void | cninit (void) |
void | cninit_finish () |
int | cnadd (struct consdev *cn) |
void | cnremove (struct consdev *cn) |
void | cnselect (struct consdev *cn) |
void | cnavailable (struct consdev *cn, int available) |
int | cnunavailable (void) |
static int | sysctl_kern_console (SYSCTL_HANDLER_ARGS) |
SYSCTL_PROC (_kern, OID_AUTO, console, CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_NEEDGIANT, 0, 0, sysctl_kern_console, "A", "Console device control") | |
void | cngrab () |
void | cnungrab () |
void | cnresume () |
int | cngetc (void) |
int | cncheckc (void) |
void | cngets (char *cp, size_t size, int visible) |
void | cnputc (int c) |
void | cnputsn (const char *p, size_t n) |
void | cnputs (const char *p) |
SYSCTL_UINT (_kern, OID_AUTO, consmsgbuf_size, CTLFLAG_RWTUN, &consmsgbuf_size, 0, "Console tty buffer size") | |
int | constty_set (struct tty *tp) |
int | constty_clear (struct tty *tp) |
SYSCTL_INT (_kern, OID_AUTO, constty_wakeups_per_second, CTLFLAG_RW, &constty_wakeups_per_second, 0, "Times per second to check for pending console tty messages") | |
static void | constty_timeout (void *arg) |
int | sysbeep (int pitch __unused, sbintime_t duration __unused) |
SYSCTL_STRING (_kern, OID_AUTO, vty, CTLFLAG_RDTUN|CTLFLAG_NOFETCH, vty_name, 0, "Console vty driver") | |
int | vty_enabled (unsigned vty) |
void | vty_set_preferred (unsigned vty) |
Variables | |
static struct cn_device | cn_devtab [CNDEVTAB_SIZE] |
static unsigned int | consmsgbuf_size = 65536 |
static int | constty_wakeups_per_second = 15 |
static unsigned | vty_prefer |
static char | vty_name [16] |
#define CNDEVPATHMAX 32 |
Definition at line 85 of file kern_cons.c.
#define CNDEVTAB_SIZE 4 |
Definition at line 86 of file kern_cons.c.
__FBSDID | ( | "$FreeBSD$" | ) |
int cnadd | ( | struct consdev * | cn | ) |
Definition at line 208 of file kern_cons.c.
References cn_devtab, cnavailable(), CNDEVTAB_SIZE, printf(), and ttyconsdev_select().
Referenced by cninit(), sysctl_kern_console(), and termcn_cnregister().
void cnavailable | ( | struct consdev * | cn, |
int | available | ||
) |
Definition at line 289 of file kern_cons.c.
References cn_devtab, and CNDEVTAB_SIZE.
Referenced by cnadd().
int cncheckc | ( | void | ) |
Definition at line 432 of file kern_cons.c.
References kdb_active.
Referenced by cngetc(), dumpsys_cb_dumpdata(), and shutdown_panic().
int cngetc | ( | void | ) |
Definition at line 418 of file kern_cons.c.
References cncheckc().
Referenced by cngets(), cnputc(), shutdown_halt(), and shutdown_panic().
void cngets | ( | char * | cp, |
size_t | size, | ||
int | visible | ||
) |
Definition at line 452 of file kern_cons.c.
References cngetc(), cngrab(), cnputc(), cnputs(), and cnungrab().
Referenced by parse_dir_ask().
void cngrab | ( | ) |
Definition at line 376 of file kern_cons.c.
References kdb_active.
Referenced by cngets(), cnputc(), kdb_trap(), kern_reboot(), and vpanic().
void cninit | ( | void | ) |
Definition at line 133 of file kern_cons.c.
References boothowto, cnadd(), cnremove(), and cnselect().
void cninit_finish | ( | ) |
Definition at line 201 of file kern_cons.c.
void cnputc | ( | int | c | ) |
Definition at line 499 of file kern_cons.c.
References cngetc(), cngrab(), cnputc(), cnungrab(), and kdb_active.
Referenced by cngets(), cnputc(), cnputsn(), constty_clear(), prf_putchar(), and putchar().
void cnputs | ( | const char * | p | ) |
Definition at line 564 of file kern_cons.c.
References cnputsn().
Referenced by cngets(), and prf_putbuf().
void cnputsn | ( | const char * | p, |
size_t | n | ||
) |
Definition at line 539 of file kern_cons.c.
References cnputc().
Referenced by cnputs(), and sbuf_tty_drain().
void cnremove | ( | struct consdev * | cn | ) |
Definition at line 239 of file kern_cons.c.
References cn_devtab, CNDEVTAB_SIZE, and ttyconsdev_select().
Referenced by cninit(), and sysctl_kern_console().
void cnresume | ( | ) |
Definition at line 402 of file kern_cons.c.
void cnselect | ( | struct consdev * | cn | ) |
Definition at line 272 of file kern_cons.c.
References ttyconsdev_select().
Referenced by cninit(), and sysctl_kern_console().
int cnunavailable | ( | void | ) |
Definition at line 309 of file kern_cons.c.
void cnungrab | ( | ) |
Definition at line 389 of file kern_cons.c.
References kdb_active.
Referenced by cngets(), cnputc(), and kdb_trap().
int constty_clear | ( | struct tty * | tp | ) |
Definition at line 616 of file kern_cons.c.
References cnputc(), and msgbuf_getchar().
Referenced by constty_timeout(), tty_generic_ioctl(), and ttydev_leave().
int constty_set | ( | struct tty * | tp | ) |
Definition at line 577 of file kern_cons.c.
References buf, consmsgbuf_size, constty_timeout(), free(), malloc(), and msgbuf_init().
Referenced by tty_generic_ioctl().
|
static |
Definition at line 640 of file kern_cons.c.
References constty_clear(), constty_timeout(), constty_wakeups_per_second, msgbuf_getchar(), and tty_putchar().
Referenced by constty_set(), and constty_timeout().
|
static |
|
static |
Definition at line 88 of file kern_cons.c.
Referenced by ktls_work_thread().
int sysbeep | ( | int pitch | __unused, |
sbintime_t duration | __unused | ||
) |
Definition at line 706 of file kern_cons.c.
SYSCTL_INT | ( | _kern | , |
OID_AUTO | , | ||
constty_wakeups_per_second | , | ||
CTLFLAG_RW | , | ||
& | constty_wakeups_per_second, | ||
0 | , | ||
"Times per second to check for pending console tty messages" | |||
) |
|
static |
Definition at line 319 of file kern_cons.c.
References cnadd(), CNDEVPATHMAX, cnremove(), cnselect(), sbuf_clear(), sbuf_data(), sbuf_delete(), sbuf_finish(), sbuf_len(), sbuf_new(), sbuf_printf(), and sysctl_handle_string().
SYSCTL_PROC | ( | _kern | , |
OID_AUTO | , | ||
console | , | ||
CTLTYPE_STRING|CTLFLAG_RW| | CTLFLAG_NEEDGIANT, | ||
0 | , | ||
0 | , | ||
sysctl_kern_console | , | ||
"A" | , | ||
"Console device control" | |||
) |
SYSCTL_STRING | ( | _kern | , |
OID_AUTO | , | ||
vty | , | ||
CTLFLAG_RDTUN| | CTLFLAG_NOFETCH, | ||
vty_name | , | ||
0 | , | ||
"Console vty driver" | |||
) |
SYSCTL_UINT | ( | _kern | , |
OID_AUTO | , | ||
consmsgbuf_size | , | ||
CTLFLAG_RWTUN | , | ||
& | consmsgbuf_size, | ||
0 | , | ||
"Console tty buffer size" | |||
) |
int vty_enabled | ( | unsigned | vty | ) |
Definition at line 723 of file kern_cons.c.
References vty_name, and vty_prefer.
void vty_set_preferred | ( | unsigned | vty | ) |
Definition at line 762 of file kern_cons.c.
References vty_prefer.
|
static |
Definition at line 87 of file kern_cons.c.
Referenced by cnadd(), cnavailable(), and cnremove().
|
static |
Definition at line 569 of file kern_cons.c.
Referenced by constty_set().
|
static |
Definition at line 634 of file kern_cons.c.
Referenced by constty_timeout().
|
static |
Definition at line 718 of file kern_cons.c.
Referenced by vty_enabled().
|
static |
Definition at line 717 of file kern_cons.c.
Referenced by vty_enabled(), and vty_set_preferred().