public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sachin Sant <sachinp@in.ibm.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: ssant@in.ibm.com
Subject: [RFC] [PATCH] Adding ctrl-o sysrq hack support to 8250 driver
Date: Wed, 30 Nov 2005 16:47:14 +0530	[thread overview]
Message-ID: <438D8A3A.9030400@in.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 196 bytes --]

The following patch will allow a user to use sysrq keys over a serial 
console using the ctrl-o key sequence. This is similar to functionality 
provided by the hvc console drivers on PPC boxes.



[-- Attachment #2: 8250-magic-sysrq-support.patch --]
[-- Type: text/plain, Size: 927 bytes --]

Signed-off-by: Sachin Sant <sachinp@in.ibm.com>

diff -Naurp linux-2.6.14.3/drivers/serial/8250.c linux-2.6.14.3-new/drivers/serial/8250.c
--- linux-2.6.14.3/drivers/serial/8250.c	2005-11-11 11:03:12.000000000 +0530
+++ linux-2.6.14.3-new/drivers/serial/8250.c	2005-11-17 15:12:42.000000000 +0530
@@ -1084,6 +1084,23 @@ 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 */
+		if (ch == '\x0f') {
+			up->port.sysrq = jiffies + HZ*5;
+			goto ignore_char; 
+		}
+		if (up->port.sysrq) {
+			int swallow;
+			spin_unlock(&up->port.lock);
+			swallow = uart_handle_sysrq_char(&up->port, ch, regs);
+			spin_lock(&up->port.lock);
+			if (swallow)
+				goto ignore_char;
+		}
+#endif /* CONFIG_MAGIC_SYSRQ && CONFIG_SERIAL_CORE_CONSOLE */
+
 		flag = TTY_NORMAL;
 		up->port.icount.rx++;
 

             reply	other threads:[~2005-11-30 11:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-30 11:17 Sachin Sant [this message]
2005-11-30 12:12 ` [RFC] [PATCH] Adding ctrl-o sysrq hack support to 8250 driver Arjan van de Ven
2005-11-30 13:04 ` Russell King
2005-12-06  6:48   ` Sachin Sant
2005-12-06 17:16     ` Russell King
2005-12-07  6:31       ` Sachin Sant
2005-12-07 22:22       ` Olaf Hering
2005-12-07 23:39         ` Russell King
2005-12-08 14:58           ` Olaf Hering
  -- strict thread matches above, loose matches on Subject: below --
2005-12-08  1:38 Milton Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=438D8A3A.9030400@in.ibm.com \
    --to=sachinp@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ssant@in.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox