mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] CON_BOOT
@ 2005-03-15 22:27 Matthew Wilcox
  2005-03-15 22:37 ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Matthew Wilcox @ 2005-03-15 22:27 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel


New console flag: CON_BOOT

CON_BOOT is like early printk in that it allows for output really
early on.  It's better than early printk because it unregisters
automatically when a real console is initialised.  So if you don't get
consoles registering in console_init, there isn't a huge delay between
the boot console unregistering and the real console starting.  This is
the case on PA-RISC where we have serial ports that aren't discovered
until the PCI bus has been walked.

I think all the current early printk users could be converted to this
scheme with a minimal amount of effort.

diff -urpNX dontdiff linus-2.6/include/linux/console.h parisc-2.6/include/linux/console.h
--- linus-2.6/include/linux/console.h	2005-03-02 04:35:07.000000000 -0700
+++ parisc-2.6/include/linux/console.h	2005-03-02 04:25:54.000000000 -0700
@@ -84,6 +84,7 @@ void give_up_console(const struct consw 
 #define CON_PRINTBUFFER	(1)
 #define CON_CONSDEV	(2) /* Last on the command line */
 #define CON_ENABLED	(4)
+#define CON_BOOT	(8)
 
 struct console
 {
diff -urpNX dontdiff linus-2.6/kernel/printk.c parisc-2.6/kernel/printk.c
--- linus-2.6/kernel/printk.c	2005-03-02 04:35:10.000000000 -0700
+++ parisc-2.6/kernel/printk.c	2005-03-15 09:20:32.339891098 -0700
@@ -804,6 +804,11 @@ void register_console(struct console * c
 	if (!(console->flags & CON_ENABLED))
 		return;
 
+	if (console_drivers && (console_drivers->flags & CON_BOOT)) {
+		unregister_console(console_drivers);
+		console->flags &= ~CON_PRINTBUFFER;
+	}
+
 	/*
 	 *	Put this console in the list - keep the
 	 *	preferred driver at the head of the list.

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-03-16 23:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-15 22:27 [PATCH] CON_BOOT Matthew Wilcox
2005-03-15 22:37 ` Andrew Morton
2005-03-16 13:07   ` Matthew Wilcox
2005-03-16 21:09     ` Andrew Morton
2005-03-16 21:17       ` Matthew Wilcox
2005-03-16 21:52         ` James Simmons
2005-03-16 21:54       ` James Simmons
2005-03-16 22:57         ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome