aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index abbdd9e2ac82..376914e2869d 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -49,13 +49,6 @@
49#define CREATE_TRACE_POINTS 49#define CREATE_TRACE_POINTS
50#include <trace/events/printk.h> 50#include <trace/events/printk.h>
51 51
52/*
53 * Architectures can override it:
54 */
55void asmlinkage __attribute__((weak)) early_printk(const char *fmt, ...)
56{
57}
58
59/* printk's without a loglevel use this.. */ 52/* printk's without a loglevel use this.. */
60#define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL 53#define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL
61 54
@@ -608,7 +601,8 @@ static unsigned int devkmsg_poll(struct file *file, poll_table *wait)
608 /* return error when data has vanished underneath us */ 601 /* return error when data has vanished underneath us */
609 if (user->seq < log_first_seq) 602 if (user->seq < log_first_seq)
610 ret = POLLIN|POLLRDNORM|POLLERR|POLLPRI; 603 ret = POLLIN|POLLRDNORM|POLLERR|POLLPRI;
611 ret = POLLIN|POLLRDNORM; 604 else
605 ret = POLLIN|POLLRDNORM;
612 } 606 }
613 raw_spin_unlock_irq(&logbuf_lock); 607 raw_spin_unlock_irq(&logbuf_lock);
614 608
@@ -1265,7 +1259,7 @@ static void call_console_drivers(int level, const char *text, size_t len)
1265{ 1259{
1266 struct console *con; 1260 struct console *con;
1267 1261
1268 trace_console(text, 0, len, len); 1262 trace_console(text, len);
1269 1263
1270 if (level >= console_loglevel && !ignore_loglevel) 1264 if (level >= console_loglevel && !ignore_loglevel)
1271 return; 1265 return;
@@ -1723,6 +1717,29 @@ static size_t cont_print_text(char *text, size_t size) { return 0; }
1723 1717
1724#endif /* CONFIG_PRINTK */ 1718#endif /* CONFIG_PRINTK */
1725 1719
1720#ifdef CONFIG_EARLY_PRINTK
1721struct console *early_console;
1722
1723void early_vprintk(const char *fmt, va_list ap)
1724{
1725 if (early_console) {
1726 char buf[512];
1727 int n = vscnprintf(buf, sizeof(buf), fmt, ap);
1728
1729 early_console->write(early_console, buf, n);
1730 }
1731}
1732
1733asmlinkage void early_printk(const char *fmt, ...)
1734{
1735 va_list ap;
1736
1737 va_start(ap, fmt);
1738 early_vprintk(fmt, ap);
1739 va_end(ap);
1740}
1741#endif
1742
1726static int __add_preferred_console(char *name, int idx, char *options, 1743static int __add_preferred_console(char *name, int idx, char *options,
1727 char *brl_options) 1744 char *brl_options)
1728{ 1745{