diff options
author | Richard Weinberger <richard@nod.at> | 2011-05-24 20:13:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 11:39:41 -0400 |
commit | d634f194d4e2e58d57927c812aca097e67a2287d (patch) | |
tree | ca17ff43725293ea0bda7a7d7e8ed23ad4f89e14 /arch/um/kernel/early_printk.c | |
parent | 2525e70d492f8c7bbe1292db8fcd973607a56ac6 (diff) |
um: add earlyprintk support
User Mode Linux can also benefit from earlyprintk. UML's earlyprintk
writes kernel messages directly to stdout.
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/kernel/early_printk.c')
-rw-r--r-- | arch/um/kernel/early_printk.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/um/kernel/early_printk.c b/arch/um/kernel/early_printk.c new file mode 100644 index 000000000000..ec649bf72f68 --- /dev/null +++ b/arch/um/kernel/early_printk.c | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Richard Weinberger <richrd@nod.at> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <linux/kernel.h> | ||
10 | #include <linux/console.h> | ||
11 | #include <linux/init.h> | ||
12 | #include "os.h" | ||
13 | |||
14 | static void early_console_write(struct console *con, const char *s, unsigned int n) | ||
15 | { | ||
16 | um_early_printk(s, n); | ||
17 | } | ||
18 | |||
19 | static struct console early_console = { | ||
20 | .name = "earlycon", | ||
21 | .write = early_console_write, | ||
22 | .flags = CON_BOOT, | ||
23 | .index = -1, | ||
24 | }; | ||
25 | |||
26 | static int __init setup_early_printk(char *buf) | ||
27 | { | ||
28 | register_console(&early_console); | ||
29 | |||
30 | return 0; | ||
31 | } | ||
32 | |||
33 | early_param("earlyprintk", setup_early_printk); | ||