diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2007-03-01 06:56:43 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-03-04 14:02:37 -0500 |
commit | 36a885306fdf7bb557c773309c993bfb2d0d693c (patch) | |
tree | 643b246c90653c9451ff7fecff74a79c3de8042c /arch/mips/kernel/early_printk.c | |
parent | ca471c86043f4a8b01cba02ba2d3431fddcaf606 (diff) |
[MIPS] Fix and cleanup the mess that a dozen prom_printf variants are.
early_printk is a so much saner thing.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/early_printk.c')
-rw-r--r-- | arch/mips/kernel/early_printk.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/mips/kernel/early_printk.c b/arch/mips/kernel/early_printk.c new file mode 100644 index 000000000000..304efdc5682f --- /dev/null +++ b/arch/mips/kernel/early_printk.c | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2002, 2003, 06, 07 Ralf Baechle (ralf@linux-mips.org) | ||
7 | * Copyright (C) 2007 MIPS Technologies, Inc. | ||
8 | * written by Ralf Baechle (ralf@linux-mips.org) | ||
9 | */ | ||
10 | #include <linux/console.h> | ||
11 | #include <linux/init.h> | ||
12 | |||
13 | extern void prom_putchar(char); | ||
14 | |||
15 | static void early_console_write(struct console *con, const char *s, unsigned n) | ||
16 | { | ||
17 | while (n-- && *s) { | ||
18 | if (*s == '\n') | ||
19 | prom_putchar('\r'); | ||
20 | prom_putchar(*s); | ||
21 | s++; | ||
22 | } | ||
23 | } | ||
24 | |||
25 | static struct console early_console = { | ||
26 | .name = "early", | ||
27 | .write = early_console_write, | ||
28 | .flags = CON_PRINTBUFFER | CON_BOOT, | ||
29 | .index = -1 | ||
30 | }; | ||
31 | |||
32 | void __init setup_early_printk(void) | ||
33 | { | ||
34 | register_console(&early_console); | ||
35 | } | ||
36 | |||
37 | void __init disable_early_printk(void) | ||
38 | { | ||
39 | unregister_console(&early_console); | ||
40 | } | ||