GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / arm / kernel / early_printk.c
blob10ec8fdf34abfbf5be8e3c827d8e16440b262e3f
1 /* Modified by Broadcom Corp. Portions Copyright (c) Broadcom Corp, 2012. */
2 /*
3 * linux/arch/arm/kernel/early_printk.c
5 * Copyright (C) 2009 Sascha Hauer <s.hauer@pengutronix.de>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #include <linux/kernel.h>
13 #include <linux/console.h>
14 #include <linux/init.h>
16 #ifdef CONFIG_DEBUG_LL
17 extern void printch(int);
18 #else
19 #define printch(a)
20 #endif
22 static void early_write(const char *s, unsigned n)
24 while (n-- > 0) {
25 if (*s == '\n')
26 printch('\r');
27 printch(*s);
28 s++;
32 static void early_console_write(struct console *con, const char *s, unsigned n)
34 early_write(s, n);
37 static struct console early_console = {
38 .name = "earlycon",
39 .write = early_console_write,
40 .flags = CON_PRINTBUFFER | CON_BOOT,
41 .index = -1,
44 asmlinkage void early_printk(const char *fmt, ...)
46 char buf[512];
47 int n;
48 va_list ap;
50 va_start(ap, fmt);
51 n = vscnprintf(buf, sizeof(buf), fmt, ap);
52 early_write(buf, n);
53 va_end(ap);
56 static int __init setup_early_printk(char *buf)
58 register_console(&early_console);
59 return 0;
62 early_param("earlyprintk", setup_early_printk);