From: Ladislav Michl <ladis@linux-mips.org>
To: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Cc: Juan Quintela <quintela@trasno.org>, linux-mips@linux-mips.org
Subject: Re: [PATCH] kill prom_printf
Date: Tue, 17 Jun 2003 13:45:10 +0100 [thread overview]
Message-ID: <20030617134510.B32079@ftp.linux-mips.org> (raw)
In-Reply-To: <Pine.GSO.3.96.1030617134735.22214B-100000@delta.ds2.pg.gda.pl>; from macro@ds2.pg.gda.pl on Tue, Jun 17, 2003 at 02:14:55PM +0200
On Tue, Jun 17, 2003 at 02:14:55PM +0200, Maciej W. Rozycki wrote:
> On Tue, 17 Jun 2003, Ladislav Michl wrote:
>
> > Idea is to have only one way for printing kernel messages. In case of Indy,
> > O2 and SNI RM200 "arc" console will do it. Here you can find where should
> > be early console initialized:
> > http://marc.theaimsgroup.com/?l=linux-kernel&m=105519188505235&w=2
> > As Juan pointed out setup for such console is actually a nop and one is
> > supposed to enable this feature only when debugging kernel. DEC prom console
>
> That's a valid point, as long as enabling it does not require a
> reconfiguration.
>
> > however needs some setup to determine REX entry points. early console is
> > currently used on sh, alpha, x86_64 and ia64 architectures. Btw, see comment
> > at the top of arch/sparc/prom/printf.c
>
> The DEC's entry points are a part of the problem only -- to support a
> generic kernel, we need to move early_printk setup after setup_arch(), as
> the level of variation is huge then..
yes, you'll have to do basic setup in your setup_console function...
> There is also that minor implementation problem -- how to pass varargs
> from printk() to ROM's printf()? At least the firmware of the DECstation
> implements a full-featured printf() as in the C library.
you are implementing early console not printf (sorry again for confusion),
so there is no need to pass varargs anywhere. btw, early_printk() as known
from other archs is supposed to die in future. printk() should be used
everywhere.
better to show patch...
(note that setup_early_printk() will be probably called before init_arch.
how to choose right early console is still open question, but as we have
not generic kernel yet, we can use same way as we are using for choosing
proper prom_printf function. this patch was included in hope that it can
show principle nothing more...)
Index: arch/mips/kernel/Makefile
===================================================================
RCS file: /home/cvs/linux/arch/mips/kernel/Makefile,v
retrieving revision 1.69
diff -u -r1.69 Makefile
--- arch/mips/kernel/Makefile 13 Jun 2003 13:58:30 -0000 1.69
+++ arch/mips/kernel/Makefile 17 Jun 2003 12:33:14 -0000
@@ -43,4 +43,6 @@
obj-$(CONFIG_MODULES) += module.o
+obj-$(CONFIG_EARLY_PRINTK) += earlyprintk.o
+
EXTRA_AFLAGS := $(CFLAGS)
Index: arch/mips/kernel/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/kernel/setup.c,v
retrieving revision 1.147
diff -u -r1.147 setup.c
--- arch/mips/kernel/setup.c 15 Jun 2003 23:42:07 -0000 1.147
+++ arch/mips/kernel/setup.c 17 Jun 2003 12:33:15 -0000
@@ -113,6 +113,8 @@
asmlinkage void __init
init_arch(int argc, char **argv, char **envp, int *prom_vec)
{
+ setup_early_printk();
+
/* Determine which MIPS variant we are running on. */
cpu_probe();
--- /dev/null 2003-01-06 08:25:00.000000000 +0100
+++ arch/mips/kernel/earlyprintk.c 2003-06-16 09:06:12.000000000 +0200
@@ -0,0 +1,35 @@
+#include <linux/console.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/string.h>
+#include <linux/config.h>
+
+struct console *early_console = NULL;
+
+int __init setup_early_printk(void)
+{
+#ifdef CONFIG_ARC_CONSOLE
+ {
+ extern struct console arc_console;
+ early_console = &arc_console;
+ }
+#endif
+#ifdef CONFIG_PROM_CONSOLE
+ {
+ extern struct console prom_console;
+ early_console = &prom_console;
+ }
+#endif
+
+ register_console(early_console);
+ return 0;
+}
+
+void __init disable_early_printk(void)
+{
+ if (!early_console)
+ return;
+
+ printk(KERN_INFO "Disabling early console...\n");
+ unregister_console(early_console);
+}
next prev parent reply other threads:[~2003-06-17 12:45 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-16 14:33 [PATCH] kill prom_printf Ladislav Michl
2003-06-16 15:19 ` Maciej W. Rozycki
2003-06-16 23:31 ` Juan Quintela
2003-06-17 7:53 ` Ladislav Michl
2003-06-17 12:14 ` Maciej W. Rozycki
2003-06-17 12:45 ` Ladislav Michl [this message]
2003-06-17 14:17 ` Maciej W. Rozycki
2003-06-17 14:38 ` Geert Uytterhoeven
2003-06-17 14:49 ` Maciej W. Rozycki
2003-06-17 15:12 ` Geert Uytterhoeven
2003-06-17 16:05 ` Maciej W. Rozycki
2003-06-18 11:52 ` Maciej W. Rozycki
2003-06-17 11:47 ` Maciej W. Rozycki
2003-06-17 11:52 ` Ladislav Michl
2003-06-17 12:16 ` Maciej W. Rozycki
2003-06-17 12:18 ` Ladislav Michl
2003-06-17 12:32 ` Jan-Benedict Glaw
2003-06-17 12:43 ` Jan-Benedict Glaw
2003-06-17 13:57 ` Maciej W. Rozycki
2003-06-17 13:42 ` Maciej W. Rozycki
2003-06-17 12:24 ` Juan Quintela
2003-06-17 13:44 ` Maciej W. Rozycki
2003-06-17 15:03 ` Juan Quintela
2003-06-17 15:13 ` Geert Uytterhoeven
2003-06-17 15:26 ` Juan Quintela
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=20030617134510.B32079@ftp.linux-mips.org \
--to=ladis@linux-mips.org \
--cc=linux-mips@linux-mips.org \
--cc=macro@ds2.pg.gda.pl \
--cc=quintela@trasno.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