Re: [RFC] [PATCH] Adding ctrl-o sysrq hack support to 8250 driver

From: Olaf Hering
Date: Thu Dec 08 2005 - 09:57:41 EST


On Wed, Dec 07, Russell King wrote:

> Easily. Have a look at the internals of uart_handle_break() in
> include/linux/serial_core.h

This one works for me, tested with 2.6.5.


drivers/serial/8250.c | 7 +++++++
1 files changed, 7 insertions(+)

Index: linux-2.6.15-rc5-olh/drivers/serial/8250.c
===================================================================
--- linux-2.6.15-rc5-olh.orig/drivers/serial/8250.c
+++ linux-2.6.15-rc5-olh/drivers/serial/8250.c
@@ -1154,6 +1154,13 @@ receive_chars(struct uart_8250_port *up,
*/
}
ch = serial_inp(up, UART_RX);
+
+#if defined(CONFIG_MAGIC_SYSRQ) && defined(CONFIG_SERIAL_CORE_CONSOLE)
+ /* Handle the SysRq ^O Hack, but only on the system console */
+ if (ch == '\x0f' && uart_handle_break(&up->port))
+ goto ignore_char;
+#endif
+
flag = TTY_NORMAL;
up->port.icount.rx++;


--
short story of a lazy sysadmin:
alias appserv=wotan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/