diff options
author | Kay Sievers <kay@vrfy.org> | 2012-05-09 00:46:14 +0200 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2012-05-09 00:46:14 +0200 |
commit | d767e4bff56c9a8e729b0dfa657e434e08a8d1c7 (patch) | |
tree | b82c124f60b4d1fe739a530d4d3e5ccc96128ccf | |
parent | 800d1669136aa2991477af14d16e1b2787e47b06 (diff) | |
download | patches-d767e4bff56c9a8e729b0dfa657e434e08a8d1c7.tar.gz |
fix PRINTK=n
-rw-r--r-- | kmsg-docs.patch | 2 | ||||
-rw-r--r-- | kmsg-off.patch | 95 | ||||
-rw-r--r-- | series | 1 |
3 files changed, 97 insertions, 1 deletions
diff --git a/kmsg-docs.patch b/kmsg-docs.patch index 667a429..50fcb4f 100644 --- a/kmsg-docs.patch +++ b/kmsg-docs.patch @@ -97,7 +97,7 @@ Signed-off-by: Kay Sievers <kay@vrfy.org> + b12:8 - block dev_t + c127:3 - char dev_t + n8 - netdev ifindex -+ + sound:card0 - subsystem:devname ++ +sound:card0 - subsystem:devname + +Users: dmesg(1), userspace kernel log consumers --- a/Documentation/devices.txt diff --git a/kmsg-off.patch b/kmsg-off.patch new file mode 100644 index 0000000..de51afe --- /dev/null +++ b/kmsg-off.patch @@ -0,0 +1,95 @@ +From: Kay Sievers <kay@vrfy.org> +Subject: printk - fix compilation for CONFIG_PRINTK=n + +Signed-off-by: Kay Sievers <kay@vrfy.org> +--- + kernel/printk.c | 41 ++++++++++++++++++++++------------------- + 1 file changed, 22 insertions(+), 19 deletions(-) + +--- a/kernel/printk.c ++++ b/kernel/printk.c +@@ -126,7 +126,6 @@ EXPORT_SYMBOL(console_set_on_cmdline); + /* Flag: console code may call schedule() */ + static int console_may_schedule; + +-#ifdef CONFIG_PRINTK + /* + * The printk log buffer consists of a chain of concatenated variable + * length records. Every record starts with a record header, containing +@@ -208,16 +207,9 @@ struct log { + */ + static DEFINE_RAW_SPINLOCK(logbuf_lock); + +-/* cpu currently holding logbuf_lock */ +-static volatile unsigned int logbuf_cpu = UINT_MAX; +- +-#define LOG_LINE_MAX 1024 +- +-/* record buffer */ +-#define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT) +-static char __log_buf[__LOG_BUF_LEN]; +-static char *log_buf = __log_buf; +-static u32 log_buf_len = __LOG_BUF_LEN; ++/* the next printk record to read by syslog(READ) or /proc/kmsg */ ++static u64 syslog_seq; ++static u32 syslog_idx; + + /* index and sequence number of the first record stored in the buffer */ + static u64 log_first_seq; +@@ -225,15 +217,23 @@ static u32 log_first_idx; + + /* index and sequence number of the next record to store in the buffer */ + static u64 log_next_seq; ++#ifdef CONFIG_PRINTK + static u32 log_next_idx; + + /* the next printk record to read after the last 'clear' command */ + static u64 clear_seq; + static u32 clear_idx; + +-/* the next printk record to read by syslog(READ) or /proc/kmsg */ +-static u64 syslog_seq; +-static u32 syslog_idx; ++#define LOG_LINE_MAX 1024 ++ ++/* record buffer */ ++#define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT) ++static char __log_buf[__LOG_BUF_LEN]; ++static char *log_buf = __log_buf; ++static u32 log_buf_len = __LOG_BUF_LEN; ++ ++/* cpu currently holding logbuf_lock */ ++static volatile unsigned int logbuf_cpu = UINT_MAX; + + /* human readable text of the record */ + static char *log_text(const struct log *msg) +@@ -1425,13 +1425,16 @@ asmlinkage int printk(const char *fmt, . + return r; + } + EXPORT_SYMBOL(printk); ++ + #else + +-static void call_console_drivers(int level, const char *text, size_t len) +-{ +-} ++#define LOG_LINE_MAX 0 ++static struct log *log_from_idx(u32 idx) { return NULL; } ++static u32 log_next(u32 idx) { return 0; } ++static char *log_text(const struct log *msg) { return NULL; } ++static void call_console_drivers(int level, const char *text, size_t len) {} + +-#endif ++#endif /* CONFIG_PRINTK */ + + static int __add_preferred_console(char *name, int idx, char *options, + char *brl_options) +@@ -1715,7 +1718,7 @@ static u32 console_idx; + * by printk(). If this is the case, console_unlock(); emits + * the output prior to releasing the lock. + * +- * If there is output waiting, we wake it /dev/kmsg and syslog() users. ++ * If there is output waiting, we wake /dev/kmsg and syslog() users. + * + * console_unlock(); may be called from any context. + */ @@ -8,3 +8,4 @@ kern-cont-parport.patch kern-conti-acpi.patch kern-cont-mm.patch kmsg-docs.patch +kmsg-off.patch |