linux-um archives
 help / color / mirror / Atom feed
From: Gerd Knorr <kraxel@bytesex.org>
To: Jeff Dike <jdike@addtoit.com>,
	uml devel <user-mode-linux-devel@lists.sourceforge.net>
Subject: [uml-devel] [patch] serial console support
Date: Thu, 30 Oct 2003 17:05:00 +0100	[thread overview]
Message-ID: <20031030160500.GC19575@bytesex.org> (raw)
In-Reply-To: <20031030155757.GA19575@bytesex.org>

  Hi,

This patch adds serial console support to the
uml virtual serial lines.

  Gerd

--- a/arch/um/drivers/ssl.c	2003-08-21 15:29:25.000000000 +0200
+++ b/arch/um/drivers/ssl.c	2003-09-11 13:22:03.000000000 +0200
@@ -10,6 +10,7 @@
 #include "linux/major.h"
 #include "linux/mm.h"
 #include "linux/init.h"
+#include "linux/console.h"
 #include "asm/termbits.h"
 #include "asm/irq.h"
 #include "line.h"
@@ -150,6 +151,8 @@
 	case TCSETSW:
 	case TCGETA:
 	case TIOCMGET:
+	case TCSBRK:
+	case TCSBRKP:
 		ret = -ENOIOCTLCMD;
 		break;
 	default:
@@ -213,6 +216,38 @@
  */
 static int ssl_init_done = 0;
 
+static void ssl_console_write(struct console *c, const char *string, 
+			      unsigned len)
+{
+	struct line *line = &serial_lines[c->index];
+
+	if(ssl_init_done)
+		down(&line->sem);
+	console_write_chan(&line->chan_list, string, len);
+	if(ssl_init_done)
+		up(&line->sem);
+}
+
+static struct tty_driver *ssl_console_device(struct console *c, int *index)
+{
+	*index = c->index;
+	return ssl_driver;
+}
+
+static int ssl_console_setup(struct console *co, char *options)
+{
+	return(0);
+}
+
+static struct console ssl_cons = {
+	name:		"ttyS",
+	write:		ssl_console_write,
+	device:		ssl_console_device,
+	setup:		ssl_console_setup,
+	flags:		CON_PRINTBUFFER,
+	index:		-1,
+};
+
 int ssl_init(void)
 {
 	char *new_title;
@@ -228,6 +263,7 @@
 	new_title = add_xterm_umid(opts.xterm_title);
 	if(new_title != NULL) opts.xterm_title = new_title;
 
+	register_console(&ssl_cons);
 	ssl_init_done = 1;
 	return(0);
 }


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  parent reply	other threads:[~2003-10-30 15:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-30 15:57 [uml-devel] [patch] restore do_mmap_pgoff() semantics Gerd Knorr
2003-10-30 16:03 ` [uml-devel] [patch] fixmap fix Gerd Knorr
2003-10-30 16:05 ` Gerd Knorr [this message]
2003-11-08 22:00   ` [uml-devel] Re: [patch] serial console support Jeff Dike
2003-10-30 16:20 ` [uml-devel] [patch] kernel cmd line parser fix Gerd Knorr
2003-10-30 16:29 ` [uml-devel] [patch] change ubd names Gerd Knorr
2003-11-03  2:48   ` Jeff Dike
2003-11-03 16:13     ` Adam Heath
2003-11-03 17:44       ` Jeff Dike
2003-11-03 23:00         ` Adam Heath
2003-11-04  8:37     ` Gerd Knorr

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=20031030160500.GC19575@bytesex.org \
    --to=kraxel@bytesex.org \
    --cc=jdike@addtoit.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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