summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-04-23 12:55:55 +0000
committerbde <bde@FreeBSD.org>1995-04-23 12:55:55 +0000
commit6ae9ef4d08954121a0bf8c2f27baf60331321098 (patch)
treee53aef4e5ab9f0fbc21e4d19d56e0f1b633724cb
parentbca0e031b5a4429f50cddea14a935e7bd480f9d0 (diff)
downloadFreeBSD-src-6ae9ef4d08954121a0bf8c2f27baf60331321098.zip
FreeBSD-src-6ae9ef4d08954121a0bf8c2f27baf60331321098.tar.gz
Declare the console switch functions completely.
Move declarations of console functions to cons.h (they should be config(8)ed).
-rw-r--r--sys/i386/i386/cons.c16
-rw-r--r--sys/i386/i386/cons.h49
-rw-r--r--sys/kern/tty_cons.c16
-rw-r--r--sys/sys/cons.h49
4 files changed, 88 insertions, 42 deletions
diff --git a/sys/i386/i386/cons.c b/sys/i386/i386/cons.c
index 13cf848..44d1384 100644
--- a/sys/i386/i386/cons.c
+++ b/sys/i386/i386/cons.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
- * $Id: cons.c,v 1.24 1995/04/02 16:14:51 joerg Exp $
+ * $Id: cons.c,v 1.25 1995/04/08 21:31:51 joerg Exp $
*/
#include <sys/param.h>
@@ -48,18 +48,7 @@
#include <machine/cons.h>
#include <machine/stdarg.h>
-/* XXX - all this could be autoconfig()ed */
-#include "sc.h"
-#include "vt.h"
-#if NSC > 0 || NVT > 0
-int pccnprobe(), pccninit(), pccngetc(), pccncheckc(), pccnputc();
-#endif
-
-#include "sio.h"
-#if NSIO > 0
-int siocnprobe(), siocninit(), siocngetc(), siocncheckc(), siocnputc();
-#endif
-
+/* XXX this should be config(8)ed. */
static struct consdev constab[] = {
#if NSC > 0 || NVT > 0
{ pccnprobe, pccninit, pccngetc, pccncheckc, pccnputc },
@@ -69,7 +58,6 @@ static struct consdev constab[] = {
#endif
{ 0 },
};
-/* end XXX */
struct tty *constty = 0; /* virtual console output device */
struct tty *cn_tty; /* XXX: console tty struct for tprintf */
diff --git a/sys/i386/i386/cons.h b/sys/i386/i386/cons.h
index ded55d8..672cad5 100644
--- a/sys/i386/i386/cons.h
+++ b/sys/i386/i386/cons.h
@@ -36,18 +36,53 @@
* SUCH DAMAGE.
*
* from: @(#)cons.h 7.2 (Berkeley) 5/9/91
- * $Id: cons.h,v 1.6 1994/10/20 00:07:46 phk Exp $
+ * $Id: cons.h,v 1.7 1995/04/08 21:31:53 joerg Exp $
*/
#ifndef _MACHINE_CONS_H_
#define _MACHINE_CONS_H_ 1
+struct consdev;
+typedef void cn_probe_t __P((struct consdev *));
+typedef void cn_init_t __P((struct consdev *));
+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));
+
+/*
+ * XXX public functions in drivers should be declared in headers produced
+ * by `config', not here.
+ */
+#include "sc.h"
+#include "vt.h"
+#if NSC > 0 || NVT > 0
+cn_probe_t pccnprobe;
+cn_init_t pccninit;
+cn_getc_t pccngetc;
+cn_checkc_t pccncheckc;
+cn_putc_t pccnputc;
+#endif
+
+#include "sio.h"
+#if NSIO > 0
+cn_probe_t siocnprobe;
+cn_init_t siocninit;
+cn_getc_t siocngetc;
+cn_checkc_t siocncheckc;
+cn_putc_t siocnputc;
+#endif
+
struct consdev {
- int (*cn_probe)(); /* probe hardware and fill in consdev info */
- int (*cn_init)(); /* turn on as console */
- int (*cn_getc)(); /* kernel getchar interface */
- int (*cn_checkc)(); /* kernel "return char if available" interface */
- int (*cn_putc)(); /* kernel putchar interface */
+ cn_probe_t *cn_probe;
+ /* probe hardware and fill in consdev info */
+ cn_init_t *cn_init;
+ /* turn on as console */
+ cn_getc_t *cn_getc;
+ /* kernel getchar interface */
+ cn_checkc_t *cn_checkc;
+ /* kernel "return char if available" interface */
+ cn_putc_t *cn_putc;
+ /* kernel putchar interface */
struct tty *cn_tp; /* tty structure for console device */
dev_t cn_dev; /* major/minor of device */
short cn_pri; /* pecking order; the higher the better */
@@ -82,7 +117,7 @@ extern int cnselect(dev_t, int, struct proc *);
extern void cninit(void);
extern int cngetc(void);
extern int cncheckc(void);
-extern void cnputc(int /*char*/);
+extern void cnputc(int);
extern int pg(const char *, ...);
#endif /* KERNEL */
diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c
index 13cf848..44d1384 100644
--- a/sys/kern/tty_cons.c
+++ b/sys/kern/tty_cons.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
- * $Id: cons.c,v 1.24 1995/04/02 16:14:51 joerg Exp $
+ * $Id: cons.c,v 1.25 1995/04/08 21:31:51 joerg Exp $
*/
#include <sys/param.h>
@@ -48,18 +48,7 @@
#include <machine/cons.h>
#include <machine/stdarg.h>
-/* XXX - all this could be autoconfig()ed */
-#include "sc.h"
-#include "vt.h"
-#if NSC > 0 || NVT > 0
-int pccnprobe(), pccninit(), pccngetc(), pccncheckc(), pccnputc();
-#endif
-
-#include "sio.h"
-#if NSIO > 0
-int siocnprobe(), siocninit(), siocngetc(), siocncheckc(), siocnputc();
-#endif
-
+/* XXX this should be config(8)ed. */
static struct consdev constab[] = {
#if NSC > 0 || NVT > 0
{ pccnprobe, pccninit, pccngetc, pccncheckc, pccnputc },
@@ -69,7 +58,6 @@ static struct consdev constab[] = {
#endif
{ 0 },
};
-/* end XXX */
struct tty *constty = 0; /* virtual console output device */
struct tty *cn_tty; /* XXX: console tty struct for tprintf */
diff --git a/sys/sys/cons.h b/sys/sys/cons.h
index ded55d8..672cad5 100644
--- a/sys/sys/cons.h
+++ b/sys/sys/cons.h
@@ -36,18 +36,53 @@
* SUCH DAMAGE.
*
* from: @(#)cons.h 7.2 (Berkeley) 5/9/91
- * $Id: cons.h,v 1.6 1994/10/20 00:07:46 phk Exp $
+ * $Id: cons.h,v 1.7 1995/04/08 21:31:53 joerg Exp $
*/
#ifndef _MACHINE_CONS_H_
#define _MACHINE_CONS_H_ 1
+struct consdev;
+typedef void cn_probe_t __P((struct consdev *));
+typedef void cn_init_t __P((struct consdev *));
+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));
+
+/*
+ * XXX public functions in drivers should be declared in headers produced
+ * by `config', not here.
+ */
+#include "sc.h"
+#include "vt.h"
+#if NSC > 0 || NVT > 0
+cn_probe_t pccnprobe;
+cn_init_t pccninit;
+cn_getc_t pccngetc;
+cn_checkc_t pccncheckc;
+cn_putc_t pccnputc;
+#endif
+
+#include "sio.h"
+#if NSIO > 0
+cn_probe_t siocnprobe;
+cn_init_t siocninit;
+cn_getc_t siocngetc;
+cn_checkc_t siocncheckc;
+cn_putc_t siocnputc;
+#endif
+
struct consdev {
- int (*cn_probe)(); /* probe hardware and fill in consdev info */
- int (*cn_init)(); /* turn on as console */
- int (*cn_getc)(); /* kernel getchar interface */
- int (*cn_checkc)(); /* kernel "return char if available" interface */
- int (*cn_putc)(); /* kernel putchar interface */
+ cn_probe_t *cn_probe;
+ /* probe hardware and fill in consdev info */
+ cn_init_t *cn_init;
+ /* turn on as console */
+ cn_getc_t *cn_getc;
+ /* kernel getchar interface */
+ cn_checkc_t *cn_checkc;
+ /* kernel "return char if available" interface */
+ cn_putc_t *cn_putc;
+ /* kernel putchar interface */
struct tty *cn_tp; /* tty structure for console device */
dev_t cn_dev; /* major/minor of device */
short cn_pri; /* pecking order; the higher the better */
@@ -82,7 +117,7 @@ extern int cnselect(dev_t, int, struct proc *);
extern void cninit(void);
extern int cngetc(void);
extern int cncheckc(void);
-extern void cnputc(int /*char*/);
+extern void cnputc(int);
extern int pg(const char *, ...);
#endif /* KERNEL */
OpenPOWER on IntegriCloud