summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2001-08-21 01:55:51 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2001-08-21 01:55:51 +0000
commit260ae6b22c01c84aeca055debf59ef6a05b455e1 (patch)
treea60e91436ab96f288073040d540814e8bf6e29a2 /sys/dev
parent96e304e16630db19ba3eda61564cb88f58f4ce8b (diff)
Prototype correctly so this builds with -Wstrict-prototypes.
DEstatic some of the code, add a ofprint() function for printf like debugging early on in boot (before console). Not currently used, except in special debugging kernels.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ofw/ofcons.c49
1 files changed, 45 insertions, 4 deletions
diff --git a/sys/dev/ofw/ofcons.c b/sys/dev/ofw/ofcons.c
index 28e0195eedd..48f9a21571a 100644
--- a/sys/dev/ofw/ofcons.c
+++ b/sys/dev/ofw/ofcons.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ofcons.c,v 1.5 2001/08/08 21:49:15 miod Exp $ */
+/* $OpenBSD: ofcons.c,v 1.6 2001/08/21 01:55:50 drahn Exp $ */
/* $NetBSD: ofcons.c,v 1.3 1996/10/13 01:38:11 christos Exp $ */
/*
@@ -43,6 +43,8 @@
#include <dev/ofw/openfirm.h>
+#include <machine/stdarg.h>
+
struct ofc_softc {
struct device of_dev;
struct tty *of_tty;
@@ -98,6 +100,26 @@ ofcattach(parent, self, aux)
printf("\n");
}
+void ofcstart __P((struct tty *));
+int ofcparam __P((struct tty *, struct termios *));
+void ofcpoll __P((void *));
+int ofcopen(dev_t dev, int flag, int mode, struct proc *p);
+int ofcclose(dev_t dev, int flag, int mode, struct proc *p);
+int ofcread(dev_t dev, struct uio *uio, int flag);
+int ofcwrite(dev_t dev, struct uio *uio, int flag);
+int ofcioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p);
+struct tty * ofctty(dev_t dev);
+void ofcstop(struct tty *tp, int flag);
+void ofcstart(struct tty *tp);
+int ofcparam(struct tty *tp, struct termios *t);
+void ofcpoll(void *aux);
+void ofccnprobe(struct consdev *cd);
+void ofccninit(struct consdev *cd);
+int ofccngetc(dev_t dev);
+void ofccnputc(dev_t dev, int c);
+void ofccnpollc(dev_t dev, int on);
+void ofprintf(char *fmt, ...);
+
int
ofcopen(dev, flag, mode, p)
dev_t dev;
@@ -215,7 +237,7 @@ ofcstop(tp, flag)
{
}
-static void
+void
ofcstart(tp)
struct tty *tp;
{
@@ -249,7 +271,7 @@ ofcstart(tp)
splx(s);
}
-static int
+int
ofcparam(tp, t)
struct tty *tp;
struct termios *t;
@@ -260,7 +282,7 @@ ofcparam(tp, t)
return 0;
}
-static void
+void
ofcpoll(aux)
void *aux;
{
@@ -361,3 +383,22 @@ ofccnpollc(dev, on)
}
}
}
+static char buf[1024];
+
+void
+ofprintf(char *fmt, ...)
+{
+ char *c;
+ va_list ap;
+
+ va_start(ap, fmt);
+
+ vsprintf(buf, fmt, ap);
+
+ c = buf;
+ while (*c != '\0') {
+ ofccnputc(0, *c);
+ }
+
+ va_end(ap);
+}