From: Matt Mackall <mpm@selenic.com>
To: Andrew Morton <akpm@osdl.org>
Cc: YhLu@tyan.com, linux-tiny@selenic.com, linux-kernel@vger.kernel.org
Subject: Re: serial console
Date: Mon, 16 May 2005 16:47:57 -0700 [thread overview]
Message-ID: <20050516234757.GG5914@waste.org> (raw)
In-Reply-To: <20050516163712.66a1a058.akpm@osdl.org>
On Mon, May 16, 2005 at 04:37:12PM -0700, Andrew Morton wrote:
>
> It would be nicer if this was a static inline, so all the function call
> code at the callsites is removed by the compiler.
Better yet, a patch that's actually right. add_preferred_console is
setting the console used by init and so on, so it's still relevant
with CONFIG_PRINTK off. So I just move it out of the ifdef. Obviously
more correct(tm).
Move add_preferred_console out of CONFIG_PRINTK so serial console does
the right thing.
Signed-off-by: Matt Mackall <mpm@selenic.com>
Index: l-p/kernel/printk.c
===================================================================
--- l-p.orig/kernel/printk.c 2005-05-16 16:37:15.000000000 -0700
+++ l-p/kernel/printk.c 2005-05-16 16:40:31.000000000 -0700
@@ -160,42 +160,6 @@ static int __init console_setup(char *st
__setup("console=", console_setup);
-/**
- * add_preferred_console - add a device to the list of preferred consoles.
- *
- * The last preferred console added will be used for kernel messages
- * and stdin/out/err for init. Normally this is used by console_setup
- * above to handle user-supplied console arguments; however it can also
- * be used by arch-specific code either to override the user or more
- * commonly to provide a default console (ie from PROM variables) when
- * the user has not supplied one.
- */
-int __init add_preferred_console(char *name, int idx, char *options)
-{
- struct console_cmdline *c;
- int i;
-
- /*
- * See if this tty is not yet registered, and
- * if we have a slot free.
- */
- for(i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++)
- if (strcmp(console_cmdline[i].name, name) == 0 &&
- console_cmdline[i].index == idx) {
- selected_console = i;
- return 0;
- }
- if (i == MAX_CMDLINECONSOLES)
- return -E2BIG;
- selected_console = i;
- c = &console_cmdline[i];
- memcpy(c->name, name, sizeof(c->name));
- c->name[sizeof(c->name) - 1] = 0;
- c->options = options;
- c->index = idx;
- return 0;
-}
-
static int __init log_buf_len_setup(char *str)
{
unsigned long size = memparse(str, &str);
@@ -671,6 +635,42 @@ static void call_console_drivers(unsigne
#endif
/**
+ * add_preferred_console - add a device to the list of preferred consoles.
+ *
+ * The last preferred console added will be used for kernel messages
+ * and stdin/out/err for init. Normally this is used by console_setup
+ * above to handle user-supplied console arguments; however it can also
+ * be used by arch-specific code either to override the user or more
+ * commonly to provide a default console (ie from PROM variables) when
+ * the user has not supplied one.
+ */
+int __init add_preferred_console(char *name, int idx, char *options)
+{
+ struct console_cmdline *c;
+ int i;
+
+ /*
+ * See if this tty is not yet registered, and
+ * if we have a slot free.
+ */
+ for(i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++)
+ if (strcmp(console_cmdline[i].name, name) == 0 &&
+ console_cmdline[i].index == idx) {
+ selected_console = i;
+ return 0;
+ }
+ if (i == MAX_CMDLINECONSOLES)
+ return -E2BIG;
+ selected_console = i;
+ c = &console_cmdline[i];
+ memcpy(c->name, name, sizeof(c->name));
+ c->name[sizeof(c->name) - 1] = 0;
+ c->options = options;
+ c->index = idx;
+ return 0;
+}
+
+/**
* acquire_console_sem - lock the console system for exclusive use.
*
* Acquires a semaphore which guarantees that the caller has
--
Mathematics is the supreme nostalgia of our time.
next prev parent reply other threads:[~2005-05-16 23:48 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3174569B9743D511922F00A0C943142309F80D9F@TYANWEB>
[not found] ` <20050516205731.GA5914@waste.org>
2005-05-16 23:15 ` serial console Matt Mackall
2005-05-16 23:37 ` Andrew Morton
2005-05-16 23:47 ` Matt Mackall [this message]
2005-05-17 1:24 ` Coywolf Qi Hunt
2005-05-17 2:26 ` Matt Mackall
2005-05-17 2:40 ` Coywolf Qi Hunt
2005-05-17 2:19 ` Rob Landley
2009-12-30 15:52 Riccardo Veraldi
2009-12-30 16:28 ` Avi Kivity
-- strict thread matches above, loose matches on Subject: below --
2009-07-08 9:53 sylarrrrrrr
2009-07-08 19:13 ` Pavel Roskin
2006-05-21 16:00 Raymond Burns
2006-05-22 2:57 ` David S. Miller
2006-05-22 6:09 ` Raymond Burns
2005-10-05 2:36 KokHow Teh
2005-10-05 12:23 ` Vitaly Bordug
2005-10-05 2:32 KokHow Teh
2005-10-04 6:54 KokHow Teh
2005-10-04 15:11 ` David Jander
2005-10-04 15:16 ` Vitaly Bordug
2005-10-05 9:16 ` David Jander
2005-07-30 1:06 Serial console Daniel Ann
2005-07-30 1:19 ` Josh Boyer
2005-07-30 1:36 ` Daniel Ann
2005-07-30 5:46 ` Daniel Ann
2005-07-30 1:27 ` Ricardo Scop
2005-07-30 1:34 ` Daniel Ann
2005-07-30 10:37 ` Anton Wöllert
2005-08-01 1:27 ` Daniel Ann
2005-08-02 3:38 ` JohnsonCheng
2005-08-02 13:39 ` Kumar Gala
2005-08-03 0:16 ` Daniel Ann
2003-03-04 14:53 Serial Console Aman
2003-03-04 15:40 ` Mark Hatle
2003-03-04 17:06 ` Ibon Gotxi Garcia
2003-03-04 19:09 ` Dave Wolfe
2003-01-16 21:06 Aman
[not found] <200208191108120240.0D409F0A@192.168.128.16>
2002-08-19 9:10 ` Carlos Velasco
2002-08-19 9:18 ` Russell King
2002-08-19 9:10 ` Carlos Velasco
2002-08-19 13:17 ` Stuart MacDonald
2000-12-05 18:09 Jon Burgess
2000-12-05 15:20 Jon Burgess
2000-12-05 16:03 ` Chad Schwartz
2000-12-05 12:04 Steve Hill
2000-12-05 12:11 ` Miquel van Smoorenburg
2000-12-05 14:44 ` Paul Jakma
2000-12-05 14:58 ` Steve Hill
2000-12-05 15:07 ` Chad Schwartz
2000-12-05 15:14 ` Paul Jakma
2000-12-05 15:28 ` Steve Hill
2000-12-05 15:38 ` Chad Schwartz
2000-12-05 16:25 ` Rogier Wolff
2000-12-05 17:00 ` Miquel van Smoorenburg
2000-12-06 13:09 ` Vitaly Luban
2000-02-11 17:08 serial console Pat O'Rourke
2000-02-11 21:04 ` Matthew Jacob
2000-02-11 21:21 ` Pat O'Rourke
1998-04-02 17:31 kernel panic Ulf Carlsson
1998-04-02 18:55 ` Dong Liu
1998-04-02 18:47 ` ralf
1998-04-02 20:06 ` serial console Dong Liu
1998-04-02 21:35 ` ralf
1998-04-02 23:16 ` William J. Earl
1998-04-02 23:53 ` Dong Liu
1998-04-03 0:47 ` ralf
1998-04-04 20:27 ` Oliver Frommel
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=20050516234757.GG5914@waste.org \
--to=mpm@selenic.com \
--cc=YhLu@tyan.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tiny@selenic.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.