summaryrefslogtreecommitdiff
path: root/sys/dev/ofw
diff options
context:
space:
mode:
authorJake Burkholder <jake@FreeBSD.org>2002-11-18 06:19:12 +0000
committerJake Burkholder <jake@FreeBSD.org>2002-11-18 06:19:12 +0000
commita121cb6a7f087bdd7ca15eb6f3c7aba6caabace3 (patch)
tree5ad38abd783623fc32aab1b7b44a042a4daeea5d /sys/dev/ofw
parent5f07565bcb5145794a2e1b653bf011c61e575d2d (diff)
Notes
Diffstat (limited to 'sys/dev/ofw')
-rw-r--r--sys/dev/ofw/ofw_console.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/dev/ofw/ofw_console.c b/sys/dev/ofw/ofw_console.c
index cce7fb884498..aebc10944666 100644
--- a/sys/dev/ofw/ofw_console.c
+++ b/sys/dev/ofw/ofw_console.c
@@ -85,11 +85,20 @@ CONS_DRIVER(ofw, ofw_cons_probe, ofw_cons_init, NULL, ofw_cons_getc,
static void
cn_drvinit(void *unused)
{
+ phandle_t options;
+ char output[32];
- make_dev(&ofw_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "ofwcons");
+ if (ofw_consdev.cn_dev != NULL) {
+ if ((options = OF_finddevice("/options")) == -1 ||
+ OF_getprop(options, "output-device", output,
+ sizeof(output)) == -1)
+ return;
+ make_dev(&ofw_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "ofwcons");
+ make_dev_alias(ofw_consdev.cn_dev, "%s", output);
+ }
}
-SYSINIT(cndev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,cn_drvinit,NULL)
+SYSINIT(cndev, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE + CDEV_MAJOR, cn_drvinit, NULL)
static int stdin;
static int stdout;
@@ -260,16 +269,16 @@ ofw_cons_probe(struct consdev *cp)
return;
}
- cp->cn_dev = makedev(CDEV_MAJOR, 0);
+ cp->cn_dev = NULL;
cp->cn_pri = CN_INTERNAL;
- cp->cn_tp = ofw_tp;
}
static void
ofw_cons_init(struct consdev *cp)
{
- return;
+ cp->cn_dev = makedev(CDEV_MAJOR, 0);
+ cp->cn_tp = ofw_tp;
}
static int