diff options
Diffstat (limited to 'arch/mips/dec/prom/console.c')
| -rw-r--r-- | arch/mips/dec/prom/console.c | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/arch/mips/dec/prom/console.c b/arch/mips/dec/prom/console.c index cade16ec7e5..caa6e047caf 100644 --- a/arch/mips/dec/prom/console.c +++ b/arch/mips/dec/prom/console.c @@ -1,9 +1,7 @@ /* - * arch/mips/dec/prom/console.c - * * DECstation PROM-based early console support. * - * Copyright (C) 2004 Maciej W. Rozycki + * Copyright (C) 2004, 2007 Maciej W. Rozycki * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -13,43 +11,35 @@ #include <linux/console.h> #include <linux/init.h> #include <linux/kernel.h> +#include <linux/string.h> #include <asm/dec/prom.h> static void __init prom_console_write(struct console *con, const char *s, unsigned int c) { - static char sfmt[] __initdata = "%%%us"; - char fmt[13]; - - snprintf(fmt, sizeof(fmt), sfmt, c); - prom_printf(fmt, s); + char buf[81]; + unsigned int chunk = sizeof(buf) - 1; + + while (c > 0) { + if (chunk > c) + chunk = c; + memcpy(buf, s, chunk); + buf[chunk] = '\0'; + prom_printf("%s", buf); + s += chunk; + c -= chunk; + } } static struct console promcons __initdata = { .name = "prom", .write = prom_console_write, - .flags = CON_PRINTBUFFER, + .flags = CON_BOOT | CON_PRINTBUFFER, .index = -1, }; -static int promcons_output __initdata = 0; - void __init register_prom_console(void) { - if (!promcons_output) { - promcons_output = 1; - register_console(&promcons); - } -} - -void __init unregister_prom_console(void) -{ - if (promcons_output) { - unregister_console(&promcons); - promcons_output = 0; - } + register_console(&promcons); } - -void disable_early_printk(void) - __attribute__((alias("unregister_prom_console"))); |
