diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-02-10 10:06:49 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-02-10 10:06:49 +0000 |
commit | 3173c27d2e8308fe5b249684fca9fd9b7c4e177a (patch) | |
tree | 038a0fd5b3044588d5be669d64be2febf1a8a288 | |
parent | 877e106aa199d66a24388b46599c39a439dc4568 (diff) |
Fix cnprobe() and cninit() prototypes.
Also, provide a better test for bugtty attachment.
-rw-r--r-- | sys/arch/mvme88k/dev/bugtty.c | 33 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/cl.c | 17 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/dart.c | 18 |
3 files changed, 18 insertions, 50 deletions
diff --git a/sys/arch/mvme88k/dev/bugtty.c b/sys/arch/mvme88k/dev/bugtty.c index dc22f0c894d..8f11dd81ddf 100644 --- a/sys/arch/mvme88k/dev/bugtty.c +++ b/sys/arch/mvme88k/dev/bugtty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bugtty.c,v 1.20 2004/01/14 20:50:48 miod Exp $ */ +/* $OpenBSD: bugtty.c,v 1.21 2004/02/10 10:06:48 miod Exp $ */ /* Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1995 Dale Rahn. @@ -45,8 +45,6 @@ #include <mvme88k/dev/bugttyfunc.h> #include "bugtty.h" -#include "cl.h" -#include "dart.h" int bugttymatch(struct device *parent, void *self, void *aux); void bugttyattach(struct device *parent, struct device *self, void *aux); @@ -60,10 +58,7 @@ struct cfdriver bugtty_cd = { }; /* prototypes */ -int bugttycnprobe(struct consdev *cp); -int bugttycninit(struct consdev *cp); -int bugttycngetc(dev_t dev); -void bugttycnputc(dev_t dev, char c); +cons_decl(bugtty); struct tty *bugttytty(dev_t dev); int bugttymctl(dev_t dev, int bits, int how); @@ -91,22 +86,8 @@ bugttymatch(parent, self, aux) /* * Do not attach if a suitable console driver has been attached. */ -#if NCL > 0 - { - extern struct cfdriver cl_cd; - - if (cl_cd.cd_ndevs != 0) - return (0); - } -#endif -#if NDART > 0 - { - extern struct cfdriver dart_cd; - - if (dart_cd.cd_ndevs != 0) - return (0); - } -#endif + if (cn_tab != NULL && cn_tab->cn_probe != bugttycnprobe) + return (0); ca->ca_ipl = IPL_TTY; return (1); @@ -456,7 +437,7 @@ bugttystop(tp, flag) /* * bugtty is the last possible choice for a console device. */ -int +void bugttycnprobe(cp) struct consdev *cp; { @@ -469,15 +450,13 @@ bugttycnprobe(cp) cp->cn_dev = makedev(maj, 0); cp->cn_pri = CN_NORMAL; - return (1); } -int +void bugttycninit(cp) struct consdev *cp; { /* Nothing to do */ - return 0; } int diff --git a/sys/arch/mvme88k/dev/cl.c b/sys/arch/mvme88k/dev/cl.c index 597c2eb1cb0..713e66f638b 100644 --- a/sys/arch/mvme88k/dev/cl.c +++ b/sys/arch/mvme88k/dev/cl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl.c,v 1.37 2004/01/14 20:50:48 miod Exp $ */ +/* $OpenBSD: cl.c,v 1.38 2004/02/10 10:06:48 miod Exp $ */ /* * Copyright (c) 1995 Dale Rahn. All rights reserved. @@ -145,12 +145,8 @@ struct { }; /* prototypes */ -int clcnprobe(struct consdev *cp); -int clcninit(struct consdev *cp); +cons_decl(cl); int cl_instat(struct clsoftc *sc); -int clcngetc(dev_t dev); -void clcnputc(dev_t dev, u_char c); -void clcnpollc(dev_t, int); u_char cl_clkdiv(int speed); u_char cl_clknum(int speed); u_char cl_clkrxtimeout(int speed); @@ -915,7 +911,7 @@ clstop(tp, flag) * pcc2 space and Cirrus chip area. */ -int +void clcnprobe(cp) struct consdev *cp; { @@ -926,7 +922,7 @@ clcnprobe(cp) /* bomb if it'a a MVME188 */ if (brdtyp == BRD_188) { cp->cn_pri = CN_DEAD; - return 0; + return; } /* locate the major number */ for (maj = 0; maj < nchrdev; maj++) @@ -934,11 +930,9 @@ clcnprobe(cp) break; cp->cn_dev = makedev (maj, 0); cp->cn_pri = CN_NORMAL; - - return 1; } -int +void clcninit(cp) struct consdev *cp; { @@ -977,7 +971,6 @@ clcninit(cp) cl_reg->cl_lnxt = 0x00; cl_reg->cl_cpsr = 0x00; #endif - return 0; } int diff --git a/sys/arch/mvme88k/dev/dart.c b/sys/arch/mvme88k/dev/dart.c index 9eb55bb847b..23ef06d271a 100644 --- a/sys/arch/mvme88k/dev/dart.c +++ b/sys/arch/mvme88k/dev/dart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dart.c,v 1.27 2004/01/14 20:50:48 miod Exp $ */ +/* $OpenBSD: dart.c,v 1.28 2004/02/10 10:06:48 miod Exp $ */ /* * Mach Operating System @@ -94,11 +94,9 @@ struct cfdriver dart_cd = { }; int dart_cons = -1; + /* prototypes */ -int dartcnprobe(struct consdev *cp); -int dartcninit(struct consdev *cp); -int dartcngetc(dev_t dev); -void dartcnputc(dev_t dev, char c); +cons_decl(dart); int dart_speed(int); struct tty* darttty(dev_t); void dartstart(struct tty *); @@ -239,7 +237,7 @@ dartattach(parent, self, aux) dart_sv_reg.sv_imr = IIPCHG; if (dart_cons >= 0) { - printf(" console (tty%s) ", dart_cons == 0 ? "a" : "b"); + printf(": console (tty%s) ", dart_cons == 0 ? "a" : "b"); } dprintf(("\ndartattach: resetting port A\n")); @@ -1140,7 +1138,7 @@ dartintr(arg) * supported. */ -int +void dartcnprobe(cp) struct consdev *cp; { @@ -1148,7 +1146,7 @@ dartcnprobe(cp) if (brdtyp != BRD_188) { cp->cn_pri = CN_DEAD; - return 0; + return; } /* locate the major number */ for (maj = 0; maj < nchrdev; maj++) @@ -1157,15 +1155,13 @@ dartcnprobe(cp) cp->cn_dev = makedev(maj, 0); cp->cn_pri = CN_NORMAL; - return (1); } -int +void dartcninit(cp) struct consdev *cp; { dart_cons = A_PORT; - return 0; } void |