summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authoryokota <yokota@FreeBSD.org>1999-01-07 14:14:24 +0000
committeryokota <yokota@FreeBSD.org>1999-01-07 14:14:24 +0000
commit9625424b5fb4fcb6b1736c570b2cdb8125017e32 (patch)
tree7f60287f9f3401103df2c43566ac702ccc350468 /sys/kern
parentd3a68b2218865fe260aba70f878854dd945b07d4 (diff)
downloadFreeBSD-src-9625424b5fb4fcb6b1736c570b2cdb8125017e32.zip
FreeBSD-src-9625424b5fb4fcb6b1736c570b2cdb8125017e32.tar.gz
Remove a hard-coded table of kernel console I/O functions exported
from sc, vt and sio drivers. Use instead a linker_set to collect them. Staticize ??cngetc(), ??cnputc(), etc functions in sc and vt drivers. We must still have siocngetc() and siocnputc() as globals because they are directly referred to by i386-gdbstub.c :-( Oked by: bde
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/tty_cons.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c
index 6d31e94..581ff3f 100644
--- a/sys/kern/tty_cons.c
+++ b/sys/kern/tty_cons.c
@@ -57,23 +57,6 @@
#include <machine/cpu.h>
#include <machine/cons.h>
-/* XXX this should be config(8)ed. */
-#include "sc.h"
-#include "vt.h"
-#include "sio.h"
-static struct consdev constab[] = {
-#if NSC > 0
- { sccnprobe, sccninit, sccngetc, sccncheckc, sccnputc },
-#endif
-#if NVT > 0
- { pccnprobe, pccninit, pccngetc, pccncheckc, pccnputc },
-#endif
-#if NSIO > 0
- { siocnprobe, siocninit, siocngetc, siocncheckc, siocnputc },
-#endif
- { 0 },
-};
-
static d_open_t cnopen;
static d_close_t cnclose;
static d_read_t cnread;
@@ -112,16 +95,22 @@ static struct tty *cn_tp; /* physical console tty struct */
static void *cn_devfs_token; /* represents the devfs entry */
#endif /* DEVFS */
+CONS_DRIVER(cons, NULL, NULL, NULL, NULL, NULL);
+
void
cninit()
{
struct consdev *best_cp, *cp;
+ struct consdev **list;
/*
* Find the first console with the highest priority.
*/
best_cp = NULL;
- for (cp = constab; cp->cn_probe; cp++) {
+ list = (struct consdev **)cons_set.ls_items;
+ while ((cp = *list++) != NULL) {
+ if (cp->cn_probe == NULL)
+ continue;
(*cp->cn_probe)(cp);
if (cp->cn_pri > CN_DEAD &&
(best_cp == NULL || cp->cn_pri > best_cp->cn_pri))
OpenPOWER on IntegriCloud