summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-07-23 11:04:08 +0200
committerClark Williams <williams@redhat.com>2012-02-15 10:32:37 -0600
commit11482fc6925d63da4d12510e90d85e69ea558640 (patch)
tree11eac6af7d8592f3a79ccec917b4324689ccb987 /kernel
parenta2e1475eff1ff781178cee3b87144438ca5f5234 (diff)
early-printk-consolidate.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/printk.c27
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)