diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-07-23 11:04:08 +0200 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2012-02-15 10:32:37 -0600 |
commit | 11482fc6925d63da4d12510e90d85e69ea558640 (patch) | |
tree | 11eac6af7d8592f3a79ccec917b4324689ccb987 /kernel | |
parent | a2e1475eff1ff781178cee3b87144438ca5f5234 (diff) |
early-printk-consolidate.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/printk.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index 7982a0a841ea..b7aa50e81217 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -44,13 +44,6 @@ #include <asm/uaccess.h> -/* - * Architectures can override it: - */ -void asmlinkage __attribute__((weak)) early_printk(const char *fmt, ...) -{ -} - #define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT) /* printk's without a loglevel use this.. */ @@ -521,6 +514,26 @@ static void __call_console_drivers(unsigned start, unsigned end) } } +#ifdef CONFIG_EARLY_PRINTK +struct console *early_console; + +static void early_vprintk(const char *fmt, va_list ap) +{ + char buf[512]; + int n = vscnprintf(buf, sizeof(buf), fmt, ap); + if (early_console) + early_console->write(early_console, buf, n); +} + +asmlinkage void early_printk(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + early_vprintk(fmt, ap); + va_end(ap); +} +#endif + static int __read_mostly ignore_loglevel; static int __init ignore_loglevel_setup(char *str) |