aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2004-10-12 21:23:33 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2004-10-12 21:23:33 +0000
commitc5c5a2ad8a2b91bedc88237adfbe17a88efb873c (patch)
tree0d3d164502b02864cab1cb33e0dabbcde27cd6c4 /sys/dev
parentfbbec42fe4e7423e40958ec1db79258610a11631 (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ofw/ofw_console.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/dev/ofw/ofw_console.c b/sys/dev/ofw/ofw_console.c
index 5b3b2854434ee..22bed0f28ce99 100644
--- a/sys/dev/ofw/ofw_console.c
+++ b/sys/dev/ofw/ofw_console.c
@@ -95,6 +95,10 @@ cn_drvinit(void *unused)
OF_getprop(options, "output-device", output,
sizeof(output)) == -1)
return;
+ /*
+ * XXX: This is a hack and it may result in two /dev/ttya
+ * XXX: devices on platforms where the sab driver works.
+ */
dev = make_dev(&ofw_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "%s",
output);
make_dev_alias(dev, "ofwcons");
@@ -117,7 +121,15 @@ ofw_dev_open(struct cdev *dev, int flag, int mode, struct thread *td)
setuptimeout = 0;
unit = minor(dev);
- tp = ofw_tp = dev->si_tty = ttymalloc(ofw_tp);
+ /*
+ * XXX: BAD, should happen at attach time
+ */
+ if (dev->si_tty == NULL) {
+ ofw_tp = ttyalloc();
+ dev->si_tty = ofw_tp;
+ ofw_tp->t_dev = dev;
+ }
+ tp = dev->si_tty;
tp->t_oproc = ofw_tty_start;
tp->t_param = ofw_tty_param;
@@ -160,7 +172,7 @@ ofw_dev_close(struct cdev *dev, int flag, int mode, struct thread *td)
struct tty *tp;
unit = minor(dev);
- tp = ofw_tp;
+ tp = dev->si_tty;
if (unit != 0) {
return (ENXIO);