Commit 0d5f0a37 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] move LOG_BUF_SIZE to header/config

Patch from "Randy.Dunlap" <rddunlap@osdl.org>

Convert the selection of LOG_BUF_SIZE from an ifdef tangle in
printk.c into config logic.
parent dc50fd2c
......@@ -82,6 +82,51 @@ config SYSCTL
building a kernel for install/rescue disks or your system is very
limited in memory.
choice
prompt "Kernel log buffer size"
default LOG_BUF_SHIFT_17 if ARCH_S390
default LOG_BUF_SHIFT_16 if X86_NUMAQ || IA64
default LOG_BUF_SHIFT_15 if SMP
default LOG_BUF_SHIFT_14
help
Select kernel log buffer size from this list (power of 2).
Defaults: 17 (=> 128 KB for S/390)
16 (=> 64 KB for x86 NUMAQ or IA-64)
15 (=> 32 KB for SMP)
14 (=> 16 KB for uniprocessor)
config LOG_BUF_SHIFT_17
bool "128 KB"
default y if ARCH_S390
config LOG_BUF_SHIFT_16
bool "64 KB"
default y if X86_NUMAQ || IA64
config LOG_BUF_SHIFT_15
bool "32 KB"
default y if SMP
config LOG_BUF_SHIFT_14
bool "16 KB"
config LOG_BUF_SHIFT_13
bool "8 KB"
config LOG_BUF_SHIFT_12
bool "4 KB"
endchoice
config LOG_BUF_SHIFT
int
default 17 if LOG_BUF_SHIFT_17=y
default 16 if LOG_BUF_SHIFT_16=y
default 15 if LOG_BUF_SHIFT_15=y
default 14 if LOG_BUF_SHIFT_14=y
default 13 if LOG_BUF_SHIFT_13=y
default 12 if LOG_BUF_SHIFT_12=y
endmenu
......
......@@ -31,16 +31,7 @@
#include <asm/uaccess.h>
#if defined(CONFIG_X86_NUMAQ) || defined(CONFIG_IA64)
#define LOG_BUF_LEN (65536)
#elif defined(CONFIG_ARCH_S390)
#define LOG_BUF_LEN (131072)
#elif defined(CONFIG_SMP)
#define LOG_BUF_LEN (32768)
#else
#define LOG_BUF_LEN (16384) /* This must be a power of two */
#endif
#define LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT)
#define LOG_BUF_MASK (LOG_BUF_LEN-1)
/* printk's without a loglevel use this.. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment