summaryrefslogtreecommitdiffstats
path: root/sys/sys/cons.h
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/sys/cons.h
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/sys/cons.h')
-rw-r--r--sys/sys/cons.h33
1 files changed, 8 insertions, 25 deletions
diff --git a/sys/sys/cons.h b/sys/sys/cons.h
index 76bc073..5d6c426 100644
--- a/sys/sys/cons.h
+++ b/sys/sys/cons.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.h 7.2 (Berkeley) 5/9/91
- * $Id: cons.h,v 1.16 1997/04/01 16:13:31 bde Exp $
+ * $Id: cons.h,v 1.17 1997/07/01 00:54:37 bde Exp $
*/
#ifndef _MACHINE_CONS_H_
@@ -49,30 +49,6 @@ typedef int cn_getc_t __P((dev_t));
typedef int cn_checkc_t __P((dev_t));
typedef void cn_putc_t __P((dev_t, int));
-#ifdef KERNEL
-/*
- * XXX public functions in drivers should be declared in headers produced
- * by `config', not here.
- */
-cn_probe_t pccnprobe;
-cn_init_t pccninit;
-cn_getc_t pccngetc;
-cn_checkc_t pccncheckc;
-cn_putc_t pccnputc;
-
-cn_probe_t sccnprobe;
-cn_init_t sccninit;
-cn_getc_t sccngetc;
-cn_checkc_t sccncheckc;
-cn_putc_t sccnputc;
-
-cn_probe_t siocnprobe;
-cn_init_t siocninit;
-cn_getc_t siocngetc;
-cn_checkc_t siocncheckc;
-cn_putc_t siocnputc;
-#endif /* KERNEL */
-
struct consdev {
cn_probe_t *cn_probe;
/* probe hardware and fill in consdev info */
@@ -96,8 +72,15 @@ struct consdev {
#define CN_REMOTE 3 /* serial interface with remote bit set */
#ifdef KERNEL
+extern struct linker_set cons_set;
extern int cons_unavail;
+#define CONS_DRIVER(name, probe, init, getc, checkc, putc) \
+ static struct consdev name##_consdev = { \
+ probe, init, getc, checkc, putc \
+ }; \
+ DATA_SET(cons_set, name##_consdev);
+
/* Other kernel entry points. */
int cncheckc __P((void));
int cngetc __P((void));
OpenPOWER on IntegriCloud