diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2002-09-23 18:43:19 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2002-09-23 18:43:19 +0000 |
commit | a27c3bfb591614d166e9161fe822568953152fea (patch) | |
tree | 792f3a3d444c2e0ed0d53e381179281180e32403 /sys/arch/sparc64 | |
parent | 0259272f21226e13e836a71b25c2c7ee55f532da (diff) |
Fix console determination; based on discussion in port-sparc64@netbsd
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r-- | sys/arch/sparc64/dev/sab.c | 14 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/zs.c | 19 |
2 files changed, 17 insertions, 16 deletions
diff --git a/sys/arch/sparc64/dev/sab.c b/sys/arch/sparc64/dev/sab.c index 1ad3e9ed446..3989e80ccf4 100644 --- a/sys/arch/sparc64/dev/sab.c +++ b/sys/arch/sparc64/dev/sab.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sab.c,v 1.8 2002/07/18 02:22:19 jason Exp $ */ +/* $OpenBSD: sab.c,v 1.9 2002/09/23 18:43:18 jason Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -1295,21 +1295,21 @@ sabtty_console_flags(sc) struct sabtty_softc *sc; { int node, channel, cookie; - u_int chosen; + u_int options; char buf[255]; node = sc->sc_parent->sc_node; channel = sc->sc_portno; - chosen = OF_finddevice("/chosen"); + options = OF_finddevice("/options"); /* Default to channel 0 if there are no explicit prom args */ cookie = 0; if (node == OF_instance_to_package(OF_stdin())) { - if (OF_getprop(chosen, "input-device", buf, + if (OF_getprop(options, "input-device", buf, sizeof(buf)) != -1) { - if (strcmp("ttyb", buf) == 0) + if (strncmp("ttyb", buf, strlen("ttyb")) == 0) cookie = 1; } @@ -1320,9 +1320,9 @@ sabtty_console_flags(sc) /* Default to same channel if there are no explicit prom args */ if (node == OF_instance_to_package(OF_stdout())) { - if (OF_getprop(chosen, "output-device", buf, + if (OF_getprop(options, "output-device", buf, sizeof(buf)) != -1) { - if (strcmp("ttyb", buf) == 0) + if (strncmp("ttyb", buf, strlen("ttyb")) == 0) cookie = 1; } diff --git a/sys/arch/sparc64/dev/zs.c b/sys/arch/sparc64/dev/zs.c index 4a26da86fc6..87e2a27dd1f 100644 --- a/sys/arch/sparc64/dev/zs.c +++ b/sys/arch/sparc64/dev/zs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zs.c,v 1.9 2002/03/14 01:26:45 millert Exp $ */ +/* $OpenBSD: zs.c,v 1.10 2002/09/23 18:43:18 jason Exp $ */ /* $NetBSD: zs.c,v 1.29 2001/05/30 15:24:24 lukem Exp $ */ /*- @@ -808,21 +808,22 @@ zs_console_flags(promunit, node, channel) int channel; { int cookie, flags = 0; - u_int chosen; + u_int options; char buf[255]; /* * We'll just to the OBP grovelling down here since that's * the only type of firmware we support. */ - chosen = OF_finddevice("/chosen"); + options = OF_finddevice("/options"); /* Default to channel 0 if there are no explicit prom args */ cookie = 0; - if (node == OF_instance_to_package(OF_stdin())) { - if (OF_getprop(chosen, "input-device", buf, sizeof(buf)) != -1) { - if (!strcmp("ttyb", buf)) + if (node == OF_instance_to_package(OF_stdin())) { + if (OF_getprop(options, "input-device", + buf, sizeof(buf)) != -1) { + if (strncmp("ttyb", buf, strlen("ttyb")) == 0) cookie = 1; } @@ -831,9 +832,9 @@ zs_console_flags(promunit, node, channel) } if (node == OF_instance_to_package(OF_stdout())) { - if (OF_getprop(chosen, "output-device", buf, sizeof(buf)) != -1) { - - if (!strcmp("ttyb", buf)) + if (OF_getprop(options, "output-device", + buf, sizeof(buf)) != -1) { + if (strncmp("ttyb", buf, strlen("ttyb")) == 0) cookie = 1; } |