From bfc95aff2c09d9d96369a6adbb88af800afdcbd1 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Mon, 19 Dec 2016 14:02:15 +0200 Subject: [PATCH] =?utf8?q?7677=20kmdb:=20intel=20system=20console=20value?= =?utf8?q?=20can=20not=20be=20screen=20Reviewed=20by:=20Yuri=20Pankov=20=20Reviewed=20by:=20Adam=20=C5=A0tevko=20=20Approved=20by:=20Hans=20Rosenfeld=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- usr/src/cmd/mdb/intel/kmdb/kmdb_promif_isadep.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/usr/src/cmd/mdb/intel/kmdb/kmdb_promif_isadep.c b/usr/src/cmd/mdb/intel/kmdb/kmdb_promif_isadep.c index 87057ec15c..e1dfeadef0 100644 --- a/usr/src/cmd/mdb/intel/kmdb/kmdb_promif_isadep.c +++ b/usr/src/cmd/mdb/intel/kmdb/kmdb_promif_isadep.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * "PROM" interface */ @@ -84,18 +82,31 @@ kmdb_prom_free_ddi_prop(char *val) { } +/* + * This function is actually about checking if we are using + * local console versus serial console. Serial console can be named + * "ttyX" where X is [a-d], or "usb-serial". + */ int kmdb_prom_stdout_is_framebuffer(kmdb_auxv_t *kav) { char *dev; /* - * We can't use the official promif version, as we need to ensure that - * property lookups come from our property cache. + * The property "output-device" value is set in property cache, and + * is based on either "output-device" or "console" properties from + * the actual system. We can't use the official promif version, as we + * need to ensure that property lookups come from our property cache. */ if ((dev = kmdb_prom_get_ddi_prop(kav, "output-device")) == NULL) return (0); - return (strcmp(dev, "screen") == 0); + if (strncmp(dev, "tty", 3) == 0) + return (0); + if (strcmp(dev, "usb-serial") == 0) + return (0); + + /* Anything else is classified as local console. */ + return (1); } -- 2.11.4.GIT