summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_cons.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2008-05-23 16:06:35 +0000
committered <ed@FreeBSD.org>2008-05-23 16:06:35 +0000
commitbdc5be605fed4eb12994b4b1324963a5527e8bd8 (patch)
tree45dcbc030933869fb3a8e3fe224f3cbe1488ad22 /sys/kern/tty_cons.c
parent82e712d5edb03f4ce70cf2a4e76084b692dc32cd (diff)
downloadFreeBSD-src-bdc5be605fed4eb12994b4b1324963a5527e8bd8.zip
FreeBSD-src-bdc5be605fed4eb12994b4b1324963a5527e8bd8.tar.gz
Move TTY unrelated bits out of <sys/tty.h>.
For some reason, the <sys/tty.h> header file also contains routines of the clists and console that are used inside the TTY layer. Because the clists are not only used by the TTY layer (example: various input drivers), we'd better move the entire clist programming interface into <sys/clist.h>. Also remove a declaration of nonexistent variable. The <sys/tty.h> header also contains various definitions for the console code (tty_cons.c). Also move these to <sys/cons.h>, because they are not implemented inside the TTY layer. While there, create separate malloc pools for the clist and console code. Approved by: philip (mentor)
Diffstat (limited to 'sys/kern/tty_cons.c')
-rw-r--r--sys/kern/tty_cons.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c
index 99f6f51..ff57d82 100644
--- a/sys/kern/tty_cons.c
+++ b/sys/kern/tty_cons.c
@@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$");
#include <machine/cpu.h>
#include <machine/clock.h>
+static MALLOC_DEFINE(M_TTYCONS, "tty console", "tty console handling");
+
static d_open_t cnopen;
static d_close_t cnclose;
static d_read_t cnread;
@@ -673,7 +675,7 @@ constty_set(struct tty *tp)
KASSERT(tp != NULL, ("constty_set: NULL tp"));
if (consbuf == NULL) {
size = consmsgbuf_size;
- consbuf = malloc(size, M_TTYS, M_WAITOK);
+ consbuf = malloc(size, M_TTYCONS, M_WAITOK);
msgbuf_init(&consmsgbuf, consbuf, size);
callout_init(&conscallout, 0);
}
@@ -695,7 +697,7 @@ constty_clear(void)
callout_stop(&conscallout);
while ((c = msgbuf_getchar(&consmsgbuf)) != -1)
cnputc(c);
- free(consbuf, M_TTYS);
+ free(consbuf, M_TTYCONS);
consbuf = NULL;
}
OpenPOWER on IntegriCloud