summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_clist.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/subr_clist.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/subr_clist.c')
-rw-r--r--sys/kern/subr_clist.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/subr_clist.c b/sys/kern/subr_clist.c
index 5b53efa..57225db 100644
--- a/sys/kern/subr_clist.c
+++ b/sys/kern/subr_clist.c
@@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$");
static void clist_init(void *);
SYSINIT(clist, SI_SUB_CLIST, SI_ORDER_FIRST, clist_init, NULL);
+static MALLOC_DEFINE(M_CLIST, "clist", "clist queue blocks");
+
static struct cblock *cfreelist = 0;
int cfreecount = 0;
static int cslushcount;
@@ -133,11 +135,11 @@ cblock_alloc_cblocks(number)
struct cblock *cbp;
for (i = 0; i < number; ++i) {
- cbp = malloc(sizeof *cbp, M_TTYS, M_NOWAIT);
+ cbp = malloc(sizeof *cbp, M_CLIST, M_NOWAIT);
if (cbp == NULL) {
printf(
"cblock_alloc_cblocks: M_NOWAIT malloc failed, trying M_WAITOK\n");
- cbp = malloc(sizeof *cbp, M_TTYS, M_WAITOK);
+ cbp = malloc(sizeof *cbp, M_CLIST, M_WAITOK);
}
/*
* Freed cblocks have zero quotes and garbage elsewhere.
@@ -192,7 +194,7 @@ cblock_free_cblocks(number)
int i;
for (i = 0; i < number; ++i)
- free(cblock_alloc(), M_TTYS);
+ free(cblock_alloc(), M_CLIST);
ctotcount -= number;
}
OpenPOWER on IntegriCloud