sh: Provide diagnostic kernel stack checks
[safe/jmp/linux-2.6] / arch / sh / Kconfig.debug
1 menu "Kernel hacking"
2
3 config TRACE_IRQFLAGS_SUPPORT
4         def_bool y
5
6 source "lib/Kconfig.debug"
7
8 config SH_STANDARD_BIOS
9         bool "Use LinuxSH standard BIOS"
10         depends on SUPERH32
11         help
12           Say Y here if your target has the gdb-sh-stub
13           package from www.m17n.org (or any conforming standard LinuxSH BIOS)
14           in FLASH or EPROM.  The kernel will use standard BIOS calls during
15           boot for various housekeeping tasks (including calls to read and
16           write characters to a system console, get a MAC address from an
17           on-board Ethernet interface, and shut down the hardware).  Note this
18           does not work with machines with an existing operating system in
19           mask ROM and no flash (WindowsCE machines fall in this category).
20           If unsure, say N.
21
22 config EARLY_SCIF_CONSOLE
23         bool "Use early SCIF console"
24         help
25           This enables an early console using a fixed SCIF port. This can
26           be used by platforms that are either not running the SH
27           standard BIOS, or do not wish to use the BIOS callbacks for the
28           serial I/O.
29
30 config EARLY_SCIF_CONSOLE_PORT
31         hex
32         depends on EARLY_SCIF_CONSOLE
33         default "0xa4400000" if CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7705
34         default "0xa4430000" if CPU_SUBTYPE_SH7720 || CPU_SUBTYPE_SH7721
35         default "0xf8420000" if CPU_SUBTYPE_SH7619
36         default "0xff804000" if CPU_SUBTYPE_MXG
37         default "0xffc30000" if CPU_SUBTYPE_SHX3
38         default "0xffe00000" if CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7763 || \
39                                 CPU_SUBTYPE_SH7722 || CPU_SUBTYPE_SH7366 || \
40                                 CPU_SUBTYPE_SH7343
41         default "0xffea0000" if CPU_SUBTYPE_SH7785
42         default "0xffeb0000" if CPU_SUBTYPE_SH7786
43         default "0xfffe8000" if CPU_SUBTYPE_SH7203
44         default "0xfffe9800" if CPU_SUBTYPE_SH7206 || CPU_SUBTYPE_SH7263
45         default "0xffe80000" if CPU_SH4
46         default "0x00000000"
47
48 config EARLY_PRINTK
49         bool "Early printk support"
50         depends on SH_STANDARD_BIOS || EARLY_SCIF_CONSOLE
51         help
52           Say Y here to redirect kernel printk messages to the serial port
53           used by the SH-IPL bootloader, starting very early in the boot
54           process and ending when the kernel's serial console is initialised.
55           This option is only useful porting the kernel to a new machine,
56           when the kernel may crash or hang before the serial console is
57           initialised. If unsure, say N.
58
59           On devices that are running SH-IPL and want to keep the port
60           initialization consistent while not using the BIOS callbacks,
61           select both the EARLY_SCIF_CONSOLE and SH_STANDARD_BIOS, using
62           the kernel command line option to toggle back and forth.
63
64 config DEBUG_STACKOVERFLOW
65         bool "Check for stack overflows"
66         depends on DEBUG_KERNEL && SUPERH32
67         help
68           This option will cause messages to be printed if free stack space
69           drops below a certain limit.
70
71 config DEBUG_STACK_USAGE
72         bool "Stack utilization instrumentation"
73         depends on DEBUG_KERNEL
74         help
75           Enables the display of the minimum amount of free stack which each
76           task has ever had available in the sysrq-T and sysrq-P debug output.
77
78           This option will slow down process creation somewhat.
79
80 config 4KSTACKS
81         bool "Use 4Kb for kernel stacks instead of 8Kb"
82         depends on DEBUG_KERNEL && (MMU || BROKEN) && !PAGE_SIZE_64KB
83         help
84           If you say Y here the kernel will use a 4Kb stacksize for the
85           kernel stack attached to each process/thread. This facilitates
86           running more threads on a system and also reduces the pressure
87           on the VM subsystem for higher order allocations. This option
88           will also use IRQ stacks to compensate for the reduced stackspace.
89
90 config IRQSTACKS
91         bool "Use separate kernel stacks when processing interrupts"
92         depends on DEBUG_KERNEL && SUPERH32 && BROKEN
93         help
94           If you say Y here the kernel will use separate kernel stacks
95           for handling hard and soft interrupts.  This can help avoid
96           overflowing the process kernel stacks.
97
98 config DUMP_CODE
99         bool "Show disassembly of nearby code in register dumps"
100         depends on DEBUG_KERNEL && SUPERH32
101         default y if DEBUG_BUGVERBOSE
102         default n
103         help
104           This prints out a code trace of the instructions leading up to
105           the faulting instruction as a debugging aid. As this does grow
106           the kernel in size a bit, most users will want to say N here.
107
108           Those looking for more verbose debugging output should say Y.
109
110 config SH_NO_BSS_INIT
111         bool "Avoid zeroing BSS (to speed-up startup on suitable platforms)"
112         depends on DEBUG_KERNEL
113         default n
114         help
115           If running in painfully slow environments, such as an RTL
116           simulation or from remote memory via SHdebug, where the memory
117           can already be gauranteed to ber zeroed on boot, say Y.
118
119           For all other cases, say N. If this option seems perplexing, or
120           you aren't sure, say N.
121
122 config SH64_SR_WATCH
123         bool "Debug: set SR.WATCH to enable hardware watchpoints and trace"
124         depends on SUPERH64
125
126 config STACK_DEBUG
127         bool "Enable diagnostic checks of the kernel stack"
128         depends on FUNCTION_TRACER
129         select DEBUG_STACKOVERFLOW
130         default n
131         help
132           This option allows checks to be performed on the kernel stack
133           at runtime. Saying Y here will add overhead to every function
134           call and will therefore incur a major performance hit. Most
135           users should say N.
136
137 endmenu