From 80f5eea8b80041c3a77fe94091282399c0ac9ff2 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Thu, 29 Jan 2009 15:06:40 +0000 Subject: [PATCH] If serial debugging in the boot monitor / kernel is enabled, don't touch the serial line in use for it (mostly so that input isn't eaten by tty). --- drivers/tty/rs232.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/tty/rs232.c b/drivers/tty/rs232.c index 8bc70599f..aed377b25 100644 --- a/drivers/tty/rs232.c +++ b/drivers/tty/rs232.c @@ -445,9 +445,19 @@ tty_t *tp; /* which TTY */ int line; port_t this_8250; int irq; + char l[10]; /* Associate RS232 and TTY structures. */ line = tp - &tty_table[NR_CONS]; + + /* See if kernel debugging is enabled; if so, don't initialize this + * serial line, making tty not look at the irq and returning ENXIO + * for all requests on it from userland. (The kernel will use it.) + */ + if(env_get_param(SERVARNAME, l, sizeof(l)-1) == OK && atoi(l) == line) { + return; + } + rs = tp->tty_priv = &rs_lines[line]; rs->tty = tp; -- 2.44.0