public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: linux-ia64@vger.kernel.org
Subject: Fix staircase effect on Altix serial console.
Date: Tue, 02 Mar 2004 23:49:20 +0000	[thread overview]
Message-ID: <je1xoa7qtb.fsf@sykes.suse.de> (raw)

Serial console output on Altix didn't convert NL to CRNL.

Andreas.

--- linux-2.6.3/drivers/char/sn_serial.c.~1~	2004-03-02 16:41:09.000000000 +0100
+++ linux-2.6.3/drivers/char/sn_serial.c	2004-03-02 22:51:09.049180364 +0100
@@ -984,6 +984,7 @@ static void
 sn_sal_console_write(struct console *co, const char *s, unsigned count)
 {
 	unsigned long flags;
+	const char *s1;
 
 	BUG_ON(!sn_sal_is_asynch);
 
@@ -991,15 +992,36 @@ sn_sal_console_write(struct console *co,
 	 * oops, kdb, panic, etc.  make sure they get it. */
 	if (spin_is_locked(&sn_sal_lock)) {
 		synch_flush_xmit();
+		/* Output '\r' before each '\n' */
+		while ((s1 = memchr(s, '\n', count)) != NULL) {
+			sn_func->sal_puts(s, s1 - s);
+			sn_func->sal_puts("\r\n", 2);
+			count -= s1 + 1 - s;
+			s = s1 + 1;
+		}
 		sn_func->sal_puts(s, count);
 	}
 	else if (in_interrupt()) {
 		spin_lock_irqsave(&sn_sal_lock, flags);
 		synch_flush_xmit();
 		spin_unlock_irqrestore(&sn_sal_lock, flags);
+		/* Output '\r' before each '\n' */
+		while ((s1 = memchr(s, '\n', count)) != NULL) {
+			sn_func->sal_puts(s, s1 - s);
+			sn_func->sal_puts("\r\n", 2);
+			count -= s1 + 1 - s;
+			s = s1 + 1;
+		}
 		sn_func->sal_puts(s, count);
 	}
 	else
+		/* Output '\r' before each '\n' */
+		while ((s1 = memchr(s, '\n', count)) != NULL) {
+			sn_sal_write(NULL, 0, s, s1 - s);
+			sn_sal_write(NULL, 0, "\r\n", 2);
+			count -= s1 + 1 - s;
+			s = s1 + 1;
+		}
 		sn_sal_write(NULL, 0, s, count);
 }
 

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

             reply	other threads:[~2004-03-02 23:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-02 23:49 Andreas Schwab [this message]
2004-03-03  2:56 ` Fix staircase effect on Altix serial console David Mosberger
2004-03-03  3:31 ` Jesse Barnes
2004-03-03 10:57 ` Andreas Schwab
2004-03-03 12:46 ` Robin Holt
2004-03-03 13:34 ` Andreas Schwab
2004-03-03 13:40 ` Robin Holt
2004-03-03 14:20 ` Andreas Schwab
2004-03-03 15:11 ` Robin Holt
2004-03-03 15:52 ` Andreas Schwab
2004-03-03 17:19 ` Jesse Barnes
2004-03-03 17:27 ` Jesse Barnes
2004-03-03 17:36 ` Andreas Schwab
2004-03-03 20:44 ` Jesse Barnes
2004-03-03 22:21 ` Jesse Barnes
2004-03-03 22:28 ` David Mosberger
2004-03-04 11:02 ` Andreas Schwab

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=je1xoa7qtb.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=linux-ia64@vger.kernel.org \
    /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