From: Blaisorblade <blaisorblade@yahoo.it>
To: Gerd Knorr <kraxel@bytesex.org>
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] Re: Fw: [patch] uml: terminal cleanup
Date: Sat, 5 Mar 2005 18:58:04 +0100 [thread overview]
Message-ID: <200503051858.05050.blaisorblade@yahoo.it> (raw)
In-Reply-To: <20041128010910.1b5478c7.akpm@osdl.org>
On Sunday 28 November 2004 10:09, Andrew Morton wrote:
> Date: Wed, 24 Nov 2004 19:53:41 +0100
> From: Gerd Knorr <kraxel@bytesex.org>
> To: Andrew Morton <akpm@osdl.org>, Linux Kernel Mailing List
> <linux-kernel@vger.kernel.org>, uml devel
> <user-mode-linux-devel@lists.sourceforge.net> Subject: [patch] uml:
> terminal cleanup
> Hi,
>
> This is a major cleanup of the uml terminal drivers and console handling
> (console as in "where the kernel messages go to", not as in "linux
> virtual terminals"). The changes in detail:
> (2) Ditched the early-console-init hackery in stdio_console.c
> (open_console(NULL) + related stuff) into the waste basket, not
> needed any more as you can use the new stderr console driver to
> get the kernel messages if your kernel crashes very early in the
> boot process.
>
> (3) Handle console initialitation for the uml stdio console and
> virtual serial lines the normal way using the console->setup()
> function. Now all kernel messages appear on your console device
> once it is initialized without any dirty tricks.
> Index: linux-2004-11-23/arch/um/drivers/chan_user.c
> ===================================================================
> --- linux-2004-11-23.orig/arch/um/drivers/chan_user.c 2004-11-24
> 12:50:38.560153813 +0100 +++
> linux-2004-11-23/arch/um/drivers/chan_user.c 2004-11-24 18:15:00.027153605
> +0100 @@ -110,7 +110,7 @@ static int winch_thread(void *arg)
> }
> }
>
> -static int winch_tramp(int fd, void *device_data, int *fd_out)
> +static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out)
> {
> struct winch_data data;
> unsigned long stack;
> @@ -144,7 +144,7 @@ static int winch_tramp(int fd, void *dev
> return(pid);
> }
>
> -void register_winch(int fd, void *device_data)
> +void register_winch(int fd, struct tty_struct *tty)
> {
> int pid, thread, thread_fd;
> int count;
Hmm, I saw you have put a forward declaration of struct tty_struct, however it
does not seem nice anyway... I don't think that using void* is nice either,
but both things have pitfalls.
> -void line_close(struct line *lines, struct tty_struct *tty)
> +void line_close(struct tty_struct *tty, struct file * filp)
> {
> - struct line *line;
> - int n;
> -
> - if(tty == NULL) n = 0;
> - else n = tty->index;
> - line = &lines[n];
> + struct line *line = tty->driver_data;
>
> down(&line->sem);
> line->count--;
> -
> - /* I don't like this, but I can't think of anything better. What's
> - * going on is that the tty is in the process of being closed for
> - * the last time. Its count hasn't been dropped yet, so it's still
> - * at 1. This may happen when line->count != 0 because of the initial
> - * console open (without a tty) bumping it up to 1.
> - */
> - if((line->tty != NULL) && (line->tty->count == 1))
> - line->tty = NULL;
> - if(line->count == 0)
> - line_disable(line, -1);
> + if (tty->count == 1) {
> + line_disable(tty, -1);
> + tty->driver_data = NULL;
> + }
> up(&line->sem);
> }
Why did you delete this comment? I don't think you fixed the problem, you just
worked it around the other way...
Or better, you removed the initial console open, if it refers to the item #2
above... but the code isn't clean...
--
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next parent reply other threads:[~2005-03-07 19:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20041128010910.1b5478c7.akpm@osdl.org>
2005-03-05 17:58 ` Blaisorblade [this message]
2005-03-08 8:25 ` [uml-devel] Re: Fw: [patch] uml: terminal cleanup Gerd Knorr
2005-03-09 18:38 ` Blaisorblade
2005-03-10 8:13 ` Gerd Knorr
2005-03-11 3:04 ` Rob Landley
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=200503051858.05050.blaisorblade@yahoo.it \
--to=blaisorblade@yahoo.it \
--cc=kraxel@bytesex.org \
--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