From efe2f29e324fd20e0449bcd6dc6dbe4734c2ba94 Mon Sep 17 00:00:00 2001 From: Jason Wessel Date: Thu, 20 May 2010 21:04:26 -0500 Subject: kgdboc,kdb: Allow kdb to work on a non open console port If kdb is open on a serial port that is not actually a console make sure to call the poll routines to emit and receive characters. Signed-off-by: Jason Wessel Acked-by: Martin Hicks --- drivers/serial/kgdboc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'drivers') diff --git a/drivers/serial/kgdboc.c b/drivers/serial/kgdboc.c index ecef6e1a599a..b765ab48dfe7 100644 --- a/drivers/serial/kgdboc.c +++ b/drivers/serial/kgdboc.c @@ -16,6 +16,7 @@ #include #include #include +#include #define MAX_CONFIG_LEN 40 @@ -93,12 +94,14 @@ static int configure_kgdboc(void) int tty_line = 0; int err; char *cptr = config; + struct console *cons; err = kgdboc_option_setup(config); if (err || !strlen(config) || isspace(config[0])) goto noconfig; err = -ENODEV; + kgdboc_io_ops.is_console = 0; kgdb_tty_driver = NULL; if (kgdboc_register_kbd(&cptr)) @@ -108,6 +111,17 @@ static int configure_kgdboc(void) if (!p) goto noconfig; + cons = console_drivers; + while (cons) { + int idx; + if (cons->device && cons->device(cons, &idx) == p && + idx == tty_line) { + kgdboc_io_ops.is_console = 1; + break; + } + cons = cons->next; + } + kgdb_tty_driver = p; kgdb_tty_line = tty_line; -- cgit v1.2.2