Commit 6840999b192b1b57d713ddee3761c457a2779036
Committed by
Linus Torvalds
1 parent
d9f8bcbf67
Exists in
master
and in
4 other branches
x86: simplify "make ARCH=x86" and fix kconfig all.config
Simplify "make ARCH=x86" and fix kconfig so we again can set 64BIT in all.config. For a fix the diffstat is nice: 6 files changed, 3 insertions(+), 36 deletions(-) The patch reverts these commits: - 0f855aa64b3f63d35a891510cf7db932a435c116 ("kconfig: add helper to set config symbol from environment variable") - 2a113281f5cd2febbab21a93c8943f8d3eece4d3 ("kconfig: use $K64BIT to set 64BIT with all*config targets") Roman Zippel pointed out that kconfig supported string compares so the additional complexity introduced by the above two patches were not needed. With this patch we have following behaviour: # make {allno,allyes,allmod,rand}config [ARCH=...] option \ host arch | 32bit | 64bit ===================================================== ./. | 32bit | 64bit ARCH=x86 | 32bit | 32bit ARCH=i386 | 32bit | 32bit ARCH=x86_64 | 64bit | 64bit The general rule are that ARCH= and native architecture takes precedence over the configuration. So make ARCH=i386 [whatever] will always build a 32-bit kernel no matter what the configuration says. The configuration will be updated to 32-bit if it was configured to 64-bit and the other way around. This behaviour is consistent with previous behaviour so no suprises here. make ARCH=x86 will per default result in a 32-bit kernel but as the only ARCH= value x86 allow the user to select between 32-bit and 64-bit using menuconfig. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Andreas Herrmann <aherrman@arcor.de> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 6 changed files with 3 additions and 36 deletions Inline Diff
Makefile
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 24 | 3 | SUBLEVEL = 24 |
4 | EXTRAVERSION = -rc3 | 4 | EXTRAVERSION = -rc3 |
5 | NAME = Arr Matey! A Hairy Bilge Rat! | 5 | NAME = Arr Matey! A Hairy Bilge Rat! |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
8 | # To see a list of typical targets execute "make help" | 8 | # To see a list of typical targets execute "make help" |
9 | # More info can be located in ./README | 9 | # More info can be located in ./README |
10 | # Comments in this file are targeted only to the developer, do not | 10 | # Comments in this file are targeted only to the developer, do not |
11 | # expect to learn how to build the kernel reading this file. | 11 | # expect to learn how to build the kernel reading this file. |
12 | 12 | ||
13 | # Do not: | 13 | # Do not: |
14 | # o use make's built-in rules and variables | 14 | # o use make's built-in rules and variables |
15 | # (this increases performance and avoid hard-to-debug behavour); | 15 | # (this increases performance and avoid hard-to-debug behavour); |
16 | # o print "Entering directory ..."; | 16 | # o print "Entering directory ..."; |
17 | MAKEFLAGS += -rR --no-print-directory | 17 | MAKEFLAGS += -rR --no-print-directory |
18 | 18 | ||
19 | # We are using a recursive build, so we need to do a little thinking | 19 | # We are using a recursive build, so we need to do a little thinking |
20 | # to get the ordering right. | 20 | # to get the ordering right. |
21 | # | 21 | # |
22 | # Most importantly: sub-Makefiles should only ever modify files in | 22 | # Most importantly: sub-Makefiles should only ever modify files in |
23 | # their own directory. If in some directory we have a dependency on | 23 | # their own directory. If in some directory we have a dependency on |
24 | # a file in another dir (which doesn't happen often, but it's often | 24 | # a file in another dir (which doesn't happen often, but it's often |
25 | # unavoidable when linking the built-in.o targets which finally | 25 | # unavoidable when linking the built-in.o targets which finally |
26 | # turn into vmlinux), we will call a sub make in that other dir, and | 26 | # turn into vmlinux), we will call a sub make in that other dir, and |
27 | # after that we are sure that everything which is in that other dir | 27 | # after that we are sure that everything which is in that other dir |
28 | # is now up to date. | 28 | # is now up to date. |
29 | # | 29 | # |
30 | # The only cases where we need to modify files which have global | 30 | # The only cases where we need to modify files which have global |
31 | # effects are thus separated out and done before the recursive | 31 | # effects are thus separated out and done before the recursive |
32 | # descending is started. They are now explicitly listed as the | 32 | # descending is started. They are now explicitly listed as the |
33 | # prepare rule. | 33 | # prepare rule. |
34 | 34 | ||
35 | # To put more focus on warnings, be less verbose as default | 35 | # To put more focus on warnings, be less verbose as default |
36 | # Use 'make V=1' to see the full commands | 36 | # Use 'make V=1' to see the full commands |
37 | 37 | ||
38 | ifdef V | 38 | ifdef V |
39 | ifeq ("$(origin V)", "command line") | 39 | ifeq ("$(origin V)", "command line") |
40 | KBUILD_VERBOSE = $(V) | 40 | KBUILD_VERBOSE = $(V) |
41 | endif | 41 | endif |
42 | endif | 42 | endif |
43 | ifndef KBUILD_VERBOSE | 43 | ifndef KBUILD_VERBOSE |
44 | KBUILD_VERBOSE = 0 | 44 | KBUILD_VERBOSE = 0 |
45 | endif | 45 | endif |
46 | 46 | ||
47 | # Call a source code checker (by default, "sparse") as part of the | 47 | # Call a source code checker (by default, "sparse") as part of the |
48 | # C compilation. | 48 | # C compilation. |
49 | # | 49 | # |
50 | # Use 'make C=1' to enable checking of only re-compiled files. | 50 | # Use 'make C=1' to enable checking of only re-compiled files. |
51 | # Use 'make C=2' to enable checking of *all* source files, regardless | 51 | # Use 'make C=2' to enable checking of *all* source files, regardless |
52 | # of whether they are re-compiled or not. | 52 | # of whether they are re-compiled or not. |
53 | # | 53 | # |
54 | # See the file "Documentation/sparse.txt" for more details, including | 54 | # See the file "Documentation/sparse.txt" for more details, including |
55 | # where to get the "sparse" utility. | 55 | # where to get the "sparse" utility. |
56 | 56 | ||
57 | ifdef C | 57 | ifdef C |
58 | ifeq ("$(origin C)", "command line") | 58 | ifeq ("$(origin C)", "command line") |
59 | KBUILD_CHECKSRC = $(C) | 59 | KBUILD_CHECKSRC = $(C) |
60 | endif | 60 | endif |
61 | endif | 61 | endif |
62 | ifndef KBUILD_CHECKSRC | 62 | ifndef KBUILD_CHECKSRC |
63 | KBUILD_CHECKSRC = 0 | 63 | KBUILD_CHECKSRC = 0 |
64 | endif | 64 | endif |
65 | 65 | ||
66 | # Use make M=dir to specify directory of external module to build | 66 | # Use make M=dir to specify directory of external module to build |
67 | # Old syntax make ... SUBDIRS=$PWD is still supported | 67 | # Old syntax make ... SUBDIRS=$PWD is still supported |
68 | # Setting the environment variable KBUILD_EXTMOD take precedence | 68 | # Setting the environment variable KBUILD_EXTMOD take precedence |
69 | ifdef SUBDIRS | 69 | ifdef SUBDIRS |
70 | KBUILD_EXTMOD ?= $(SUBDIRS) | 70 | KBUILD_EXTMOD ?= $(SUBDIRS) |
71 | endif | 71 | endif |
72 | ifdef M | 72 | ifdef M |
73 | ifeq ("$(origin M)", "command line") | 73 | ifeq ("$(origin M)", "command line") |
74 | KBUILD_EXTMOD := $(M) | 74 | KBUILD_EXTMOD := $(M) |
75 | endif | 75 | endif |
76 | endif | 76 | endif |
77 | 77 | ||
78 | 78 | ||
79 | # kbuild supports saving output files in a separate directory. | 79 | # kbuild supports saving output files in a separate directory. |
80 | # To locate output files in a separate directory two syntaxes are supported. | 80 | # To locate output files in a separate directory two syntaxes are supported. |
81 | # In both cases the working directory must be the root of the kernel src. | 81 | # In both cases the working directory must be the root of the kernel src. |
82 | # 1) O= | 82 | # 1) O= |
83 | # Use "make O=dir/to/store/output/files/" | 83 | # Use "make O=dir/to/store/output/files/" |
84 | # | 84 | # |
85 | # 2) Set KBUILD_OUTPUT | 85 | # 2) Set KBUILD_OUTPUT |
86 | # Set the environment variable KBUILD_OUTPUT to point to the directory | 86 | # Set the environment variable KBUILD_OUTPUT to point to the directory |
87 | # where the output files shall be placed. | 87 | # where the output files shall be placed. |
88 | # export KBUILD_OUTPUT=dir/to/store/output/files/ | 88 | # export KBUILD_OUTPUT=dir/to/store/output/files/ |
89 | # make | 89 | # make |
90 | # | 90 | # |
91 | # The O= assignment takes precedence over the KBUILD_OUTPUT environment | 91 | # The O= assignment takes precedence over the KBUILD_OUTPUT environment |
92 | # variable. | 92 | # variable. |
93 | 93 | ||
94 | 94 | ||
95 | # KBUILD_SRC is set on invocation of make in OBJ directory | 95 | # KBUILD_SRC is set on invocation of make in OBJ directory |
96 | # KBUILD_SRC is not intended to be used by the regular user (for now) | 96 | # KBUILD_SRC is not intended to be used by the regular user (for now) |
97 | ifeq ($(KBUILD_SRC),) | 97 | ifeq ($(KBUILD_SRC),) |
98 | 98 | ||
99 | # OK, Make called in directory where kernel src resides | 99 | # OK, Make called in directory where kernel src resides |
100 | # Do we want to locate output files in a separate directory? | 100 | # Do we want to locate output files in a separate directory? |
101 | ifdef O | 101 | ifdef O |
102 | ifeq ("$(origin O)", "command line") | 102 | ifeq ("$(origin O)", "command line") |
103 | KBUILD_OUTPUT := $(O) | 103 | KBUILD_OUTPUT := $(O) |
104 | endif | 104 | endif |
105 | endif | 105 | endif |
106 | 106 | ||
107 | # That's our default target when none is given on the command line | 107 | # That's our default target when none is given on the command line |
108 | PHONY := _all | 108 | PHONY := _all |
109 | _all: | 109 | _all: |
110 | 110 | ||
111 | ifneq ($(KBUILD_OUTPUT),) | 111 | ifneq ($(KBUILD_OUTPUT),) |
112 | # Invoke a second make in the output directory, passing relevant variables | 112 | # Invoke a second make in the output directory, passing relevant variables |
113 | # check that the output directory actually exists | 113 | # check that the output directory actually exists |
114 | saved-output := $(KBUILD_OUTPUT) | 114 | saved-output := $(KBUILD_OUTPUT) |
115 | KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) | 115 | KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) |
116 | $(if $(KBUILD_OUTPUT),, \ | 116 | $(if $(KBUILD_OUTPUT),, \ |
117 | $(error output directory "$(saved-output)" does not exist)) | 117 | $(error output directory "$(saved-output)" does not exist)) |
118 | # Check that OUTPUT directory is not the same as where we have kernel src | 118 | # Check that OUTPUT directory is not the same as where we have kernel src |
119 | $(if $(filter-out $(KBUILD_OUTPUT),$(shell /bin/pwd)),, \ | 119 | $(if $(filter-out $(KBUILD_OUTPUT),$(shell /bin/pwd)),, \ |
120 | $(error Output directory (O=...) specifies kernel src dir)) | 120 | $(error Output directory (O=...) specifies kernel src dir)) |
121 | 121 | ||
122 | PHONY += $(MAKECMDGOALS) sub-make | 122 | PHONY += $(MAKECMDGOALS) sub-make |
123 | 123 | ||
124 | $(filter-out _all sub-make,$(MAKECMDGOALS)) _all: sub-make | 124 | $(filter-out _all sub-make,$(MAKECMDGOALS)) _all: sub-make |
125 | $(Q)@: | 125 | $(Q)@: |
126 | 126 | ||
127 | sub-make: FORCE | 127 | sub-make: FORCE |
128 | $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ | 128 | $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ |
129 | KBUILD_SRC=$(CURDIR) \ | 129 | KBUILD_SRC=$(CURDIR) \ |
130 | KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \ | 130 | KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \ |
131 | $(filter-out _all sub-make,$(MAKECMDGOALS)) | 131 | $(filter-out _all sub-make,$(MAKECMDGOALS)) |
132 | 132 | ||
133 | # Leave processing to above invocation of make | 133 | # Leave processing to above invocation of make |
134 | skip-makefile := 1 | 134 | skip-makefile := 1 |
135 | endif # ifneq ($(KBUILD_OUTPUT),) | 135 | endif # ifneq ($(KBUILD_OUTPUT),) |
136 | endif # ifeq ($(KBUILD_SRC),) | 136 | endif # ifeq ($(KBUILD_SRC),) |
137 | 137 | ||
138 | # We process the rest of the Makefile if this is the final invocation of make | 138 | # We process the rest of the Makefile if this is the final invocation of make |
139 | ifeq ($(skip-makefile),) | 139 | ifeq ($(skip-makefile),) |
140 | 140 | ||
141 | # If building an external module we do not care about the all: rule | 141 | # If building an external module we do not care about the all: rule |
142 | # but instead _all depend on modules | 142 | # but instead _all depend on modules |
143 | PHONY += all | 143 | PHONY += all |
144 | ifeq ($(KBUILD_EXTMOD),) | 144 | ifeq ($(KBUILD_EXTMOD),) |
145 | _all: all | 145 | _all: all |
146 | else | 146 | else |
147 | _all: modules | 147 | _all: modules |
148 | endif | 148 | endif |
149 | 149 | ||
150 | srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) | 150 | srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) |
151 | TOPDIR := $(srctree) | 151 | TOPDIR := $(srctree) |
152 | # FIXME - TOPDIR is obsolete, use srctree/objtree | 152 | # FIXME - TOPDIR is obsolete, use srctree/objtree |
153 | objtree := $(CURDIR) | 153 | objtree := $(CURDIR) |
154 | src := $(srctree) | 154 | src := $(srctree) |
155 | obj := $(objtree) | 155 | obj := $(objtree) |
156 | 156 | ||
157 | VPATH := $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD)) | 157 | VPATH := $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD)) |
158 | 158 | ||
159 | export srctree objtree VPATH TOPDIR | 159 | export srctree objtree VPATH TOPDIR |
160 | 160 | ||
161 | 161 | ||
162 | # SUBARCH tells the usermode build what the underlying arch is. That is set | 162 | # SUBARCH tells the usermode build what the underlying arch is. That is set |
163 | # first, and if a usermode build is happening, the "ARCH=um" on the command | 163 | # first, and if a usermode build is happening, the "ARCH=um" on the command |
164 | # line overrides the setting of ARCH below. If a native build is happening, | 164 | # line overrides the setting of ARCH below. If a native build is happening, |
165 | # then ARCH is assigned, getting whatever value it gets normally, and | 165 | # then ARCH is assigned, getting whatever value it gets normally, and |
166 | # SUBARCH is subsequently ignored. | 166 | # SUBARCH is subsequently ignored. |
167 | 167 | ||
168 | SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ | 168 | SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ |
169 | -e s/arm.*/arm/ -e s/sa110/arm/ \ | 169 | -e s/arm.*/arm/ -e s/sa110/arm/ \ |
170 | -e s/s390x/s390/ -e s/parisc64/parisc/ \ | 170 | -e s/s390x/s390/ -e s/parisc64/parisc/ \ |
171 | -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ | 171 | -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ |
172 | -e s/sh[234].*/sh/ ) | 172 | -e s/sh[234].*/sh/ ) |
173 | 173 | ||
174 | # Cross compiling and selecting different set of gcc/bin-utils | 174 | # Cross compiling and selecting different set of gcc/bin-utils |
175 | # --------------------------------------------------------------------------- | 175 | # --------------------------------------------------------------------------- |
176 | # | 176 | # |
177 | # When performing cross compilation for other architectures ARCH shall be set | 177 | # When performing cross compilation for other architectures ARCH shall be set |
178 | # to the target architecture. (See arch/* for the possibilities). | 178 | # to the target architecture. (See arch/* for the possibilities). |
179 | # ARCH can be set during invocation of make: | 179 | # ARCH can be set during invocation of make: |
180 | # make ARCH=ia64 | 180 | # make ARCH=ia64 |
181 | # Another way is to have ARCH set in the environment. | 181 | # Another way is to have ARCH set in the environment. |
182 | # The default ARCH is the host where make is executed. | 182 | # The default ARCH is the host where make is executed. |
183 | 183 | ||
184 | # CROSS_COMPILE specify the prefix used for all executables used | 184 | # CROSS_COMPILE specify the prefix used for all executables used |
185 | # during compilation. Only gcc and related bin-utils executables | 185 | # during compilation. Only gcc and related bin-utils executables |
186 | # are prefixed with $(CROSS_COMPILE). | 186 | # are prefixed with $(CROSS_COMPILE). |
187 | # CROSS_COMPILE can be set on the command line | 187 | # CROSS_COMPILE can be set on the command line |
188 | # make CROSS_COMPILE=ia64-linux- | 188 | # make CROSS_COMPILE=ia64-linux- |
189 | # Alternatively CROSS_COMPILE can be set in the environment. | 189 | # Alternatively CROSS_COMPILE can be set in the environment. |
190 | # Default value for CROSS_COMPILE is not to prefix executables | 190 | # Default value for CROSS_COMPILE is not to prefix executables |
191 | # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile | 191 | # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile |
192 | 192 | ||
193 | ARCH ?= $(SUBARCH) | 193 | ARCH ?= $(SUBARCH) |
194 | CROSS_COMPILE ?= | 194 | CROSS_COMPILE ?= |
195 | 195 | ||
196 | # Architecture as present in compile.h | 196 | # Architecture as present in compile.h |
197 | UTS_MACHINE := $(ARCH) | 197 | UTS_MACHINE := $(ARCH) |
198 | SRCARCH := $(ARCH) | 198 | SRCARCH := $(ARCH) |
199 | 199 | ||
200 | # Additional ARCH settings for x86 | 200 | # Additional ARCH settings for x86 |
201 | ifeq ($(ARCH),i386) | 201 | ifeq ($(ARCH),i386) |
202 | SRCARCH := x86 | 202 | SRCARCH := x86 |
203 | K64BIT := n | ||
204 | endif | 203 | endif |
205 | ifeq ($(ARCH),x86_64) | 204 | ifeq ($(ARCH),x86_64) |
206 | SRCARCH := x86 | 205 | SRCARCH := x86 |
207 | K64BIT := y | ||
208 | endif | 206 | endif |
209 | 207 | ||
210 | KCONFIG_CONFIG ?= .config | 208 | KCONFIG_CONFIG ?= .config |
211 | 209 | ||
212 | # SHELL used by kbuild | 210 | # SHELL used by kbuild |
213 | CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ | 211 | CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ |
214 | else if [ -x /bin/bash ]; then echo /bin/bash; \ | 212 | else if [ -x /bin/bash ]; then echo /bin/bash; \ |
215 | else echo sh; fi ; fi) | 213 | else echo sh; fi ; fi) |
216 | 214 | ||
217 | HOSTCC = gcc | 215 | HOSTCC = gcc |
218 | HOSTCXX = g++ | 216 | HOSTCXX = g++ |
219 | HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer | 217 | HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer |
220 | HOSTCXXFLAGS = -O2 | 218 | HOSTCXXFLAGS = -O2 |
221 | 219 | ||
222 | # Decide whether to build built-in, modular, or both. | 220 | # Decide whether to build built-in, modular, or both. |
223 | # Normally, just do built-in. | 221 | # Normally, just do built-in. |
224 | 222 | ||
225 | KBUILD_MODULES := | 223 | KBUILD_MODULES := |
226 | KBUILD_BUILTIN := 1 | 224 | KBUILD_BUILTIN := 1 |
227 | 225 | ||
228 | # If we have only "make modules", don't compile built-in objects. | 226 | # If we have only "make modules", don't compile built-in objects. |
229 | # When we're building modules with modversions, we need to consider | 227 | # When we're building modules with modversions, we need to consider |
230 | # the built-in objects during the descend as well, in order to | 228 | # the built-in objects during the descend as well, in order to |
231 | # make sure the checksums are up to date before we record them. | 229 | # make sure the checksums are up to date before we record them. |
232 | 230 | ||
233 | ifeq ($(MAKECMDGOALS),modules) | 231 | ifeq ($(MAKECMDGOALS),modules) |
234 | KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1) | 232 | KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1) |
235 | endif | 233 | endif |
236 | 234 | ||
237 | # If we have "make <whatever> modules", compile modules | 235 | # If we have "make <whatever> modules", compile modules |
238 | # in addition to whatever we do anyway. | 236 | # in addition to whatever we do anyway. |
239 | # Just "make" or "make all" shall build modules as well | 237 | # Just "make" or "make all" shall build modules as well |
240 | 238 | ||
241 | ifneq ($(filter all _all modules,$(MAKECMDGOALS)),) | 239 | ifneq ($(filter all _all modules,$(MAKECMDGOALS)),) |
242 | KBUILD_MODULES := 1 | 240 | KBUILD_MODULES := 1 |
243 | endif | 241 | endif |
244 | 242 | ||
245 | ifeq ($(MAKECMDGOALS),) | 243 | ifeq ($(MAKECMDGOALS),) |
246 | KBUILD_MODULES := 1 | 244 | KBUILD_MODULES := 1 |
247 | endif | 245 | endif |
248 | 246 | ||
249 | export KBUILD_MODULES KBUILD_BUILTIN | 247 | export KBUILD_MODULES KBUILD_BUILTIN |
250 | export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD | 248 | export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD |
251 | 249 | ||
252 | # Beautify output | 250 | # Beautify output |
253 | # --------------------------------------------------------------------------- | 251 | # --------------------------------------------------------------------------- |
254 | # | 252 | # |
255 | # Normally, we echo the whole command before executing it. By making | 253 | # Normally, we echo the whole command before executing it. By making |
256 | # that echo $($(quiet)$(cmd)), we now have the possibility to set | 254 | # that echo $($(quiet)$(cmd)), we now have the possibility to set |
257 | # $(quiet) to choose other forms of output instead, e.g. | 255 | # $(quiet) to choose other forms of output instead, e.g. |
258 | # | 256 | # |
259 | # quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@ | 257 | # quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@ |
260 | # cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< | 258 | # cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< |
261 | # | 259 | # |
262 | # If $(quiet) is empty, the whole command will be printed. | 260 | # If $(quiet) is empty, the whole command will be printed. |
263 | # If it is set to "quiet_", only the short version will be printed. | 261 | # If it is set to "quiet_", only the short version will be printed. |
264 | # If it is set to "silent_", nothing will be printed at all, since | 262 | # If it is set to "silent_", nothing will be printed at all, since |
265 | # the variable $(silent_cmd_cc_o_c) doesn't exist. | 263 | # the variable $(silent_cmd_cc_o_c) doesn't exist. |
266 | # | 264 | # |
267 | # A simple variant is to prefix commands with $(Q) - that's useful | 265 | # A simple variant is to prefix commands with $(Q) - that's useful |
268 | # for commands that shall be hidden in non-verbose mode. | 266 | # for commands that shall be hidden in non-verbose mode. |
269 | # | 267 | # |
270 | # $(Q)ln $@ :< | 268 | # $(Q)ln $@ :< |
271 | # | 269 | # |
272 | # If KBUILD_VERBOSE equals 0 then the above command will be hidden. | 270 | # If KBUILD_VERBOSE equals 0 then the above command will be hidden. |
273 | # If KBUILD_VERBOSE equals 1 then the above command is displayed. | 271 | # If KBUILD_VERBOSE equals 1 then the above command is displayed. |
274 | 272 | ||
275 | ifeq ($(KBUILD_VERBOSE),1) | 273 | ifeq ($(KBUILD_VERBOSE),1) |
276 | quiet = | 274 | quiet = |
277 | Q = | 275 | Q = |
278 | else | 276 | else |
279 | quiet=quiet_ | 277 | quiet=quiet_ |
280 | Q = @ | 278 | Q = @ |
281 | endif | 279 | endif |
282 | 280 | ||
283 | # If the user is running make -s (silent mode), suppress echoing of | 281 | # If the user is running make -s (silent mode), suppress echoing of |
284 | # commands | 282 | # commands |
285 | 283 | ||
286 | ifneq ($(findstring s,$(MAKEFLAGS)),) | 284 | ifneq ($(findstring s,$(MAKEFLAGS)),) |
287 | quiet=silent_ | 285 | quiet=silent_ |
288 | endif | 286 | endif |
289 | 287 | ||
290 | export quiet Q KBUILD_VERBOSE | 288 | export quiet Q KBUILD_VERBOSE |
291 | 289 | ||
292 | 290 | ||
293 | # Look for make include files relative to root of kernel src | 291 | # Look for make include files relative to root of kernel src |
294 | MAKEFLAGS += --include-dir=$(srctree) | 292 | MAKEFLAGS += --include-dir=$(srctree) |
295 | 293 | ||
296 | # We need some generic definitions. | 294 | # We need some generic definitions. |
297 | include $(srctree)/scripts/Kbuild.include | 295 | include $(srctree)/scripts/Kbuild.include |
298 | 296 | ||
299 | # Make variables (CC, etc...) | 297 | # Make variables (CC, etc...) |
300 | 298 | ||
301 | AS = $(CROSS_COMPILE)as | 299 | AS = $(CROSS_COMPILE)as |
302 | LD = $(CROSS_COMPILE)ld | 300 | LD = $(CROSS_COMPILE)ld |
303 | CC = $(CROSS_COMPILE)gcc | 301 | CC = $(CROSS_COMPILE)gcc |
304 | CPP = $(CC) -E | 302 | CPP = $(CC) -E |
305 | AR = $(CROSS_COMPILE)ar | 303 | AR = $(CROSS_COMPILE)ar |
306 | NM = $(CROSS_COMPILE)nm | 304 | NM = $(CROSS_COMPILE)nm |
307 | STRIP = $(CROSS_COMPILE)strip | 305 | STRIP = $(CROSS_COMPILE)strip |
308 | OBJCOPY = $(CROSS_COMPILE)objcopy | 306 | OBJCOPY = $(CROSS_COMPILE)objcopy |
309 | OBJDUMP = $(CROSS_COMPILE)objdump | 307 | OBJDUMP = $(CROSS_COMPILE)objdump |
310 | AWK = awk | 308 | AWK = awk |
311 | GENKSYMS = scripts/genksyms/genksyms | 309 | GENKSYMS = scripts/genksyms/genksyms |
312 | DEPMOD = /sbin/depmod | 310 | DEPMOD = /sbin/depmod |
313 | KALLSYMS = scripts/kallsyms | 311 | KALLSYMS = scripts/kallsyms |
314 | PERL = perl | 312 | PERL = perl |
315 | CHECK = sparse | 313 | CHECK = sparse |
316 | 314 | ||
317 | CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(CF) | 315 | CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(CF) |
318 | MODFLAGS = -DMODULE | 316 | MODFLAGS = -DMODULE |
319 | CFLAGS_MODULE = $(MODFLAGS) | 317 | CFLAGS_MODULE = $(MODFLAGS) |
320 | AFLAGS_MODULE = $(MODFLAGS) | 318 | AFLAGS_MODULE = $(MODFLAGS) |
321 | LDFLAGS_MODULE = | 319 | LDFLAGS_MODULE = |
322 | CFLAGS_KERNEL = | 320 | CFLAGS_KERNEL = |
323 | AFLAGS_KERNEL = | 321 | AFLAGS_KERNEL = |
324 | 322 | ||
325 | 323 | ||
326 | # Use LINUXINCLUDE when you must reference the include/ directory. | 324 | # Use LINUXINCLUDE when you must reference the include/ directory. |
327 | # Needed to be compatible with the O= option | 325 | # Needed to be compatible with the O= option |
328 | LINUXINCLUDE := -Iinclude \ | 326 | LINUXINCLUDE := -Iinclude \ |
329 | $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \ | 327 | $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \ |
330 | -include include/linux/autoconf.h | 328 | -include include/linux/autoconf.h |
331 | 329 | ||
332 | KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) | 330 | KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) |
333 | 331 | ||
334 | KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ | 332 | KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ |
335 | -fno-strict-aliasing -fno-common \ | 333 | -fno-strict-aliasing -fno-common \ |
336 | -Werror-implicit-function-declaration | 334 | -Werror-implicit-function-declaration |
337 | KBUILD_AFLAGS := -D__ASSEMBLY__ | 335 | KBUILD_AFLAGS := -D__ASSEMBLY__ |
338 | 336 | ||
339 | # Read KERNELRELEASE from include/config/kernel.release (if it exists) | 337 | # Read KERNELRELEASE from include/config/kernel.release (if it exists) |
340 | KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) | 338 | KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) |
341 | KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) | 339 | KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) |
342 | 340 | ||
343 | export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION | 341 | export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION |
344 | export ARCH SRCARCH K64BIT CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC | 342 | export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC |
345 | export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE | 343 | export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE |
346 | export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS | 344 | export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS |
347 | 345 | ||
348 | export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS | 346 | export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS |
349 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE | 347 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE |
350 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE | 348 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE |
351 | 349 | ||
352 | # When compiling out-of-tree modules, put MODVERDIR in the module | 350 | # When compiling out-of-tree modules, put MODVERDIR in the module |
353 | # tree rather than in the kernel tree. The kernel tree might | 351 | # tree rather than in the kernel tree. The kernel tree might |
354 | # even be read-only. | 352 | # even be read-only. |
355 | export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_versions | 353 | export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_versions |
356 | 354 | ||
357 | # Files to ignore in find ... statements | 355 | # Files to ignore in find ... statements |
358 | 356 | ||
359 | RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS -o -name .pc -o -name .hg -o -name .git \) -prune -o | 357 | RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS -o -name .pc -o -name .hg -o -name .git \) -prune -o |
360 | export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CVS --exclude .pc --exclude .hg --exclude .git | 358 | export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CVS --exclude .pc --exclude .hg --exclude .git |
361 | 359 | ||
362 | # =========================================================================== | 360 | # =========================================================================== |
363 | # Rules shared between *config targets and build targets | 361 | # Rules shared between *config targets and build targets |
364 | 362 | ||
365 | # Basic helpers built in scripts/ | 363 | # Basic helpers built in scripts/ |
366 | PHONY += scripts_basic | 364 | PHONY += scripts_basic |
367 | scripts_basic: | 365 | scripts_basic: |
368 | $(Q)$(MAKE) $(build)=scripts/basic | 366 | $(Q)$(MAKE) $(build)=scripts/basic |
369 | 367 | ||
370 | # To avoid any implicit rule to kick in, define an empty command. | 368 | # To avoid any implicit rule to kick in, define an empty command. |
371 | scripts/basic/%: scripts_basic ; | 369 | scripts/basic/%: scripts_basic ; |
372 | 370 | ||
373 | PHONY += outputmakefile | 371 | PHONY += outputmakefile |
374 | # outputmakefile generates a Makefile in the output directory, if using a | 372 | # outputmakefile generates a Makefile in the output directory, if using a |
375 | # separate output directory. This allows convenient use of make in the | 373 | # separate output directory. This allows convenient use of make in the |
376 | # output directory. | 374 | # output directory. |
377 | outputmakefile: | 375 | outputmakefile: |
378 | ifneq ($(KBUILD_SRC),) | 376 | ifneq ($(KBUILD_SRC),) |
379 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \ | 377 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \ |
380 | $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) | 378 | $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) |
381 | endif | 379 | endif |
382 | 380 | ||
383 | # To make sure we do not include .config for any of the *config targets | 381 | # To make sure we do not include .config for any of the *config targets |
384 | # catch them early, and hand them over to scripts/kconfig/Makefile | 382 | # catch them early, and hand them over to scripts/kconfig/Makefile |
385 | # It is allowed to specify more targets when calling make, including | 383 | # It is allowed to specify more targets when calling make, including |
386 | # mixing *config targets and build targets. | 384 | # mixing *config targets and build targets. |
387 | # For example 'make oldconfig all'. | 385 | # For example 'make oldconfig all'. |
388 | # Detect when mixed targets is specified, and make a second invocation | 386 | # Detect when mixed targets is specified, and make a second invocation |
389 | # of make so .config is not included in this case either (for *config). | 387 | # of make so .config is not included in this case either (for *config). |
390 | 388 | ||
391 | no-dot-config-targets := clean mrproper distclean \ | 389 | no-dot-config-targets := clean mrproper distclean \ |
392 | cscope TAGS tags help %docs check% \ | 390 | cscope TAGS tags help %docs check% \ |
393 | include/linux/version.h headers_% \ | 391 | include/linux/version.h headers_% \ |
394 | kernelrelease kernelversion | 392 | kernelrelease kernelversion |
395 | 393 | ||
396 | config-targets := 0 | 394 | config-targets := 0 |
397 | mixed-targets := 0 | 395 | mixed-targets := 0 |
398 | dot-config := 1 | 396 | dot-config := 1 |
399 | 397 | ||
400 | ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),) | 398 | ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),) |
401 | ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),) | 399 | ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),) |
402 | dot-config := 0 | 400 | dot-config := 0 |
403 | endif | 401 | endif |
404 | endif | 402 | endif |
405 | 403 | ||
406 | ifeq ($(KBUILD_EXTMOD),) | 404 | ifeq ($(KBUILD_EXTMOD),) |
407 | ifneq ($(filter config %config,$(MAKECMDGOALS)),) | 405 | ifneq ($(filter config %config,$(MAKECMDGOALS)),) |
408 | config-targets := 1 | 406 | config-targets := 1 |
409 | ifneq ($(filter-out config %config,$(MAKECMDGOALS)),) | 407 | ifneq ($(filter-out config %config,$(MAKECMDGOALS)),) |
410 | mixed-targets := 1 | 408 | mixed-targets := 1 |
411 | endif | 409 | endif |
412 | endif | 410 | endif |
413 | endif | 411 | endif |
414 | 412 | ||
415 | ifeq ($(mixed-targets),1) | 413 | ifeq ($(mixed-targets),1) |
416 | # =========================================================================== | 414 | # =========================================================================== |
417 | # We're called with mixed targets (*config and build targets). | 415 | # We're called with mixed targets (*config and build targets). |
418 | # Handle them one by one. | 416 | # Handle them one by one. |
419 | 417 | ||
420 | %:: FORCE | 418 | %:: FORCE |
421 | $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= $@ | 419 | $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= $@ |
422 | 420 | ||
423 | else | 421 | else |
424 | ifeq ($(config-targets),1) | 422 | ifeq ($(config-targets),1) |
425 | # =========================================================================== | 423 | # =========================================================================== |
426 | # *config targets only - make sure prerequisites are updated, and descend | 424 | # *config targets only - make sure prerequisites are updated, and descend |
427 | # in scripts/kconfig to make the *config target | 425 | # in scripts/kconfig to make the *config target |
428 | 426 | ||
429 | # Read arch specific Makefile to set KBUILD_DEFCONFIG as needed. | 427 | # Read arch specific Makefile to set KBUILD_DEFCONFIG as needed. |
430 | # KBUILD_DEFCONFIG may point out an alternative default configuration | 428 | # KBUILD_DEFCONFIG may point out an alternative default configuration |
431 | # used for 'make defconfig' | 429 | # used for 'make defconfig' |
432 | include $(srctree)/arch/$(SRCARCH)/Makefile | 430 | include $(srctree)/arch/$(SRCARCH)/Makefile |
433 | export KBUILD_DEFCONFIG | 431 | export KBUILD_DEFCONFIG |
434 | 432 | ||
435 | config %config: scripts_basic outputmakefile FORCE | 433 | config %config: scripts_basic outputmakefile FORCE |
436 | $(Q)mkdir -p include/linux include/config | 434 | $(Q)mkdir -p include/linux include/config |
437 | $(Q)$(MAKE) $(build)=scripts/kconfig $@ | 435 | $(Q)$(MAKE) $(build)=scripts/kconfig $@ |
438 | 436 | ||
439 | else | 437 | else |
440 | # =========================================================================== | 438 | # =========================================================================== |
441 | # Build targets only - this includes vmlinux, arch specific targets, clean | 439 | # Build targets only - this includes vmlinux, arch specific targets, clean |
442 | # targets and others. In general all targets except *config targets. | 440 | # targets and others. In general all targets except *config targets. |
443 | 441 | ||
444 | ifeq ($(KBUILD_EXTMOD),) | 442 | ifeq ($(KBUILD_EXTMOD),) |
445 | # Additional helpers built in scripts/ | 443 | # Additional helpers built in scripts/ |
446 | # Carefully list dependencies so we do not try to build scripts twice | 444 | # Carefully list dependencies so we do not try to build scripts twice |
447 | # in parallel | 445 | # in parallel |
448 | PHONY += scripts | 446 | PHONY += scripts |
449 | scripts: scripts_basic include/config/auto.conf | 447 | scripts: scripts_basic include/config/auto.conf |
450 | $(Q)$(MAKE) $(build)=$(@) | 448 | $(Q)$(MAKE) $(build)=$(@) |
451 | 449 | ||
452 | # Objects we will link into vmlinux / subdirs we need to visit | 450 | # Objects we will link into vmlinux / subdirs we need to visit |
453 | init-y := init/ | 451 | init-y := init/ |
454 | drivers-y := drivers/ sound/ | 452 | drivers-y := drivers/ sound/ |
455 | net-y := net/ | 453 | net-y := net/ |
456 | libs-y := lib/ | 454 | libs-y := lib/ |
457 | core-y := usr/ | 455 | core-y := usr/ |
458 | endif # KBUILD_EXTMOD | 456 | endif # KBUILD_EXTMOD |
459 | 457 | ||
460 | ifeq ($(dot-config),1) | 458 | ifeq ($(dot-config),1) |
461 | # Read in config | 459 | # Read in config |
462 | -include include/config/auto.conf | 460 | -include include/config/auto.conf |
463 | 461 | ||
464 | ifeq ($(KBUILD_EXTMOD),) | 462 | ifeq ($(KBUILD_EXTMOD),) |
465 | # Read in dependencies to all Kconfig* files, make sure to run | 463 | # Read in dependencies to all Kconfig* files, make sure to run |
466 | # oldconfig if changes are detected. | 464 | # oldconfig if changes are detected. |
467 | -include include/config/auto.conf.cmd | 465 | -include include/config/auto.conf.cmd |
468 | 466 | ||
469 | # To avoid any implicit rule to kick in, define an empty command | 467 | # To avoid any implicit rule to kick in, define an empty command |
470 | $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ; | 468 | $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ; |
471 | 469 | ||
472 | # If .config is newer than include/config/auto.conf, someone tinkered | 470 | # If .config is newer than include/config/auto.conf, someone tinkered |
473 | # with it and forgot to run make oldconfig. | 471 | # with it and forgot to run make oldconfig. |
474 | # if auto.conf.cmd is missing then we are probably in a cleaned tree so | 472 | # if auto.conf.cmd is missing then we are probably in a cleaned tree so |
475 | # we execute the config step to be sure to catch updated Kconfig files | 473 | # we execute the config step to be sure to catch updated Kconfig files |
476 | include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd | 474 | include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd |
477 | $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig | 475 | $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig |
478 | else | 476 | else |
479 | # external modules needs include/linux/autoconf.h and include/config/auto.conf | 477 | # external modules needs include/linux/autoconf.h and include/config/auto.conf |
480 | # but do not care if they are up-to-date. Use auto.conf to trigger the test | 478 | # but do not care if they are up-to-date. Use auto.conf to trigger the test |
481 | PHONY += include/config/auto.conf | 479 | PHONY += include/config/auto.conf |
482 | 480 | ||
483 | include/config/auto.conf: | 481 | include/config/auto.conf: |
484 | $(Q)test -e include/linux/autoconf.h -a -e $@ || ( \ | 482 | $(Q)test -e include/linux/autoconf.h -a -e $@ || ( \ |
485 | echo; \ | 483 | echo; \ |
486 | echo " ERROR: Kernel configuration is invalid."; \ | 484 | echo " ERROR: Kernel configuration is invalid."; \ |
487 | echo " include/linux/autoconf.h or $@ are missing."; \ | 485 | echo " include/linux/autoconf.h or $@ are missing."; \ |
488 | echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ | 486 | echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ |
489 | echo; \ | 487 | echo; \ |
490 | /bin/false) | 488 | /bin/false) |
491 | 489 | ||
492 | endif # KBUILD_EXTMOD | 490 | endif # KBUILD_EXTMOD |
493 | 491 | ||
494 | else | 492 | else |
495 | # Dummy target needed, because used as prerequisite | 493 | # Dummy target needed, because used as prerequisite |
496 | include/config/auto.conf: ; | 494 | include/config/auto.conf: ; |
497 | endif # $(dot-config) | 495 | endif # $(dot-config) |
498 | 496 | ||
499 | # The all: target is the default when no target is given on the | 497 | # The all: target is the default when no target is given on the |
500 | # command line. | 498 | # command line. |
501 | # This allow a user to issue only 'make' to build a kernel including modules | 499 | # This allow a user to issue only 'make' to build a kernel including modules |
502 | # Defaults vmlinux but it is usually overridden in the arch makefile | 500 | # Defaults vmlinux but it is usually overridden in the arch makefile |
503 | all: vmlinux | 501 | all: vmlinux |
504 | 502 | ||
505 | ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE | 503 | ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE |
506 | KBUILD_CFLAGS += -Os | 504 | KBUILD_CFLAGS += -Os |
507 | else | 505 | else |
508 | KBUILD_CFLAGS += -O2 | 506 | KBUILD_CFLAGS += -O2 |
509 | endif | 507 | endif |
510 | 508 | ||
511 | include $(srctree)/arch/$(SRCARCH)/Makefile | 509 | include $(srctree)/arch/$(SRCARCH)/Makefile |
512 | 510 | ||
513 | ifdef CONFIG_FRAME_POINTER | 511 | ifdef CONFIG_FRAME_POINTER |
514 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls | 512 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls |
515 | else | 513 | else |
516 | KBUILD_CFLAGS += -fomit-frame-pointer | 514 | KBUILD_CFLAGS += -fomit-frame-pointer |
517 | endif | 515 | endif |
518 | 516 | ||
519 | ifdef CONFIG_DEBUG_INFO | 517 | ifdef CONFIG_DEBUG_INFO |
520 | KBUILD_CFLAGS += -g | 518 | KBUILD_CFLAGS += -g |
521 | KBUILD_AFLAGS += -gdwarf-2 | 519 | KBUILD_AFLAGS += -gdwarf-2 |
522 | endif | 520 | endif |
523 | 521 | ||
524 | # Force gcc to behave correct even for buggy distributions | 522 | # Force gcc to behave correct even for buggy distributions |
525 | KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector) | 523 | KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector) |
526 | 524 | ||
527 | # arch Makefile may override CC so keep this after arch Makefile is included | 525 | # arch Makefile may override CC so keep this after arch Makefile is included |
528 | NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) | 526 | NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) |
529 | CHECKFLAGS += $(NOSTDINC_FLAGS) | 527 | CHECKFLAGS += $(NOSTDINC_FLAGS) |
530 | 528 | ||
531 | # warn about C99 declaration after statement | 529 | # warn about C99 declaration after statement |
532 | KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) | 530 | KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) |
533 | 531 | ||
534 | # disable pointer signed / unsigned warnings in gcc 4.0 | 532 | # disable pointer signed / unsigned warnings in gcc 4.0 |
535 | KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) | 533 | KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) |
536 | 534 | ||
537 | # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments | 535 | # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments |
538 | # But warn user when we do so | 536 | # But warn user when we do so |
539 | warn-assign = \ | 537 | warn-assign = \ |
540 | $(warning "WARNING: Appending $$K$(1) ($(K$(1))) from $(origin K$(1)) to kernel $$$(1)") | 538 | $(warning "WARNING: Appending $$K$(1) ($(K$(1))) from $(origin K$(1)) to kernel $$$(1)") |
541 | 539 | ||
542 | ifneq ($(KCPPFLAGS),) | 540 | ifneq ($(KCPPFLAGS),) |
543 | $(call warn-assign,CPPFLAGS) | 541 | $(call warn-assign,CPPFLAGS) |
544 | KBUILD_CPPFLAGS += $(KCPPFLAGS) | 542 | KBUILD_CPPFLAGS += $(KCPPFLAGS) |
545 | endif | 543 | endif |
546 | ifneq ($(KAFLAGS),) | 544 | ifneq ($(KAFLAGS),) |
547 | $(call warn-assign,AFLAGS) | 545 | $(call warn-assign,AFLAGS) |
548 | KBUILD_AFLAGS += $(KAFLAGS) | 546 | KBUILD_AFLAGS += $(KAFLAGS) |
549 | endif | 547 | endif |
550 | ifneq ($(KCFLAGS),) | 548 | ifneq ($(KCFLAGS),) |
551 | $(call warn-assign,CFLAGS) | 549 | $(call warn-assign,CFLAGS) |
552 | KBUILD_CFLAGS += $(KCFLAGS) | 550 | KBUILD_CFLAGS += $(KCFLAGS) |
553 | endif | 551 | endif |
554 | 552 | ||
555 | # Use --build-id when available. | 553 | # Use --build-id when available. |
556 | LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ | 554 | LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ |
557 | $(call ld-option, -Wl$(comma)--build-id,)) | 555 | $(call ld-option, -Wl$(comma)--build-id,)) |
558 | LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) | 556 | LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) |
559 | LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) | 557 | LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) |
560 | 558 | ||
561 | # Default kernel image to build when no specific target is given. | 559 | # Default kernel image to build when no specific target is given. |
562 | # KBUILD_IMAGE may be overruled on the command line or | 560 | # KBUILD_IMAGE may be overruled on the command line or |
563 | # set in the environment | 561 | # set in the environment |
564 | # Also any assignments in arch/$(ARCH)/Makefile take precedence over | 562 | # Also any assignments in arch/$(ARCH)/Makefile take precedence over |
565 | # this default value | 563 | # this default value |
566 | export KBUILD_IMAGE ?= vmlinux | 564 | export KBUILD_IMAGE ?= vmlinux |
567 | 565 | ||
568 | # | 566 | # |
569 | # INSTALL_PATH specifies where to place the updated kernel and system map | 567 | # INSTALL_PATH specifies where to place the updated kernel and system map |
570 | # images. Default is /boot, but you can set it to other values | 568 | # images. Default is /boot, but you can set it to other values |
571 | export INSTALL_PATH ?= /boot | 569 | export INSTALL_PATH ?= /boot |
572 | 570 | ||
573 | # | 571 | # |
574 | # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory | 572 | # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory |
575 | # relocations required by build roots. This is not defined in the | 573 | # relocations required by build roots. This is not defined in the |
576 | # makefile but the argument can be passed to make if needed. | 574 | # makefile but the argument can be passed to make if needed. |
577 | # | 575 | # |
578 | 576 | ||
579 | MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) | 577 | MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) |
580 | export MODLIB | 578 | export MODLIB |
581 | 579 | ||
582 | # | 580 | # |
583 | # INSTALL_MOD_STRIP, if defined, will cause modules to be | 581 | # INSTALL_MOD_STRIP, if defined, will cause modules to be |
584 | # stripped after they are installed. If INSTALL_MOD_STRIP is '1', then | 582 | # stripped after they are installed. If INSTALL_MOD_STRIP is '1', then |
585 | # the default option --strip-debug will be used. Otherwise, | 583 | # the default option --strip-debug will be used. Otherwise, |
586 | # INSTALL_MOD_STRIP will used as the options to the strip command. | 584 | # INSTALL_MOD_STRIP will used as the options to the strip command. |
587 | 585 | ||
588 | ifdef INSTALL_MOD_STRIP | 586 | ifdef INSTALL_MOD_STRIP |
589 | ifeq ($(INSTALL_MOD_STRIP),1) | 587 | ifeq ($(INSTALL_MOD_STRIP),1) |
590 | mod_strip_cmd = $(STRIP) --strip-debug | 588 | mod_strip_cmd = $(STRIP) --strip-debug |
591 | else | 589 | else |
592 | mod_strip_cmd = $(STRIP) $(INSTALL_MOD_STRIP) | 590 | mod_strip_cmd = $(STRIP) $(INSTALL_MOD_STRIP) |
593 | endif # INSTALL_MOD_STRIP=1 | 591 | endif # INSTALL_MOD_STRIP=1 |
594 | else | 592 | else |
595 | mod_strip_cmd = true | 593 | mod_strip_cmd = true |
596 | endif # INSTALL_MOD_STRIP | 594 | endif # INSTALL_MOD_STRIP |
597 | export mod_strip_cmd | 595 | export mod_strip_cmd |
598 | 596 | ||
599 | 597 | ||
600 | ifeq ($(KBUILD_EXTMOD),) | 598 | ifeq ($(KBUILD_EXTMOD),) |
601 | core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ | 599 | core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ |
602 | 600 | ||
603 | vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ | 601 | vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ |
604 | $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ | 602 | $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ |
605 | $(net-y) $(net-m) $(libs-y) $(libs-m))) | 603 | $(net-y) $(net-m) $(libs-y) $(libs-m))) |
606 | 604 | ||
607 | vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \ | 605 | vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \ |
608 | $(init-n) $(init-) \ | 606 | $(init-n) $(init-) \ |
609 | $(core-n) $(core-) $(drivers-n) $(drivers-) \ | 607 | $(core-n) $(core-) $(drivers-n) $(drivers-) \ |
610 | $(net-n) $(net-) $(libs-n) $(libs-)))) | 608 | $(net-n) $(net-) $(libs-n) $(libs-)))) |
611 | 609 | ||
612 | init-y := $(patsubst %/, %/built-in.o, $(init-y)) | 610 | init-y := $(patsubst %/, %/built-in.o, $(init-y)) |
613 | core-y := $(patsubst %/, %/built-in.o, $(core-y)) | 611 | core-y := $(patsubst %/, %/built-in.o, $(core-y)) |
614 | drivers-y := $(patsubst %/, %/built-in.o, $(drivers-y)) | 612 | drivers-y := $(patsubst %/, %/built-in.o, $(drivers-y)) |
615 | net-y := $(patsubst %/, %/built-in.o, $(net-y)) | 613 | net-y := $(patsubst %/, %/built-in.o, $(net-y)) |
616 | libs-y1 := $(patsubst %/, %/lib.a, $(libs-y)) | 614 | libs-y1 := $(patsubst %/, %/lib.a, $(libs-y)) |
617 | libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y)) | 615 | libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y)) |
618 | libs-y := $(libs-y1) $(libs-y2) | 616 | libs-y := $(libs-y1) $(libs-y2) |
619 | 617 | ||
620 | # Build vmlinux | 618 | # Build vmlinux |
621 | # --------------------------------------------------------------------------- | 619 | # --------------------------------------------------------------------------- |
622 | # vmlinux is built from the objects selected by $(vmlinux-init) and | 620 | # vmlinux is built from the objects selected by $(vmlinux-init) and |
623 | # $(vmlinux-main). Most are built-in.o files from top-level directories | 621 | # $(vmlinux-main). Most are built-in.o files from top-level directories |
624 | # in the kernel tree, others are specified in arch/$(ARCH)/Makefile. | 622 | # in the kernel tree, others are specified in arch/$(ARCH)/Makefile. |
625 | # Ordering when linking is important, and $(vmlinux-init) must be first. | 623 | # Ordering when linking is important, and $(vmlinux-init) must be first. |
626 | # | 624 | # |
627 | # vmlinux | 625 | # vmlinux |
628 | # ^ | 626 | # ^ |
629 | # | | 627 | # | |
630 | # +-< $(vmlinux-init) | 628 | # +-< $(vmlinux-init) |
631 | # | +--< init/version.o + more | 629 | # | +--< init/version.o + more |
632 | # | | 630 | # | |
633 | # +--< $(vmlinux-main) | 631 | # +--< $(vmlinux-main) |
634 | # | +--< driver/built-in.o mm/built-in.o + more | 632 | # | +--< driver/built-in.o mm/built-in.o + more |
635 | # | | 633 | # | |
636 | # +-< kallsyms.o (see description in CONFIG_KALLSYMS section) | 634 | # +-< kallsyms.o (see description in CONFIG_KALLSYMS section) |
637 | # | 635 | # |
638 | # vmlinux version (uname -v) cannot be updated during normal | 636 | # vmlinux version (uname -v) cannot be updated during normal |
639 | # descending-into-subdirs phase since we do not yet know if we need to | 637 | # descending-into-subdirs phase since we do not yet know if we need to |
640 | # update vmlinux. | 638 | # update vmlinux. |
641 | # Therefore this step is delayed until just before final link of vmlinux - | 639 | # Therefore this step is delayed until just before final link of vmlinux - |
642 | # except in the kallsyms case where it is done just before adding the | 640 | # except in the kallsyms case where it is done just before adding the |
643 | # symbols to the kernel. | 641 | # symbols to the kernel. |
644 | # | 642 | # |
645 | # System.map is generated to document addresses of all kernel symbols | 643 | # System.map is generated to document addresses of all kernel symbols |
646 | 644 | ||
647 | vmlinux-init := $(head-y) $(init-y) | 645 | vmlinux-init := $(head-y) $(init-y) |
648 | vmlinux-main := $(core-y) $(libs-y) $(drivers-y) $(net-y) | 646 | vmlinux-main := $(core-y) $(libs-y) $(drivers-y) $(net-y) |
649 | vmlinux-all := $(vmlinux-init) $(vmlinux-main) | 647 | vmlinux-all := $(vmlinux-init) $(vmlinux-main) |
650 | vmlinux-lds := arch/$(SRCARCH)/kernel/vmlinux.lds | 648 | vmlinux-lds := arch/$(SRCARCH)/kernel/vmlinux.lds |
651 | export KBUILD_VMLINUX_OBJS := $(vmlinux-all) | 649 | export KBUILD_VMLINUX_OBJS := $(vmlinux-all) |
652 | 650 | ||
653 | # Rule to link vmlinux - also used during CONFIG_KALLSYMS | 651 | # Rule to link vmlinux - also used during CONFIG_KALLSYMS |
654 | # May be overridden by arch/$(ARCH)/Makefile | 652 | # May be overridden by arch/$(ARCH)/Makefile |
655 | quiet_cmd_vmlinux__ ?= LD $@ | 653 | quiet_cmd_vmlinux__ ?= LD $@ |
656 | cmd_vmlinux__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) -o $@ \ | 654 | cmd_vmlinux__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) -o $@ \ |
657 | -T $(vmlinux-lds) $(vmlinux-init) \ | 655 | -T $(vmlinux-lds) $(vmlinux-init) \ |
658 | --start-group $(vmlinux-main) --end-group \ | 656 | --start-group $(vmlinux-main) --end-group \ |
659 | $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o FORCE ,$^) | 657 | $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o FORCE ,$^) |
660 | 658 | ||
661 | # Generate new vmlinux version | 659 | # Generate new vmlinux version |
662 | quiet_cmd_vmlinux_version = GEN .version | 660 | quiet_cmd_vmlinux_version = GEN .version |
663 | cmd_vmlinux_version = set -e; \ | 661 | cmd_vmlinux_version = set -e; \ |
664 | if [ ! -r .version ]; then \ | 662 | if [ ! -r .version ]; then \ |
665 | rm -f .version; \ | 663 | rm -f .version; \ |
666 | echo 1 >.version; \ | 664 | echo 1 >.version; \ |
667 | else \ | 665 | else \ |
668 | mv .version .old_version; \ | 666 | mv .version .old_version; \ |
669 | expr 0$$(cat .old_version) + 1 >.version; \ | 667 | expr 0$$(cat .old_version) + 1 >.version; \ |
670 | fi; \ | 668 | fi; \ |
671 | $(MAKE) $(build)=init | 669 | $(MAKE) $(build)=init |
672 | 670 | ||
673 | # Generate System.map | 671 | # Generate System.map |
674 | quiet_cmd_sysmap = SYSMAP | 672 | quiet_cmd_sysmap = SYSMAP |
675 | cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap | 673 | cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap |
676 | 674 | ||
677 | # Link of vmlinux | 675 | # Link of vmlinux |
678 | # If CONFIG_KALLSYMS is set .version is already updated | 676 | # If CONFIG_KALLSYMS is set .version is already updated |
679 | # Generate System.map and verify that the content is consistent | 677 | # Generate System.map and verify that the content is consistent |
680 | # Use + in front of the vmlinux_version rule to silent warning with make -j2 | 678 | # Use + in front of the vmlinux_version rule to silent warning with make -j2 |
681 | # First command is ':' to allow us to use + in front of the rule | 679 | # First command is ':' to allow us to use + in front of the rule |
682 | define rule_vmlinux__ | 680 | define rule_vmlinux__ |
683 | : | 681 | : |
684 | $(if $(CONFIG_KALLSYMS),,+$(call cmd,vmlinux_version)) | 682 | $(if $(CONFIG_KALLSYMS),,+$(call cmd,vmlinux_version)) |
685 | 683 | ||
686 | $(call cmd,vmlinux__) | 684 | $(call cmd,vmlinux__) |
687 | $(Q)echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd | 685 | $(Q)echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd |
688 | 686 | ||
689 | $(Q)$(if $($(quiet)cmd_sysmap), \ | 687 | $(Q)$(if $($(quiet)cmd_sysmap), \ |
690 | echo ' $($(quiet)cmd_sysmap) System.map' &&) \ | 688 | echo ' $($(quiet)cmd_sysmap) System.map' &&) \ |
691 | $(cmd_sysmap) $@ System.map; \ | 689 | $(cmd_sysmap) $@ System.map; \ |
692 | if [ $$? -ne 0 ]; then \ | 690 | if [ $$? -ne 0 ]; then \ |
693 | rm -f $@; \ | 691 | rm -f $@; \ |
694 | /bin/false; \ | 692 | /bin/false; \ |
695 | fi; | 693 | fi; |
696 | $(verify_kallsyms) | 694 | $(verify_kallsyms) |
697 | endef | 695 | endef |
698 | 696 | ||
699 | 697 | ||
700 | ifdef CONFIG_KALLSYMS | 698 | ifdef CONFIG_KALLSYMS |
701 | # Generate section listing all symbols and add it into vmlinux $(kallsyms.o) | 699 | # Generate section listing all symbols and add it into vmlinux $(kallsyms.o) |
702 | # It's a three stage process: | 700 | # It's a three stage process: |
703 | # o .tmp_vmlinux1 has all symbols and sections, but __kallsyms is | 701 | # o .tmp_vmlinux1 has all symbols and sections, but __kallsyms is |
704 | # empty | 702 | # empty |
705 | # Running kallsyms on that gives us .tmp_kallsyms1.o with | 703 | # Running kallsyms on that gives us .tmp_kallsyms1.o with |
706 | # the right size - vmlinux version (uname -v) is updated during this step | 704 | # the right size - vmlinux version (uname -v) is updated during this step |
707 | # o .tmp_vmlinux2 now has a __kallsyms section of the right size, | 705 | # o .tmp_vmlinux2 now has a __kallsyms section of the right size, |
708 | # but due to the added section, some addresses have shifted. | 706 | # but due to the added section, some addresses have shifted. |
709 | # From here, we generate a correct .tmp_kallsyms2.o | 707 | # From here, we generate a correct .tmp_kallsyms2.o |
710 | # o The correct .tmp_kallsyms2.o is linked into the final vmlinux. | 708 | # o The correct .tmp_kallsyms2.o is linked into the final vmlinux. |
711 | # o Verify that the System.map from vmlinux matches the map from | 709 | # o Verify that the System.map from vmlinux matches the map from |
712 | # .tmp_vmlinux2, just in case we did not generate kallsyms correctly. | 710 | # .tmp_vmlinux2, just in case we did not generate kallsyms correctly. |
713 | # o If CONFIG_KALLSYMS_EXTRA_PASS is set, do an extra pass using | 711 | # o If CONFIG_KALLSYMS_EXTRA_PASS is set, do an extra pass using |
714 | # .tmp_vmlinux3 and .tmp_kallsyms3.o. This is only meant as a | 712 | # .tmp_vmlinux3 and .tmp_kallsyms3.o. This is only meant as a |
715 | # temporary bypass to allow the kernel to be built while the | 713 | # temporary bypass to allow the kernel to be built while the |
716 | # maintainers work out what went wrong with kallsyms. | 714 | # maintainers work out what went wrong with kallsyms. |
717 | 715 | ||
718 | ifdef CONFIG_KALLSYMS_EXTRA_PASS | 716 | ifdef CONFIG_KALLSYMS_EXTRA_PASS |
719 | last_kallsyms := 3 | 717 | last_kallsyms := 3 |
720 | else | 718 | else |
721 | last_kallsyms := 2 | 719 | last_kallsyms := 2 |
722 | endif | 720 | endif |
723 | 721 | ||
724 | kallsyms.o := .tmp_kallsyms$(last_kallsyms).o | 722 | kallsyms.o := .tmp_kallsyms$(last_kallsyms).o |
725 | 723 | ||
726 | define verify_kallsyms | 724 | define verify_kallsyms |
727 | $(Q)$(if $($(quiet)cmd_sysmap), \ | 725 | $(Q)$(if $($(quiet)cmd_sysmap), \ |
728 | echo ' $($(quiet)cmd_sysmap) .tmp_System.map' &&) \ | 726 | echo ' $($(quiet)cmd_sysmap) .tmp_System.map' &&) \ |
729 | $(cmd_sysmap) .tmp_vmlinux$(last_kallsyms) .tmp_System.map | 727 | $(cmd_sysmap) .tmp_vmlinux$(last_kallsyms) .tmp_System.map |
730 | $(Q)cmp -s System.map .tmp_System.map || \ | 728 | $(Q)cmp -s System.map .tmp_System.map || \ |
731 | (echo Inconsistent kallsyms data; \ | 729 | (echo Inconsistent kallsyms data; \ |
732 | echo Try setting CONFIG_KALLSYMS_EXTRA_PASS; \ | 730 | echo Try setting CONFIG_KALLSYMS_EXTRA_PASS; \ |
733 | rm .tmp_kallsyms* ; /bin/false ) | 731 | rm .tmp_kallsyms* ; /bin/false ) |
734 | endef | 732 | endef |
735 | 733 | ||
736 | # Update vmlinux version before link | 734 | # Update vmlinux version before link |
737 | # Use + in front of this rule to silent warning about make -j1 | 735 | # Use + in front of this rule to silent warning about make -j1 |
738 | # First command is ':' to allow us to use + in front of this rule | 736 | # First command is ':' to allow us to use + in front of this rule |
739 | cmd_ksym_ld = $(cmd_vmlinux__) | 737 | cmd_ksym_ld = $(cmd_vmlinux__) |
740 | define rule_ksym_ld | 738 | define rule_ksym_ld |
741 | : | 739 | : |
742 | +$(call cmd,vmlinux_version) | 740 | +$(call cmd,vmlinux_version) |
743 | $(call cmd,vmlinux__) | 741 | $(call cmd,vmlinux__) |
744 | $(Q)echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd | 742 | $(Q)echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd |
745 | endef | 743 | endef |
746 | 744 | ||
747 | # Generate .S file with all kernel symbols | 745 | # Generate .S file with all kernel symbols |
748 | quiet_cmd_kallsyms = KSYM $@ | 746 | quiet_cmd_kallsyms = KSYM $@ |
749 | cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) \ | 747 | cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) \ |
750 | $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) > $@ | 748 | $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) > $@ |
751 | 749 | ||
752 | .tmp_kallsyms1.o .tmp_kallsyms2.o .tmp_kallsyms3.o: %.o: %.S scripts FORCE | 750 | .tmp_kallsyms1.o .tmp_kallsyms2.o .tmp_kallsyms3.o: %.o: %.S scripts FORCE |
753 | $(call if_changed_dep,as_o_S) | 751 | $(call if_changed_dep,as_o_S) |
754 | 752 | ||
755 | .tmp_kallsyms%.S: .tmp_vmlinux% $(KALLSYMS) | 753 | .tmp_kallsyms%.S: .tmp_vmlinux% $(KALLSYMS) |
756 | $(call cmd,kallsyms) | 754 | $(call cmd,kallsyms) |
757 | 755 | ||
758 | # .tmp_vmlinux1 must be complete except kallsyms, so update vmlinux version | 756 | # .tmp_vmlinux1 must be complete except kallsyms, so update vmlinux version |
759 | .tmp_vmlinux1: $(vmlinux-lds) $(vmlinux-all) FORCE | 757 | .tmp_vmlinux1: $(vmlinux-lds) $(vmlinux-all) FORCE |
760 | $(call if_changed_rule,ksym_ld) | 758 | $(call if_changed_rule,ksym_ld) |
761 | 759 | ||
762 | .tmp_vmlinux2: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms1.o FORCE | 760 | .tmp_vmlinux2: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms1.o FORCE |
763 | $(call if_changed,vmlinux__) | 761 | $(call if_changed,vmlinux__) |
764 | 762 | ||
765 | .tmp_vmlinux3: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms2.o FORCE | 763 | .tmp_vmlinux3: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms2.o FORCE |
766 | $(call if_changed,vmlinux__) | 764 | $(call if_changed,vmlinux__) |
767 | 765 | ||
768 | # Needs to visit scripts/ before $(KALLSYMS) can be used. | 766 | # Needs to visit scripts/ before $(KALLSYMS) can be used. |
769 | $(KALLSYMS): scripts ; | 767 | $(KALLSYMS): scripts ; |
770 | 768 | ||
771 | # Generate some data for debugging strange kallsyms problems | 769 | # Generate some data for debugging strange kallsyms problems |
772 | debug_kallsyms: .tmp_map$(last_kallsyms) | 770 | debug_kallsyms: .tmp_map$(last_kallsyms) |
773 | 771 | ||
774 | .tmp_map%: .tmp_vmlinux% FORCE | 772 | .tmp_map%: .tmp_vmlinux% FORCE |
775 | ($(OBJDUMP) -h $< | $(AWK) '/^ +[0-9]/{print $$4 " 0 " $$2}'; $(NM) $<) | sort > $@ | 773 | ($(OBJDUMP) -h $< | $(AWK) '/^ +[0-9]/{print $$4 " 0 " $$2}'; $(NM) $<) | sort > $@ |
776 | 774 | ||
777 | .tmp_map3: .tmp_map2 | 775 | .tmp_map3: .tmp_map2 |
778 | 776 | ||
779 | .tmp_map2: .tmp_map1 | 777 | .tmp_map2: .tmp_map1 |
780 | 778 | ||
781 | endif # ifdef CONFIG_KALLSYMS | 779 | endif # ifdef CONFIG_KALLSYMS |
782 | 780 | ||
783 | # Do modpost on a prelinked vmlinux. The finally linked vmlinux has | 781 | # Do modpost on a prelinked vmlinux. The finally linked vmlinux has |
784 | # relevant sections renamed as per the linker script. | 782 | # relevant sections renamed as per the linker script. |
785 | quiet_cmd_vmlinux-modpost = LD $@ | 783 | quiet_cmd_vmlinux-modpost = LD $@ |
786 | cmd_vmlinux-modpost = $(LD) $(LDFLAGS) -r -o $@ \ | 784 | cmd_vmlinux-modpost = $(LD) $(LDFLAGS) -r -o $@ \ |
787 | $(vmlinux-init) --start-group $(vmlinux-main) --end-group \ | 785 | $(vmlinux-init) --start-group $(vmlinux-main) --end-group \ |
788 | $(filter-out $(vmlinux-init) $(vmlinux-main) $(vmlinux-lds) FORCE ,$^) | 786 | $(filter-out $(vmlinux-init) $(vmlinux-main) $(vmlinux-lds) FORCE ,$^) |
789 | define rule_vmlinux-modpost | 787 | define rule_vmlinux-modpost |
790 | : | 788 | : |
791 | +$(call cmd,vmlinux-modpost) | 789 | +$(call cmd,vmlinux-modpost) |
792 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $@ | 790 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $@ |
793 | $(Q)echo 'cmd_$@ := $(cmd_vmlinux-modpost)' > $(dot-target).cmd | 791 | $(Q)echo 'cmd_$@ := $(cmd_vmlinux-modpost)' > $(dot-target).cmd |
794 | endef | 792 | endef |
795 | 793 | ||
796 | # vmlinux image - including updated kernel symbols | 794 | # vmlinux image - including updated kernel symbols |
797 | vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) vmlinux.o FORCE | 795 | vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) vmlinux.o FORCE |
798 | ifdef CONFIG_HEADERS_CHECK | 796 | ifdef CONFIG_HEADERS_CHECK |
799 | $(Q)$(MAKE) -f $(srctree)/Makefile headers_check | 797 | $(Q)$(MAKE) -f $(srctree)/Makefile headers_check |
800 | endif | 798 | endif |
801 | ifdef CONFIG_SAMPLES | 799 | ifdef CONFIG_SAMPLES |
802 | $(Q)$(MAKE) $(build)=samples | 800 | $(Q)$(MAKE) $(build)=samples |
803 | endif | 801 | endif |
804 | $(call vmlinux-modpost) | 802 | $(call vmlinux-modpost) |
805 | $(call if_changed_rule,vmlinux__) | 803 | $(call if_changed_rule,vmlinux__) |
806 | $(Q)rm -f .old_version | 804 | $(Q)rm -f .old_version |
807 | 805 | ||
808 | vmlinux.o: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE | 806 | vmlinux.o: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE |
809 | $(call if_changed_rule,vmlinux-modpost) | 807 | $(call if_changed_rule,vmlinux-modpost) |
810 | 808 | ||
811 | # The actual objects are generated when descending, | 809 | # The actual objects are generated when descending, |
812 | # make sure no implicit rule kicks in | 810 | # make sure no implicit rule kicks in |
813 | $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ; | 811 | $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ; |
814 | 812 | ||
815 | # Handle descending into subdirectories listed in $(vmlinux-dirs) | 813 | # Handle descending into subdirectories listed in $(vmlinux-dirs) |
816 | # Preset locale variables to speed up the build process. Limit locale | 814 | # Preset locale variables to speed up the build process. Limit locale |
817 | # tweaks to this spot to avoid wrong language settings when running | 815 | # tweaks to this spot to avoid wrong language settings when running |
818 | # make menuconfig etc. | 816 | # make menuconfig etc. |
819 | # Error messages still appears in the original language | 817 | # Error messages still appears in the original language |
820 | 818 | ||
821 | PHONY += $(vmlinux-dirs) | 819 | PHONY += $(vmlinux-dirs) |
822 | $(vmlinux-dirs): prepare scripts | 820 | $(vmlinux-dirs): prepare scripts |
823 | $(Q)$(MAKE) $(build)=$@ | 821 | $(Q)$(MAKE) $(build)=$@ |
824 | 822 | ||
825 | # Build the kernel release string | 823 | # Build the kernel release string |
826 | # | 824 | # |
827 | # The KERNELRELEASE value built here is stored in the file | 825 | # The KERNELRELEASE value built here is stored in the file |
828 | # include/config/kernel.release, and is used when executing several | 826 | # include/config/kernel.release, and is used when executing several |
829 | # make targets, such as "make install" or "make modules_install." | 827 | # make targets, such as "make install" or "make modules_install." |
830 | # | 828 | # |
831 | # The eventual kernel release string consists of the following fields, | 829 | # The eventual kernel release string consists of the following fields, |
832 | # shown in a hierarchical format to show how smaller parts are concatenated | 830 | # shown in a hierarchical format to show how smaller parts are concatenated |
833 | # to form the larger and final value, with values coming from places like | 831 | # to form the larger and final value, with values coming from places like |
834 | # the Makefile, kernel config options, make command line options and/or | 832 | # the Makefile, kernel config options, make command line options and/or |
835 | # SCM tag information. | 833 | # SCM tag information. |
836 | # | 834 | # |
837 | # $(KERNELVERSION) | 835 | # $(KERNELVERSION) |
838 | # $(VERSION) eg, 2 | 836 | # $(VERSION) eg, 2 |
839 | # $(PATCHLEVEL) eg, 6 | 837 | # $(PATCHLEVEL) eg, 6 |
840 | # $(SUBLEVEL) eg, 18 | 838 | # $(SUBLEVEL) eg, 18 |
841 | # $(EXTRAVERSION) eg, -rc6 | 839 | # $(EXTRAVERSION) eg, -rc6 |
842 | # $(localver-full) | 840 | # $(localver-full) |
843 | # $(localver) | 841 | # $(localver) |
844 | # localversion* (files without backups, containing '~') | 842 | # localversion* (files without backups, containing '~') |
845 | # $(CONFIG_LOCALVERSION) (from kernel config setting) | 843 | # $(CONFIG_LOCALVERSION) (from kernel config setting) |
846 | # $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is set) | 844 | # $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is set) |
847 | # ./scripts/setlocalversion (SCM tag, if one exists) | 845 | # ./scripts/setlocalversion (SCM tag, if one exists) |
848 | # $(LOCALVERSION) (from make command line if provided) | 846 | # $(LOCALVERSION) (from make command line if provided) |
849 | # | 847 | # |
850 | # Note how the final $(localver-auto) string is included *only* if the | 848 | # Note how the final $(localver-auto) string is included *only* if the |
851 | # kernel config option CONFIG_LOCALVERSION_AUTO is selected. Also, at the | 849 | # kernel config option CONFIG_LOCALVERSION_AUTO is selected. Also, at the |
852 | # moment, only git is supported but other SCMs can edit the script | 850 | # moment, only git is supported but other SCMs can edit the script |
853 | # scripts/setlocalversion and add the appropriate checks as needed. | 851 | # scripts/setlocalversion and add the appropriate checks as needed. |
854 | 852 | ||
855 | pattern = ".*/localversion[^~]*" | 853 | pattern = ".*/localversion[^~]*" |
856 | string = $(shell cat /dev/null \ | 854 | string = $(shell cat /dev/null \ |
857 | `find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort -u`) | 855 | `find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort -u`) |
858 | 856 | ||
859 | localver = $(subst $(space),, $(string) \ | 857 | localver = $(subst $(space),, $(string) \ |
860 | $(patsubst "%",%,$(CONFIG_LOCALVERSION))) | 858 | $(patsubst "%",%,$(CONFIG_LOCALVERSION))) |
861 | 859 | ||
862 | # If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called | 860 | # If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called |
863 | # and if the SCM is know a tag from the SCM is appended. | 861 | # and if the SCM is know a tag from the SCM is appended. |
864 | # The appended tag is determined by the SCM used. | 862 | # The appended tag is determined by the SCM used. |
865 | # | 863 | # |
866 | # Currently, only git is supported. | 864 | # Currently, only git is supported. |
867 | # Other SCMs can edit scripts/setlocalversion and add the appropriate | 865 | # Other SCMs can edit scripts/setlocalversion and add the appropriate |
868 | # checks as needed. | 866 | # checks as needed. |
869 | ifdef CONFIG_LOCALVERSION_AUTO | 867 | ifdef CONFIG_LOCALVERSION_AUTO |
870 | _localver-auto = $(shell $(CONFIG_SHELL) \ | 868 | _localver-auto = $(shell $(CONFIG_SHELL) \ |
871 | $(srctree)/scripts/setlocalversion $(srctree)) | 869 | $(srctree)/scripts/setlocalversion $(srctree)) |
872 | localver-auto = $(LOCALVERSION)$(_localver-auto) | 870 | localver-auto = $(LOCALVERSION)$(_localver-auto) |
873 | endif | 871 | endif |
874 | 872 | ||
875 | localver-full = $(localver)$(localver-auto) | 873 | localver-full = $(localver)$(localver-auto) |
876 | 874 | ||
877 | # Store (new) KERNELRELASE string in include/config/kernel.release | 875 | # Store (new) KERNELRELASE string in include/config/kernel.release |
878 | kernelrelease = $(KERNELVERSION)$(localver-full) | 876 | kernelrelease = $(KERNELVERSION)$(localver-full) |
879 | include/config/kernel.release: include/config/auto.conf FORCE | 877 | include/config/kernel.release: include/config/auto.conf FORCE |
880 | $(Q)rm -f $@ | 878 | $(Q)rm -f $@ |
881 | $(Q)echo $(kernelrelease) > $@ | 879 | $(Q)echo $(kernelrelease) > $@ |
882 | 880 | ||
883 | 881 | ||
884 | # Things we need to do before we recursively start building the kernel | 882 | # Things we need to do before we recursively start building the kernel |
885 | # or the modules are listed in "prepare". | 883 | # or the modules are listed in "prepare". |
886 | # A multi level approach is used. prepareN is processed before prepareN-1. | 884 | # A multi level approach is used. prepareN is processed before prepareN-1. |
887 | # archprepare is used in arch Makefiles and when processed asm symlink, | 885 | # archprepare is used in arch Makefiles and when processed asm symlink, |
888 | # version.h and scripts_basic is processed / created. | 886 | # version.h and scripts_basic is processed / created. |
889 | 887 | ||
890 | # Listed in dependency order | 888 | # Listed in dependency order |
891 | PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3 | 889 | PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3 |
892 | 890 | ||
893 | # prepare3 is used to check if we are building in a separate output directory, | 891 | # prepare3 is used to check if we are building in a separate output directory, |
894 | # and if so do: | 892 | # and if so do: |
895 | # 1) Check that make has not been executed in the kernel src $(srctree) | 893 | # 1) Check that make has not been executed in the kernel src $(srctree) |
896 | # 2) Create the include2 directory, used for the second asm symlink | 894 | # 2) Create the include2 directory, used for the second asm symlink |
897 | prepare3: include/config/kernel.release | 895 | prepare3: include/config/kernel.release |
898 | ifneq ($(KBUILD_SRC),) | 896 | ifneq ($(KBUILD_SRC),) |
899 | @echo ' Using $(srctree) as source for kernel' | 897 | @echo ' Using $(srctree) as source for kernel' |
900 | $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \ | 898 | $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \ |
901 | echo " $(srctree) is not clean, please run 'make mrproper'";\ | 899 | echo " $(srctree) is not clean, please run 'make mrproper'";\ |
902 | echo " in the '$(srctree)' directory.";\ | 900 | echo " in the '$(srctree)' directory.";\ |
903 | /bin/false; \ | 901 | /bin/false; \ |
904 | fi; | 902 | fi; |
905 | $(Q)if [ ! -d include2 ]; then mkdir -p include2; fi; | 903 | $(Q)if [ ! -d include2 ]; then mkdir -p include2; fi; |
906 | $(Q)ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm | 904 | $(Q)ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm |
907 | endif | 905 | endif |
908 | 906 | ||
909 | # prepare2 creates a makefile if using a separate output directory | 907 | # prepare2 creates a makefile if using a separate output directory |
910 | prepare2: prepare3 outputmakefile | 908 | prepare2: prepare3 outputmakefile |
911 | 909 | ||
912 | prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ | 910 | prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ |
913 | include/asm include/config/auto.conf | 911 | include/asm include/config/auto.conf |
914 | $(cmd_crmodverdir) | 912 | $(cmd_crmodverdir) |
915 | 913 | ||
916 | archprepare: prepare1 scripts_basic | 914 | archprepare: prepare1 scripts_basic |
917 | 915 | ||
918 | prepare0: archprepare FORCE | 916 | prepare0: archprepare FORCE |
919 | $(Q)$(MAKE) $(build)=. | 917 | $(Q)$(MAKE) $(build)=. |
920 | $(Q)$(MAKE) $(build)=. missing-syscalls | 918 | $(Q)$(MAKE) $(build)=. missing-syscalls |
921 | 919 | ||
922 | # All the preparing.. | 920 | # All the preparing.. |
923 | prepare: prepare0 | 921 | prepare: prepare0 |
924 | 922 | ||
925 | # Leave this as default for preprocessing vmlinux.lds.S, which is now | 923 | # Leave this as default for preprocessing vmlinux.lds.S, which is now |
926 | # done in arch/$(ARCH)/kernel/Makefile | 924 | # done in arch/$(ARCH)/kernel/Makefile |
927 | 925 | ||
928 | export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH) | 926 | export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH) |
929 | 927 | ||
930 | # The asm symlink changes when $(ARCH) changes. | 928 | # The asm symlink changes when $(ARCH) changes. |
931 | # Detect this and ask user to run make mrproper | 929 | # Detect this and ask user to run make mrproper |
932 | 930 | ||
933 | include/asm: FORCE | 931 | include/asm: FORCE |
934 | $(Q)set -e; asmlink=`readlink include/asm | cut -d '-' -f 2`; \ | 932 | $(Q)set -e; asmlink=`readlink include/asm | cut -d '-' -f 2`; \ |
935 | if [ -L include/asm ]; then \ | 933 | if [ -L include/asm ]; then \ |
936 | if [ "$$asmlink" != "$(SRCARCH)" ]; then \ | 934 | if [ "$$asmlink" != "$(SRCARCH)" ]; then \ |
937 | echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \ | 935 | echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \ |
938 | echo " set ARCH or save .config and run 'make mrproper' to fix it"; \ | 936 | echo " set ARCH or save .config and run 'make mrproper' to fix it"; \ |
939 | exit 1; \ | 937 | exit 1; \ |
940 | fi; \ | 938 | fi; \ |
941 | else \ | 939 | else \ |
942 | echo ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \ | 940 | echo ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \ |
943 | if [ ! -d include ]; then \ | 941 | if [ ! -d include ]; then \ |
944 | mkdir -p include; \ | 942 | mkdir -p include; \ |
945 | fi; \ | 943 | fi; \ |
946 | ln -fsn asm-$(SRCARCH) $@; \ | 944 | ln -fsn asm-$(SRCARCH) $@; \ |
947 | fi | 945 | fi |
948 | 946 | ||
949 | # Generate some files | 947 | # Generate some files |
950 | # --------------------------------------------------------------------------- | 948 | # --------------------------------------------------------------------------- |
951 | 949 | ||
952 | # KERNELRELEASE can change from a few different places, meaning version.h | 950 | # KERNELRELEASE can change from a few different places, meaning version.h |
953 | # needs to be updated, so this check is forced on all builds | 951 | # needs to be updated, so this check is forced on all builds |
954 | 952 | ||
955 | uts_len := 64 | 953 | uts_len := 64 |
956 | define filechk_utsrelease.h | 954 | define filechk_utsrelease.h |
957 | if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \ | 955 | if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \ |
958 | echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ | 956 | echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ |
959 | exit 1; \ | 957 | exit 1; \ |
960 | fi; \ | 958 | fi; \ |
961 | (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";) | 959 | (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";) |
962 | endef | 960 | endef |
963 | 961 | ||
964 | define filechk_version.h | 962 | define filechk_version.h |
965 | (echo \#define LINUX_VERSION_CODE $(shell \ | 963 | (echo \#define LINUX_VERSION_CODE $(shell \ |
966 | expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \ | 964 | expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \ |
967 | echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) | 965 | echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) |
968 | endef | 966 | endef |
969 | 967 | ||
970 | include/linux/version.h: $(srctree)/Makefile FORCE | 968 | include/linux/version.h: $(srctree)/Makefile FORCE |
971 | $(call filechk,version.h) | 969 | $(call filechk,version.h) |
972 | 970 | ||
973 | include/linux/utsrelease.h: include/config/kernel.release FORCE | 971 | include/linux/utsrelease.h: include/config/kernel.release FORCE |
974 | $(call filechk,utsrelease.h) | 972 | $(call filechk,utsrelease.h) |
975 | 973 | ||
976 | # --------------------------------------------------------------------------- | 974 | # --------------------------------------------------------------------------- |
977 | 975 | ||
978 | PHONY += depend dep | 976 | PHONY += depend dep |
979 | depend dep: | 977 | depend dep: |
980 | @echo '*** Warning: make $@ is unnecessary now.' | 978 | @echo '*** Warning: make $@ is unnecessary now.' |
981 | 979 | ||
982 | # --------------------------------------------------------------------------- | 980 | # --------------------------------------------------------------------------- |
983 | # Kernel headers | 981 | # Kernel headers |
984 | INSTALL_HDR_PATH=$(objtree)/usr | 982 | INSTALL_HDR_PATH=$(objtree)/usr |
985 | export INSTALL_HDR_PATH | 983 | export INSTALL_HDR_PATH |
986 | 984 | ||
987 | HDRFILTER=generic i386 x86_64 | 985 | HDRFILTER=generic i386 x86_64 |
988 | HDRARCHES=$(filter-out $(HDRFILTER),$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild))) | 986 | HDRARCHES=$(filter-out $(HDRFILTER),$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild))) |
989 | 987 | ||
990 | PHONY += headers_install_all | 988 | PHONY += headers_install_all |
991 | headers_install_all: include/linux/version.h scripts_basic FORCE | 989 | headers_install_all: include/linux/version.h scripts_basic FORCE |
992 | $(Q)$(MAKE) $(build)=scripts scripts/unifdef | 990 | $(Q)$(MAKE) $(build)=scripts scripts/unifdef |
993 | $(Q)for arch in $(HDRARCHES); do \ | 991 | $(Q)for arch in $(HDRARCHES); do \ |
994 | $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch ;\ | 992 | $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch ;\ |
995 | done | 993 | done |
996 | 994 | ||
997 | PHONY += headers_install | 995 | PHONY += headers_install |
998 | headers_install: include/linux/version.h scripts_basic FORCE | 996 | headers_install: include/linux/version.h scripts_basic FORCE |
999 | @if [ ! -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ | 997 | @if [ ! -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ |
1000 | echo '*** Error: Headers not exportable for this architecture ($(SRCARCH))'; \ | 998 | echo '*** Error: Headers not exportable for this architecture ($(SRCARCH))'; \ |
1001 | exit 1 ; fi | 999 | exit 1 ; fi |
1002 | $(Q)$(MAKE) $(build)=scripts scripts/unifdef | 1000 | $(Q)$(MAKE) $(build)=scripts scripts/unifdef |
1003 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst ARCH=$(SRCARCH) obj=include | 1001 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst ARCH=$(SRCARCH) obj=include |
1004 | 1002 | ||
1005 | PHONY += headers_check_all | 1003 | PHONY += headers_check_all |
1006 | headers_check_all: headers_install_all | 1004 | headers_check_all: headers_install_all |
1007 | $(Q)for arch in $(HDRARCHES); do \ | 1005 | $(Q)for arch in $(HDRARCHES); do \ |
1008 | $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch HDRCHECK=1 ;\ | 1006 | $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch HDRCHECK=1 ;\ |
1009 | done | 1007 | done |
1010 | 1008 | ||
1011 | PHONY += headers_check | 1009 | PHONY += headers_check |
1012 | headers_check: headers_install | 1010 | headers_check: headers_install |
1013 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst ARCH=$(SRCARCH) obj=include HDRCHECK=1 | 1011 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst ARCH=$(SRCARCH) obj=include HDRCHECK=1 |
1014 | 1012 | ||
1015 | # --------------------------------------------------------------------------- | 1013 | # --------------------------------------------------------------------------- |
1016 | # Modules | 1014 | # Modules |
1017 | 1015 | ||
1018 | ifdef CONFIG_MODULES | 1016 | ifdef CONFIG_MODULES |
1019 | 1017 | ||
1020 | # By default, build modules as well | 1018 | # By default, build modules as well |
1021 | 1019 | ||
1022 | all: modules | 1020 | all: modules |
1023 | 1021 | ||
1024 | # Build modules | 1022 | # Build modules |
1025 | 1023 | ||
1026 | PHONY += modules | 1024 | PHONY += modules |
1027 | modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) | 1025 | modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) |
1028 | @echo ' Building modules, stage 2.'; | 1026 | @echo ' Building modules, stage 2.'; |
1029 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost | 1027 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost |
1030 | 1028 | ||
1031 | 1029 | ||
1032 | # Target to prepare building external modules | 1030 | # Target to prepare building external modules |
1033 | PHONY += modules_prepare | 1031 | PHONY += modules_prepare |
1034 | modules_prepare: prepare scripts | 1032 | modules_prepare: prepare scripts |
1035 | 1033 | ||
1036 | # Target to install modules | 1034 | # Target to install modules |
1037 | PHONY += modules_install | 1035 | PHONY += modules_install |
1038 | modules_install: _modinst_ _modinst_post | 1036 | modules_install: _modinst_ _modinst_post |
1039 | 1037 | ||
1040 | PHONY += _modinst_ | 1038 | PHONY += _modinst_ |
1041 | _modinst_: | 1039 | _modinst_: |
1042 | @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \ | 1040 | @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \ |
1043 | echo "Warning: you may need to install module-init-tools"; \ | 1041 | echo "Warning: you may need to install module-init-tools"; \ |
1044 | echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\ | 1042 | echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\ |
1045 | sleep 1; \ | 1043 | sleep 1; \ |
1046 | fi | 1044 | fi |
1047 | @rm -rf $(MODLIB)/kernel | 1045 | @rm -rf $(MODLIB)/kernel |
1048 | @rm -f $(MODLIB)/source | 1046 | @rm -f $(MODLIB)/source |
1049 | @mkdir -p $(MODLIB)/kernel | 1047 | @mkdir -p $(MODLIB)/kernel |
1050 | @ln -s $(srctree) $(MODLIB)/source | 1048 | @ln -s $(srctree) $(MODLIB)/source |
1051 | @if [ ! $(objtree) -ef $(MODLIB)/build ]; then \ | 1049 | @if [ ! $(objtree) -ef $(MODLIB)/build ]; then \ |
1052 | rm -f $(MODLIB)/build ; \ | 1050 | rm -f $(MODLIB)/build ; \ |
1053 | ln -s $(objtree) $(MODLIB)/build ; \ | 1051 | ln -s $(objtree) $(MODLIB)/build ; \ |
1054 | fi | 1052 | fi |
1055 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst | 1053 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst |
1056 | 1054 | ||
1057 | # This depmod is only for convenience to give the initial | 1055 | # This depmod is only for convenience to give the initial |
1058 | # boot a modules.dep even before / is mounted read-write. However the | 1056 | # boot a modules.dep even before / is mounted read-write. However the |
1059 | # boot script depmod is the master version. | 1057 | # boot script depmod is the master version. |
1060 | PHONY += _modinst_post | 1058 | PHONY += _modinst_post |
1061 | _modinst_post: _modinst_ | 1059 | _modinst_post: _modinst_ |
1062 | $(call cmd,depmod) | 1060 | $(call cmd,depmod) |
1063 | 1061 | ||
1064 | else # CONFIG_MODULES | 1062 | else # CONFIG_MODULES |
1065 | 1063 | ||
1066 | # Modules not configured | 1064 | # Modules not configured |
1067 | # --------------------------------------------------------------------------- | 1065 | # --------------------------------------------------------------------------- |
1068 | 1066 | ||
1069 | modules modules_install: FORCE | 1067 | modules modules_install: FORCE |
1070 | @echo | 1068 | @echo |
1071 | @echo "The present kernel configuration has modules disabled." | 1069 | @echo "The present kernel configuration has modules disabled." |
1072 | @echo "Type 'make config' and enable loadable module support." | 1070 | @echo "Type 'make config' and enable loadable module support." |
1073 | @echo "Then build a kernel with module support enabled." | 1071 | @echo "Then build a kernel with module support enabled." |
1074 | @echo | 1072 | @echo |
1075 | @exit 1 | 1073 | @exit 1 |
1076 | 1074 | ||
1077 | endif # CONFIG_MODULES | 1075 | endif # CONFIG_MODULES |
1078 | 1076 | ||
1079 | ### | 1077 | ### |
1080 | # Cleaning is done on three levels. | 1078 | # Cleaning is done on three levels. |
1081 | # make clean Delete most generated files | 1079 | # make clean Delete most generated files |
1082 | # Leave enough to build external modules | 1080 | # Leave enough to build external modules |
1083 | # make mrproper Delete the current configuration, and all generated files | 1081 | # make mrproper Delete the current configuration, and all generated files |
1084 | # make distclean Remove editor backup files, patch leftover files and the like | 1082 | # make distclean Remove editor backup files, patch leftover files and the like |
1085 | 1083 | ||
1086 | # Directories & files removed with 'make clean' | 1084 | # Directories & files removed with 'make clean' |
1087 | CLEAN_DIRS += $(MODVERDIR) | 1085 | CLEAN_DIRS += $(MODVERDIR) |
1088 | CLEAN_FILES += vmlinux System.map \ | 1086 | CLEAN_FILES += vmlinux System.map \ |
1089 | .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map | 1087 | .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map |
1090 | 1088 | ||
1091 | # Directories & files removed with 'make mrproper' | 1089 | # Directories & files removed with 'make mrproper' |
1092 | MRPROPER_DIRS += include/config include2 usr/include | 1090 | MRPROPER_DIRS += include/config include2 usr/include |
1093 | MRPROPER_FILES += .config .config.old include/asm .version .old_version \ | 1091 | MRPROPER_FILES += .config .config.old include/asm .version .old_version \ |
1094 | include/linux/autoconf.h include/linux/version.h \ | 1092 | include/linux/autoconf.h include/linux/version.h \ |
1095 | include/linux/utsrelease.h \ | 1093 | include/linux/utsrelease.h \ |
1096 | Module.symvers tags TAGS cscope* | 1094 | Module.symvers tags TAGS cscope* |
1097 | 1095 | ||
1098 | # clean - Delete most, but leave enough to build external modules | 1096 | # clean - Delete most, but leave enough to build external modules |
1099 | # | 1097 | # |
1100 | clean: rm-dirs := $(CLEAN_DIRS) | 1098 | clean: rm-dirs := $(CLEAN_DIRS) |
1101 | clean: rm-files := $(CLEAN_FILES) | 1099 | clean: rm-files := $(CLEAN_FILES) |
1102 | clean-dirs := $(addprefix _clean_,$(srctree) $(vmlinux-alldirs)) | 1100 | clean-dirs := $(addprefix _clean_,$(srctree) $(vmlinux-alldirs)) |
1103 | 1101 | ||
1104 | PHONY += $(clean-dirs) clean archclean | 1102 | PHONY += $(clean-dirs) clean archclean |
1105 | $(clean-dirs): | 1103 | $(clean-dirs): |
1106 | $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) | 1104 | $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) |
1107 | 1105 | ||
1108 | clean: archclean $(clean-dirs) | 1106 | clean: archclean $(clean-dirs) |
1109 | $(call cmd,rmdirs) | 1107 | $(call cmd,rmdirs) |
1110 | $(call cmd,rmfiles) | 1108 | $(call cmd,rmfiles) |
1111 | @find . $(RCS_FIND_IGNORE) \ | 1109 | @find . $(RCS_FIND_IGNORE) \ |
1112 | \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ | 1110 | \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ |
1113 | -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ | 1111 | -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ |
1114 | -o -name '*.symtypes' \) \ | 1112 | -o -name '*.symtypes' \) \ |
1115 | -type f -print | xargs rm -f | 1113 | -type f -print | xargs rm -f |
1116 | 1114 | ||
1117 | # mrproper - Delete all generated files, including .config | 1115 | # mrproper - Delete all generated files, including .config |
1118 | # | 1116 | # |
1119 | mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS)) | 1117 | mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS)) |
1120 | mrproper: rm-files := $(wildcard $(MRPROPER_FILES)) | 1118 | mrproper: rm-files := $(wildcard $(MRPROPER_FILES)) |
1121 | mrproper-dirs := $(addprefix _mrproper_,Documentation/DocBook scripts) | 1119 | mrproper-dirs := $(addprefix _mrproper_,Documentation/DocBook scripts) |
1122 | 1120 | ||
1123 | PHONY += $(mrproper-dirs) mrproper archmrproper | 1121 | PHONY += $(mrproper-dirs) mrproper archmrproper |
1124 | $(mrproper-dirs): | 1122 | $(mrproper-dirs): |
1125 | $(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@) | 1123 | $(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@) |
1126 | 1124 | ||
1127 | mrproper: clean archmrproper $(mrproper-dirs) | 1125 | mrproper: clean archmrproper $(mrproper-dirs) |
1128 | $(call cmd,rmdirs) | 1126 | $(call cmd,rmdirs) |
1129 | $(call cmd,rmfiles) | 1127 | $(call cmd,rmfiles) |
1130 | 1128 | ||
1131 | # distclean | 1129 | # distclean |
1132 | # | 1130 | # |
1133 | PHONY += distclean | 1131 | PHONY += distclean |
1134 | 1132 | ||
1135 | distclean: mrproper | 1133 | distclean: mrproper |
1136 | @find $(srctree) $(RCS_FIND_IGNORE) \ | 1134 | @find $(srctree) $(RCS_FIND_IGNORE) \ |
1137 | \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ | 1135 | \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ |
1138 | -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ | 1136 | -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ |
1139 | -o -name '.*.rej' -o -size 0 \ | 1137 | -o -name '.*.rej' -o -size 0 \ |
1140 | -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ | 1138 | -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ |
1141 | -type f -print | xargs rm -f | 1139 | -type f -print | xargs rm -f |
1142 | 1140 | ||
1143 | 1141 | ||
1144 | # Packaging of the kernel to various formats | 1142 | # Packaging of the kernel to various formats |
1145 | # --------------------------------------------------------------------------- | 1143 | # --------------------------------------------------------------------------- |
1146 | # rpm target kept for backward compatibility | 1144 | # rpm target kept for backward compatibility |
1147 | package-dir := $(srctree)/scripts/package | 1145 | package-dir := $(srctree)/scripts/package |
1148 | 1146 | ||
1149 | %pkg: include/config/kernel.release FORCE | 1147 | %pkg: include/config/kernel.release FORCE |
1150 | $(Q)$(MAKE) $(build)=$(package-dir) $@ | 1148 | $(Q)$(MAKE) $(build)=$(package-dir) $@ |
1151 | rpm: include/config/kernel.release FORCE | 1149 | rpm: include/config/kernel.release FORCE |
1152 | $(Q)$(MAKE) $(build)=$(package-dir) $@ | 1150 | $(Q)$(MAKE) $(build)=$(package-dir) $@ |
1153 | 1151 | ||
1154 | 1152 | ||
1155 | # Brief documentation of the typical targets used | 1153 | # Brief documentation of the typical targets used |
1156 | # --------------------------------------------------------------------------- | 1154 | # --------------------------------------------------------------------------- |
1157 | 1155 | ||
1158 | boards := $(wildcard $(srctree)/arch/$(ARCH)/configs/*_defconfig) | 1156 | boards := $(wildcard $(srctree)/arch/$(ARCH)/configs/*_defconfig) |
1159 | boards := $(notdir $(boards)) | 1157 | boards := $(notdir $(boards)) |
1160 | 1158 | ||
1161 | help: | 1159 | help: |
1162 | @echo 'Cleaning targets:' | 1160 | @echo 'Cleaning targets:' |
1163 | @echo ' clean - Remove most generated files but keep the config and' | 1161 | @echo ' clean - Remove most generated files but keep the config and' |
1164 | @echo ' enough build support to build external modules' | 1162 | @echo ' enough build support to build external modules' |
1165 | @echo ' mrproper - Remove all generated files + config + various backup files' | 1163 | @echo ' mrproper - Remove all generated files + config + various backup files' |
1166 | @echo ' distclean - mrproper + remove editor backup and patch files' | 1164 | @echo ' distclean - mrproper + remove editor backup and patch files' |
1167 | @echo '' | 1165 | @echo '' |
1168 | @echo 'Configuration targets:' | 1166 | @echo 'Configuration targets:' |
1169 | @$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help | 1167 | @$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help |
1170 | @echo '' | 1168 | @echo '' |
1171 | @echo 'Other generic targets:' | 1169 | @echo 'Other generic targets:' |
1172 | @echo ' all - Build all targets marked with [*]' | 1170 | @echo ' all - Build all targets marked with [*]' |
1173 | @echo '* vmlinux - Build the bare kernel' | 1171 | @echo '* vmlinux - Build the bare kernel' |
1174 | @echo '* modules - Build all modules' | 1172 | @echo '* modules - Build all modules' |
1175 | @echo ' modules_install - Install all modules to INSTALL_MOD_PATH (default: /)' | 1173 | @echo ' modules_install - Install all modules to INSTALL_MOD_PATH (default: /)' |
1176 | @echo ' dir/ - Build all files in dir and below' | 1174 | @echo ' dir/ - Build all files in dir and below' |
1177 | @echo ' dir/file.[ois] - Build specified target only' | 1175 | @echo ' dir/file.[ois] - Build specified target only' |
1178 | @echo ' dir/file.ko - Build module including final link' | 1176 | @echo ' dir/file.ko - Build module including final link' |
1179 | @echo ' rpm - Build a kernel as an RPM package' | 1177 | @echo ' rpm - Build a kernel as an RPM package' |
1180 | @echo ' tags/TAGS - Generate tags file for editors' | 1178 | @echo ' tags/TAGS - Generate tags file for editors' |
1181 | @echo ' cscope - Generate cscope index' | 1179 | @echo ' cscope - Generate cscope index' |
1182 | @echo ' kernelrelease - Output the release version string' | 1180 | @echo ' kernelrelease - Output the release version string' |
1183 | @echo ' kernelversion - Output the version stored in Makefile' | 1181 | @echo ' kernelversion - Output the version stored in Makefile' |
1184 | @if [ -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ | 1182 | @if [ -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ |
1185 | echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \ | 1183 | echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \ |
1186 | echo ' (default: $(INSTALL_HDR_PATH))'; \ | 1184 | echo ' (default: $(INSTALL_HDR_PATH))'; \ |
1187 | fi | 1185 | fi |
1188 | @echo '' | 1186 | @echo '' |
1189 | @echo 'Static analysers' | 1187 | @echo 'Static analysers' |
1190 | @echo ' checkstack - Generate a list of stack hogs' | 1188 | @echo ' checkstack - Generate a list of stack hogs' |
1191 | @echo ' namespacecheck - Name space analysis on compiled kernel' | 1189 | @echo ' namespacecheck - Name space analysis on compiled kernel' |
1192 | @echo ' export_report - List the usages of all exported symbols' | 1190 | @echo ' export_report - List the usages of all exported symbols' |
1193 | @if [ -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ | 1191 | @if [ -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ |
1194 | echo ' headers_check - Sanity check on exported headers'; \ | 1192 | echo ' headers_check - Sanity check on exported headers'; \ |
1195 | fi | 1193 | fi |
1196 | @echo '' | 1194 | @echo '' |
1197 | @echo 'Kernel packaging:' | 1195 | @echo 'Kernel packaging:' |
1198 | @$(MAKE) $(build)=$(package-dir) help | 1196 | @$(MAKE) $(build)=$(package-dir) help |
1199 | @echo '' | 1197 | @echo '' |
1200 | @echo 'Documentation targets:' | 1198 | @echo 'Documentation targets:' |
1201 | @$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp | 1199 | @$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp |
1202 | @echo '' | 1200 | @echo '' |
1203 | @echo 'Architecture specific targets ($(ARCH)):' | 1201 | @echo 'Architecture specific targets ($(ARCH)):' |
1204 | @$(if $(archhelp),$(archhelp),\ | 1202 | @$(if $(archhelp),$(archhelp),\ |
1205 | echo ' No architecture specific help defined for $(ARCH)') | 1203 | echo ' No architecture specific help defined for $(ARCH)') |
1206 | @echo '' | 1204 | @echo '' |
1207 | @$(if $(boards), \ | 1205 | @$(if $(boards), \ |
1208 | $(foreach b, $(boards), \ | 1206 | $(foreach b, $(boards), \ |
1209 | printf " %-24s - Build for %s\\n" $(b) $(subst _defconfig,,$(b));) \ | 1207 | printf " %-24s - Build for %s\\n" $(b) $(subst _defconfig,,$(b));) \ |
1210 | echo '') | 1208 | echo '') |
1211 | 1209 | ||
1212 | @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' | 1210 | @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' |
1213 | @echo ' make V=2 [targets] 2 => give reason for rebuild of target' | 1211 | @echo ' make V=2 [targets] 2 => give reason for rebuild of target' |
1214 | @echo ' make O=dir [targets] Locate all output files in "dir", including .config' | 1212 | @echo ' make O=dir [targets] Locate all output files in "dir", including .config' |
1215 | @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)' | 1213 | @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)' |
1216 | @echo ' make C=2 [targets] Force check of all c source with $$CHECK' | 1214 | @echo ' make C=2 [targets] Force check of all c source with $$CHECK' |
1217 | @echo '' | 1215 | @echo '' |
1218 | @echo 'Execute "make" or "make all" to build all targets marked with [*] ' | 1216 | @echo 'Execute "make" or "make all" to build all targets marked with [*] ' |
1219 | @echo 'For further info see the ./README file' | 1217 | @echo 'For further info see the ./README file' |
1220 | 1218 | ||
1221 | 1219 | ||
1222 | # Documentation targets | 1220 | # Documentation targets |
1223 | # --------------------------------------------------------------------------- | 1221 | # --------------------------------------------------------------------------- |
1224 | %docs: scripts_basic FORCE | 1222 | %docs: scripts_basic FORCE |
1225 | $(Q)$(MAKE) $(build)=Documentation/DocBook $@ | 1223 | $(Q)$(MAKE) $(build)=Documentation/DocBook $@ |
1226 | 1224 | ||
1227 | else # KBUILD_EXTMOD | 1225 | else # KBUILD_EXTMOD |
1228 | 1226 | ||
1229 | ### | 1227 | ### |
1230 | # External module support. | 1228 | # External module support. |
1231 | # When building external modules the kernel used as basis is considered | 1229 | # When building external modules the kernel used as basis is considered |
1232 | # read-only, and no consistency checks are made and the make | 1230 | # read-only, and no consistency checks are made and the make |
1233 | # system is not used on the basis kernel. If updates are required | 1231 | # system is not used on the basis kernel. If updates are required |
1234 | # in the basis kernel ordinary make commands (without M=...) must | 1232 | # in the basis kernel ordinary make commands (without M=...) must |
1235 | # be used. | 1233 | # be used. |
1236 | # | 1234 | # |
1237 | # The following are the only valid targets when building external | 1235 | # The following are the only valid targets when building external |
1238 | # modules. | 1236 | # modules. |
1239 | # make M=dir clean Delete all automatically generated files | 1237 | # make M=dir clean Delete all automatically generated files |
1240 | # make M=dir modules Make all modules in specified dir | 1238 | # make M=dir modules Make all modules in specified dir |
1241 | # make M=dir Same as 'make M=dir modules' | 1239 | # make M=dir Same as 'make M=dir modules' |
1242 | # make M=dir modules_install | 1240 | # make M=dir modules_install |
1243 | # Install the modules built in the module directory | 1241 | # Install the modules built in the module directory |
1244 | # Assumes install directory is already created | 1242 | # Assumes install directory is already created |
1245 | 1243 | ||
1246 | # We are always building modules | 1244 | # We are always building modules |
1247 | KBUILD_MODULES := 1 | 1245 | KBUILD_MODULES := 1 |
1248 | PHONY += crmodverdir | 1246 | PHONY += crmodverdir |
1249 | crmodverdir: | 1247 | crmodverdir: |
1250 | $(cmd_crmodverdir) | 1248 | $(cmd_crmodverdir) |
1251 | 1249 | ||
1252 | PHONY += $(objtree)/Module.symvers | 1250 | PHONY += $(objtree)/Module.symvers |
1253 | $(objtree)/Module.symvers: | 1251 | $(objtree)/Module.symvers: |
1254 | @test -e $(objtree)/Module.symvers || ( \ | 1252 | @test -e $(objtree)/Module.symvers || ( \ |
1255 | echo; \ | 1253 | echo; \ |
1256 | echo " WARNING: Symbol version dump $(objtree)/Module.symvers"; \ | 1254 | echo " WARNING: Symbol version dump $(objtree)/Module.symvers"; \ |
1257 | echo " is missing; modules will have no dependencies and modversions."; \ | 1255 | echo " is missing; modules will have no dependencies and modversions."; \ |
1258 | echo ) | 1256 | echo ) |
1259 | 1257 | ||
1260 | module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD)) | 1258 | module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD)) |
1261 | PHONY += $(module-dirs) modules | 1259 | PHONY += $(module-dirs) modules |
1262 | $(module-dirs): crmodverdir $(objtree)/Module.symvers | 1260 | $(module-dirs): crmodverdir $(objtree)/Module.symvers |
1263 | $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) | 1261 | $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) |
1264 | 1262 | ||
1265 | modules: $(module-dirs) | 1263 | modules: $(module-dirs) |
1266 | @echo ' Building modules, stage 2.'; | 1264 | @echo ' Building modules, stage 2.'; |
1267 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost | 1265 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost |
1268 | 1266 | ||
1269 | PHONY += modules_install | 1267 | PHONY += modules_install |
1270 | modules_install: _emodinst_ _emodinst_post | 1268 | modules_install: _emodinst_ _emodinst_post |
1271 | 1269 | ||
1272 | install-dir := $(if $(INSTALL_MOD_DIR),$(INSTALL_MOD_DIR),extra) | 1270 | install-dir := $(if $(INSTALL_MOD_DIR),$(INSTALL_MOD_DIR),extra) |
1273 | PHONY += _emodinst_ | 1271 | PHONY += _emodinst_ |
1274 | _emodinst_: | 1272 | _emodinst_: |
1275 | $(Q)mkdir -p $(MODLIB)/$(install-dir) | 1273 | $(Q)mkdir -p $(MODLIB)/$(install-dir) |
1276 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst | 1274 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst |
1277 | 1275 | ||
1278 | PHONY += _emodinst_post | 1276 | PHONY += _emodinst_post |
1279 | _emodinst_post: _emodinst_ | 1277 | _emodinst_post: _emodinst_ |
1280 | $(call cmd,depmod) | 1278 | $(call cmd,depmod) |
1281 | 1279 | ||
1282 | clean-dirs := $(addprefix _clean_,$(KBUILD_EXTMOD)) | 1280 | clean-dirs := $(addprefix _clean_,$(KBUILD_EXTMOD)) |
1283 | 1281 | ||
1284 | PHONY += $(clean-dirs) clean | 1282 | PHONY += $(clean-dirs) clean |
1285 | $(clean-dirs): | 1283 | $(clean-dirs): |
1286 | $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) | 1284 | $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) |
1287 | 1285 | ||
1288 | clean: rm-dirs := $(MODVERDIR) | 1286 | clean: rm-dirs := $(MODVERDIR) |
1289 | clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers | 1287 | clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers |
1290 | clean: $(clean-dirs) | 1288 | clean: $(clean-dirs) |
1291 | $(call cmd,rmdirs) | 1289 | $(call cmd,rmdirs) |
1292 | $(call cmd,rmfiles) | 1290 | $(call cmd,rmfiles) |
1293 | @find $(KBUILD_EXTMOD) $(RCS_FIND_IGNORE) \ | 1291 | @find $(KBUILD_EXTMOD) $(RCS_FIND_IGNORE) \ |
1294 | \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ | 1292 | \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ |
1295 | -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \ | 1293 | -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \ |
1296 | -type f -print | xargs rm -f | 1294 | -type f -print | xargs rm -f |
1297 | 1295 | ||
1298 | help: | 1296 | help: |
1299 | @echo ' Building external modules.' | 1297 | @echo ' Building external modules.' |
1300 | @echo ' Syntax: make -C path/to/kernel/src M=$$PWD target' | 1298 | @echo ' Syntax: make -C path/to/kernel/src M=$$PWD target' |
1301 | @echo '' | 1299 | @echo '' |
1302 | @echo ' modules - default target, build the module(s)' | 1300 | @echo ' modules - default target, build the module(s)' |
1303 | @echo ' modules_install - install the module' | 1301 | @echo ' modules_install - install the module' |
1304 | @echo ' clean - remove generated files in module directory only' | 1302 | @echo ' clean - remove generated files in module directory only' |
1305 | @echo '' | 1303 | @echo '' |
1306 | 1304 | ||
1307 | # Dummies... | 1305 | # Dummies... |
1308 | PHONY += prepare scripts | 1306 | PHONY += prepare scripts |
1309 | prepare: ; | 1307 | prepare: ; |
1310 | scripts: ; | 1308 | scripts: ; |
1311 | endif # KBUILD_EXTMOD | 1309 | endif # KBUILD_EXTMOD |
1312 | 1310 | ||
1313 | # Generate tags for editors | 1311 | # Generate tags for editors |
1314 | # --------------------------------------------------------------------------- | 1312 | # --------------------------------------------------------------------------- |
1315 | 1313 | ||
1316 | #We want __srctree to totally vanish out when KBUILD_OUTPUT is not set | 1314 | #We want __srctree to totally vanish out when KBUILD_OUTPUT is not set |
1317 | #(which is the most common case IMHO) to avoid unneeded clutter in the big tags file. | 1315 | #(which is the most common case IMHO) to avoid unneeded clutter in the big tags file. |
1318 | #Adding $(srctree) adds about 20M on i386 to the size of the output file! | 1316 | #Adding $(srctree) adds about 20M on i386 to the size of the output file! |
1319 | 1317 | ||
1320 | ifeq ($(src),$(obj)) | 1318 | ifeq ($(src),$(obj)) |
1321 | __srctree = | 1319 | __srctree = |
1322 | else | 1320 | else |
1323 | __srctree = $(srctree)/ | 1321 | __srctree = $(srctree)/ |
1324 | endif | 1322 | endif |
1325 | 1323 | ||
1326 | ifeq ($(ALLSOURCE_ARCHS),) | 1324 | ifeq ($(ALLSOURCE_ARCHS),) |
1327 | ifeq ($(ARCH),um) | 1325 | ifeq ($(ARCH),um) |
1328 | ALLINCLUDE_ARCHS := $(ARCH) $(SUBARCH) | 1326 | ALLINCLUDE_ARCHS := $(ARCH) $(SUBARCH) |
1329 | else | 1327 | else |
1330 | ALLINCLUDE_ARCHS := $(SRCARCH) | 1328 | ALLINCLUDE_ARCHS := $(SRCARCH) |
1331 | endif | 1329 | endif |
1332 | else | 1330 | else |
1333 | #Allow user to specify only ALLSOURCE_PATHS on the command line, keeping existing behavour. | 1331 | #Allow user to specify only ALLSOURCE_PATHS on the command line, keeping existing behavour. |
1334 | ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS) | 1332 | ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS) |
1335 | endif | 1333 | endif |
1336 | 1334 | ||
1337 | # Take care of arch/x86 | 1335 | # Take care of arch/x86 |
1338 | ifeq ($(ARCH), $(SRCARCH)) | 1336 | ifeq ($(ARCH), $(SRCARCH)) |
1339 | ALLSOURCE_ARCHS := $(ARCH) | 1337 | ALLSOURCE_ARCHS := $(ARCH) |
1340 | else | 1338 | else |
1341 | ALLSOURCE_ARCHS := $(ARCH) $(SRCARCH) | 1339 | ALLSOURCE_ARCHS := $(ARCH) $(SRCARCH) |
1342 | endif | 1340 | endif |
1343 | 1341 | ||
1344 | define find-sources | 1342 | define find-sources |
1345 | ( for arch in $(ALLSOURCE_ARCHS) ; do \ | 1343 | ( for arch in $(ALLSOURCE_ARCHS) ; do \ |
1346 | find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \ | 1344 | find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \ |
1347 | -name $1 -print; \ | 1345 | -name $1 -print; \ |
1348 | done ; \ | 1346 | done ; \ |
1349 | find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \ | 1347 | find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \ |
1350 | -name $1 -print; \ | 1348 | -name $1 -print; \ |
1351 | find $(__srctree)include $(RCS_FIND_IGNORE) \ | 1349 | find $(__srctree)include $(RCS_FIND_IGNORE) \ |
1352 | \( -name config -o -name 'asm-*' \) -prune \ | 1350 | \( -name config -o -name 'asm-*' \) -prune \ |
1353 | -o -name $1 -print; \ | 1351 | -o -name $1 -print; \ |
1354 | for arch in $(ALLINCLUDE_ARCHS) ; do \ | 1352 | for arch in $(ALLINCLUDE_ARCHS) ; do \ |
1355 | find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \ | 1353 | find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \ |
1356 | -name $1 -print; \ | 1354 | -name $1 -print; \ |
1357 | done ; \ | 1355 | done ; \ |
1358 | find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \ | 1356 | find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \ |
1359 | -name $1 -print; \ | 1357 | -name $1 -print; \ |
1360 | find $(__srctree) $(RCS_FIND_IGNORE) \ | 1358 | find $(__srctree) $(RCS_FIND_IGNORE) \ |
1361 | \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \ | 1359 | \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \ |
1362 | -name $1 -print; \ | 1360 | -name $1 -print; \ |
1363 | ) | 1361 | ) |
1364 | endef | 1362 | endef |
1365 | 1363 | ||
1366 | define all-sources | 1364 | define all-sources |
1367 | $(call find-sources,'*.[chS]') | 1365 | $(call find-sources,'*.[chS]') |
1368 | endef | 1366 | endef |
1369 | define all-kconfigs | 1367 | define all-kconfigs |
1370 | $(call find-sources,'Kconfig*') | 1368 | $(call find-sources,'Kconfig*') |
1371 | endef | 1369 | endef |
1372 | define all-defconfigs | 1370 | define all-defconfigs |
1373 | $(call find-sources,'defconfig') | 1371 | $(call find-sources,'defconfig') |
1374 | endef | 1372 | endef |
1375 | 1373 | ||
1376 | define xtags | 1374 | define xtags |
1377 | if $1 --version 2>&1 | grep -iq exuberant; then \ | 1375 | if $1 --version 2>&1 | grep -iq exuberant; then \ |
1378 | $(all-sources) | xargs $1 -a \ | 1376 | $(all-sources) | xargs $1 -a \ |
1379 | -I __initdata,__exitdata,__acquires,__releases \ | 1377 | -I __initdata,__exitdata,__acquires,__releases \ |
1380 | -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \ | 1378 | -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \ |
1381 | --extra=+f --c-kinds=+px \ | 1379 | --extra=+f --c-kinds=+px \ |
1382 | --regex-asm='/^ENTRY\(([^)]*)\).*/\1/'; \ | 1380 | --regex-asm='/^ENTRY\(([^)]*)\).*/\1/'; \ |
1383 | $(all-kconfigs) | xargs $1 -a \ | 1381 | $(all-kconfigs) | xargs $1 -a \ |
1384 | --langdef=kconfig \ | 1382 | --langdef=kconfig \ |
1385 | --language-force=kconfig \ | 1383 | --language-force=kconfig \ |
1386 | --regex-kconfig='/^[[:blank:]]*config[[:blank:]]+([[:alnum:]_]+)/\1/'; \ | 1384 | --regex-kconfig='/^[[:blank:]]*config[[:blank:]]+([[:alnum:]_]+)/\1/'; \ |
1387 | $(all-defconfigs) | xargs -r $1 -a \ | 1385 | $(all-defconfigs) | xargs -r $1 -a \ |
1388 | --langdef=dotconfig \ | 1386 | --langdef=dotconfig \ |
1389 | --language-force=dotconfig \ | 1387 | --language-force=dotconfig \ |
1390 | --regex-dotconfig='/^#?[[:blank:]]*(CONFIG_[[:alnum:]_]+)/\1/'; \ | 1388 | --regex-dotconfig='/^#?[[:blank:]]*(CONFIG_[[:alnum:]_]+)/\1/'; \ |
1391 | elif $1 --version 2>&1 | grep -iq emacs; then \ | 1389 | elif $1 --version 2>&1 | grep -iq emacs; then \ |
1392 | $(all-sources) | xargs $1 -a; \ | 1390 | $(all-sources) | xargs $1 -a; \ |
1393 | $(all-kconfigs) | xargs $1 -a \ | 1391 | $(all-kconfigs) | xargs $1 -a \ |
1394 | --regex='/^[ \t]*config[ \t]+\([a-zA-Z0-9_]+\)/\1/'; \ | 1392 | --regex='/^[ \t]*config[ \t]+\([a-zA-Z0-9_]+\)/\1/'; \ |
1395 | $(all-defconfigs) | xargs -r $1 -a \ | 1393 | $(all-defconfigs) | xargs -r $1 -a \ |
1396 | --regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \ | 1394 | --regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \ |
1397 | else \ | 1395 | else \ |
1398 | $(all-sources) | xargs $1 -a; \ | 1396 | $(all-sources) | xargs $1 -a; \ |
1399 | fi | 1397 | fi |
1400 | endef | 1398 | endef |
1401 | 1399 | ||
1402 | quiet_cmd_cscope-file = FILELST cscope.files | 1400 | quiet_cmd_cscope-file = FILELST cscope.files |
1403 | cmd_cscope-file = (echo \-k; echo \-q; $(all-sources)) > cscope.files | 1401 | cmd_cscope-file = (echo \-k; echo \-q; $(all-sources)) > cscope.files |
1404 | 1402 | ||
1405 | quiet_cmd_cscope = MAKE cscope.out | 1403 | quiet_cmd_cscope = MAKE cscope.out |
1406 | cmd_cscope = cscope -b | 1404 | cmd_cscope = cscope -b |
1407 | 1405 | ||
1408 | cscope: FORCE | 1406 | cscope: FORCE |
1409 | $(call cmd,cscope-file) | 1407 | $(call cmd,cscope-file) |
1410 | $(call cmd,cscope) | 1408 | $(call cmd,cscope) |
1411 | 1409 | ||
1412 | quiet_cmd_TAGS = MAKE $@ | 1410 | quiet_cmd_TAGS = MAKE $@ |
1413 | define cmd_TAGS | 1411 | define cmd_TAGS |
1414 | rm -f $@; \ | 1412 | rm -f $@; \ |
1415 | $(call xtags,etags) | 1413 | $(call xtags,etags) |
1416 | endef | 1414 | endef |
1417 | 1415 | ||
1418 | TAGS: FORCE | 1416 | TAGS: FORCE |
1419 | $(call cmd,TAGS) | 1417 | $(call cmd,TAGS) |
1420 | 1418 | ||
1421 | quiet_cmd_tags = MAKE $@ | 1419 | quiet_cmd_tags = MAKE $@ |
1422 | define cmd_tags | 1420 | define cmd_tags |
1423 | rm -f $@; \ | 1421 | rm -f $@; \ |
1424 | $(call xtags,ctags) | 1422 | $(call xtags,ctags) |
1425 | endef | 1423 | endef |
1426 | 1424 | ||
1427 | tags: FORCE | 1425 | tags: FORCE |
1428 | $(call cmd,tags) | 1426 | $(call cmd,tags) |
1429 | 1427 | ||
1430 | 1428 | ||
1431 | # Scripts to check various things for consistency | 1429 | # Scripts to check various things for consistency |
1432 | # --------------------------------------------------------------------------- | 1430 | # --------------------------------------------------------------------------- |
1433 | 1431 | ||
1434 | includecheck: | 1432 | includecheck: |
1435 | find * $(RCS_FIND_IGNORE) \ | 1433 | find * $(RCS_FIND_IGNORE) \ |
1436 | -name '*.[hcS]' -type f -print | sort \ | 1434 | -name '*.[hcS]' -type f -print | sort \ |
1437 | | xargs $(PERL) -w scripts/checkincludes.pl | 1435 | | xargs $(PERL) -w scripts/checkincludes.pl |
1438 | 1436 | ||
1439 | versioncheck: | 1437 | versioncheck: |
1440 | find * $(RCS_FIND_IGNORE) \ | 1438 | find * $(RCS_FIND_IGNORE) \ |
1441 | -name '*.[hcS]' -type f -print | sort \ | 1439 | -name '*.[hcS]' -type f -print | sort \ |
1442 | | xargs $(PERL) -w scripts/checkversion.pl | 1440 | | xargs $(PERL) -w scripts/checkversion.pl |
1443 | 1441 | ||
1444 | namespacecheck: | 1442 | namespacecheck: |
1445 | $(PERL) $(srctree)/scripts/namespace.pl | 1443 | $(PERL) $(srctree)/scripts/namespace.pl |
1446 | 1444 | ||
1447 | export_report: | 1445 | export_report: |
1448 | $(PERL) $(srctree)/scripts/export_report.pl | 1446 | $(PERL) $(srctree)/scripts/export_report.pl |
1449 | 1447 | ||
1450 | endif #ifeq ($(config-targets),1) | 1448 | endif #ifeq ($(config-targets),1) |
1451 | endif #ifeq ($(mixed-targets),1) | 1449 | endif #ifeq ($(mixed-targets),1) |
1452 | 1450 | ||
1453 | PHONY += checkstack kernelrelease kernelversion | 1451 | PHONY += checkstack kernelrelease kernelversion |
1454 | 1452 | ||
1455 | # UML needs a little special treatment here. It wants to use the host | 1453 | # UML needs a little special treatment here. It wants to use the host |
1456 | # toolchain, so needs $(SUBARCH) passed to checkstack.pl. Everyone | 1454 | # toolchain, so needs $(SUBARCH) passed to checkstack.pl. Everyone |
1457 | # else wants $(ARCH), including people doing cross-builds, which means | 1455 | # else wants $(ARCH), including people doing cross-builds, which means |
1458 | # that $(SUBARCH) doesn't work here. | 1456 | # that $(SUBARCH) doesn't work here. |
1459 | ifeq ($(ARCH), um) | 1457 | ifeq ($(ARCH), um) |
1460 | CHECKSTACK_ARCH := $(SUBARCH) | 1458 | CHECKSTACK_ARCH := $(SUBARCH) |
1461 | else | 1459 | else |
1462 | CHECKSTACK_ARCH := $(ARCH) | 1460 | CHECKSTACK_ARCH := $(ARCH) |
1463 | endif | 1461 | endif |
1464 | checkstack: | 1462 | checkstack: |
1465 | $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \ | 1463 | $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \ |
1466 | $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH) | 1464 | $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH) |
1467 | 1465 | ||
1468 | kernelrelease: | 1466 | kernelrelease: |
1469 | $(if $(wildcard include/config/kernel.release), $(Q)echo $(KERNELRELEASE), \ | 1467 | $(if $(wildcard include/config/kernel.release), $(Q)echo $(KERNELRELEASE), \ |
1470 | $(error kernelrelease not valid - run 'make prepare' to update it)) | 1468 | $(error kernelrelease not valid - run 'make prepare' to update it)) |
1471 | kernelversion: | 1469 | kernelversion: |
1472 | @echo $(KERNELVERSION) | 1470 | @echo $(KERNELVERSION) |
1473 | 1471 | ||
1474 | # Single targets | 1472 | # Single targets |
1475 | # --------------------------------------------------------------------------- | 1473 | # --------------------------------------------------------------------------- |
1476 | # Single targets are compatible with: | 1474 | # Single targets are compatible with: |
1477 | # - build whith mixed source and output | 1475 | # - build whith mixed source and output |
1478 | # - build with separate output dir 'make O=...' | 1476 | # - build with separate output dir 'make O=...' |
1479 | # - external modules | 1477 | # - external modules |
1480 | # | 1478 | # |
1481 | # target-dir => where to store outputfile | 1479 | # target-dir => where to store outputfile |
1482 | # build-dir => directory in kernel source tree to use | 1480 | # build-dir => directory in kernel source tree to use |
1483 | 1481 | ||
1484 | ifeq ($(KBUILD_EXTMOD),) | 1482 | ifeq ($(KBUILD_EXTMOD),) |
1485 | build-dir = $(patsubst %/,%,$(dir $@)) | 1483 | build-dir = $(patsubst %/,%,$(dir $@)) |
1486 | target-dir = $(dir $@) | 1484 | target-dir = $(dir $@) |
1487 | else | 1485 | else |
1488 | zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@))) | 1486 | zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@))) |
1489 | build-dir = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash)) | 1487 | build-dir = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash)) |
1490 | target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@)) | 1488 | target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@)) |
1491 | endif | 1489 | endif |
1492 | 1490 | ||
1493 | %.s: %.c prepare scripts FORCE | 1491 | %.s: %.c prepare scripts FORCE |
1494 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) | 1492 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1495 | %.i: %.c prepare scripts FORCE | 1493 | %.i: %.c prepare scripts FORCE |
1496 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) | 1494 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1497 | %.o: %.c prepare scripts FORCE | 1495 | %.o: %.c prepare scripts FORCE |
1498 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) | 1496 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1499 | %.lst: %.c prepare scripts FORCE | 1497 | %.lst: %.c prepare scripts FORCE |
1500 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) | 1498 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1501 | %.s: %.S prepare scripts FORCE | 1499 | %.s: %.S prepare scripts FORCE |
1502 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) | 1500 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1503 | %.o: %.S prepare scripts FORCE | 1501 | %.o: %.S prepare scripts FORCE |
1504 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) | 1502 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1505 | %.symtypes: %.c prepare scripts FORCE | 1503 | %.symtypes: %.c prepare scripts FORCE |
1506 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) | 1504 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1507 | 1505 | ||
1508 | # Modules | 1506 | # Modules |
1509 | / %/: prepare scripts FORCE | 1507 | / %/: prepare scripts FORCE |
1510 | $(cmd_crmodverdir) | 1508 | $(cmd_crmodverdir) |
1511 | $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ | 1509 | $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ |
1512 | $(build)=$(build-dir) | 1510 | $(build)=$(build-dir) |
1513 | %.ko: prepare scripts FORCE | 1511 | %.ko: prepare scripts FORCE |
1514 | $(cmd_crmodverdir) | 1512 | $(cmd_crmodverdir) |
1515 | $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ | 1513 | $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ |
1516 | $(build)=$(build-dir) $(@:.ko=.o) | 1514 | $(build)=$(build-dir) $(@:.ko=.o) |
1517 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost | 1515 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost |
1518 | 1516 | ||
1519 | # FIXME Should go into a make.lib or something | 1517 | # FIXME Should go into a make.lib or something |
1520 | # =========================================================================== | 1518 | # =========================================================================== |
1521 | 1519 | ||
1522 | quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs))) | 1520 | quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs))) |
1523 | cmd_rmdirs = rm -rf $(rm-dirs) | 1521 | cmd_rmdirs = rm -rf $(rm-dirs) |
1524 | 1522 | ||
1525 | quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))) | 1523 | quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))) |
1526 | cmd_rmfiles = rm -f $(rm-files) | 1524 | cmd_rmfiles = rm -f $(rm-files) |
1527 | 1525 | ||
1528 | # Run depmod only is we have System.map and depmod is executable | 1526 | # Run depmod only is we have System.map and depmod is executable |
1529 | # and we build for the host arch | 1527 | # and we build for the host arch |
1530 | quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) | 1528 | quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) |
1531 | cmd_depmod = \ | 1529 | cmd_depmod = \ |
1532 | if [ -r System.map -a -x $(DEPMOD) ]; then \ | 1530 | if [ -r System.map -a -x $(DEPMOD) ]; then \ |
1533 | $(DEPMOD) -ae -F System.map \ | 1531 | $(DEPMOD) -ae -F System.map \ |
1534 | $(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) -r) \ | 1532 | $(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) -r) \ |
1535 | $(KERNELRELEASE); \ | 1533 | $(KERNELRELEASE); \ |
1536 | fi | 1534 | fi |
1537 | 1535 | ||
1538 | # Create temporary dir for module support files | 1536 | # Create temporary dir for module support files |
1539 | # clean it up only when building all modules | 1537 | # clean it up only when building all modules |
1540 | cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \ | 1538 | cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \ |
1541 | $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*) | 1539 | $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*) |
1542 | 1540 | ||
1543 | a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ | 1541 | a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ |
1544 | $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ | 1542 | $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ |
1545 | $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) | 1543 | $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) |
1546 | 1544 | ||
1547 | quiet_cmd_as_o_S = AS $@ | 1545 | quiet_cmd_as_o_S = AS $@ |
1548 | cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< | 1546 | cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< |
1549 | 1547 | ||
1550 | # read all saved command lines | 1548 | # read all saved command lines |
1551 | 1549 | ||
1552 | targets := $(wildcard $(sort $(targets))) | 1550 | targets := $(wildcard $(sort $(targets))) |
1553 | cmd_files := $(wildcard .*.cmd $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd)) | 1551 | cmd_files := $(wildcard .*.cmd $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd)) |
1554 | 1552 | ||
1555 | ifneq ($(cmd_files),) | 1553 | ifneq ($(cmd_files),) |
1556 | $(cmd_files): ; # Do not try to update included dependency files | 1554 | $(cmd_files): ; # Do not try to update included dependency files |
1557 | include $(cmd_files) | 1555 | include $(cmd_files) |
1558 | endif | 1556 | endif |
1559 | 1557 | ||
1560 | # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir | 1558 | # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir |
1561 | # Usage: | 1559 | # Usage: |
1562 | # $(Q)$(MAKE) $(clean)=dir | 1560 | # $(Q)$(MAKE) $(clean)=dir |
1563 | clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj | 1561 | clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj |
1564 | 1562 | ||
1565 | endif # skip-makefile | 1563 | endif # skip-makefile |
1566 | 1564 | ||
1567 | PHONY += FORCE | 1565 | PHONY += FORCE |
1568 | FORCE: | 1566 | FORCE: |
1569 | 1567 | ||
1570 | # Cancel implicit rules on top Makefile, `-rR' will apply to sub-makes. | 1568 | # Cancel implicit rules on top Makefile, `-rR' will apply to sub-makes. |
1571 | Makefile: ; | 1569 | Makefile: ; |
1572 | 1570 | ||
1573 | # Declare the contents of the .PHONY variable as phony. We keep that | 1571 | # Declare the contents of the .PHONY variable as phony. We keep that |
1574 | # information in a variable se we can use it in if_changed and friends. | 1572 | # information in a variable se we can use it in if_changed and friends. |
1575 | .PHONY: $(PHONY) | 1573 | .PHONY: $(PHONY) |
1576 | 1574 |
README
1 | Linux kernel release 2.6.xx <http://kernel.org/> | 1 | Linux kernel release 2.6.xx <http://kernel.org/> |
2 | 2 | ||
3 | These are the release notes for Linux version 2.6. Read them carefully, | 3 | These are the release notes for Linux version 2.6. Read them carefully, |
4 | as they tell you what this is all about, explain how to install the | 4 | as they tell you what this is all about, explain how to install the |
5 | kernel, and what to do if something goes wrong. | 5 | kernel, and what to do if something goes wrong. |
6 | 6 | ||
7 | WHAT IS LINUX? | 7 | WHAT IS LINUX? |
8 | 8 | ||
9 | Linux is a clone of the operating system Unix, written from scratch by | 9 | Linux is a clone of the operating system Unix, written from scratch by |
10 | Linus Torvalds with assistance from a loosely-knit team of hackers across | 10 | Linus Torvalds with assistance from a loosely-knit team of hackers across |
11 | the Net. It aims towards POSIX and Single UNIX Specification compliance. | 11 | the Net. It aims towards POSIX and Single UNIX Specification compliance. |
12 | 12 | ||
13 | It has all the features you would expect in a modern fully-fledged Unix, | 13 | It has all the features you would expect in a modern fully-fledged Unix, |
14 | including true multitasking, virtual memory, shared libraries, demand | 14 | including true multitasking, virtual memory, shared libraries, demand |
15 | loading, shared copy-on-write executables, proper memory management, | 15 | loading, shared copy-on-write executables, proper memory management, |
16 | and multistack networking including IPv4 and IPv6. | 16 | and multistack networking including IPv4 and IPv6. |
17 | 17 | ||
18 | It is distributed under the GNU General Public License - see the | 18 | It is distributed under the GNU General Public License - see the |
19 | accompanying COPYING file for more details. | 19 | accompanying COPYING file for more details. |
20 | 20 | ||
21 | ON WHAT HARDWARE DOES IT RUN? | 21 | ON WHAT HARDWARE DOES IT RUN? |
22 | 22 | ||
23 | Although originally developed first for 32-bit x86-based PCs (386 or higher), | 23 | Although originally developed first for 32-bit x86-based PCs (386 or higher), |
24 | today Linux also runs on (at least) the Compaq Alpha AXP, Sun SPARC and | 24 | today Linux also runs on (at least) the Compaq Alpha AXP, Sun SPARC and |
25 | UltraSPARC, Motorola 68000, PowerPC, PowerPC64, ARM, Hitachi SuperH, Cell, | 25 | UltraSPARC, Motorola 68000, PowerPC, PowerPC64, ARM, Hitachi SuperH, Cell, |
26 | IBM S/390, MIPS, HP PA-RISC, Intel IA-64, DEC VAX, AMD x86-64, AXIS CRIS, | 26 | IBM S/390, MIPS, HP PA-RISC, Intel IA-64, DEC VAX, AMD x86-64, AXIS CRIS, |
27 | Xtensa, AVR32 and Renesas M32R architectures. | 27 | Xtensa, AVR32 and Renesas M32R architectures. |
28 | 28 | ||
29 | Linux is easily portable to most general-purpose 32- or 64-bit architectures | 29 | Linux is easily portable to most general-purpose 32- or 64-bit architectures |
30 | as long as they have a paged memory management unit (PMMU) and a port of the | 30 | as long as they have a paged memory management unit (PMMU) and a port of the |
31 | GNU C compiler (gcc) (part of The GNU Compiler Collection, GCC). Linux has | 31 | GNU C compiler (gcc) (part of The GNU Compiler Collection, GCC). Linux has |
32 | also been ported to a number of architectures without a PMMU, although | 32 | also been ported to a number of architectures without a PMMU, although |
33 | functionality is then obviously somewhat limited. | 33 | functionality is then obviously somewhat limited. |
34 | Linux has also been ported to itself. You can now run the kernel as a | 34 | Linux has also been ported to itself. You can now run the kernel as a |
35 | userspace application - this is called UserMode Linux (UML). | 35 | userspace application - this is called UserMode Linux (UML). |
36 | 36 | ||
37 | DOCUMENTATION: | 37 | DOCUMENTATION: |
38 | 38 | ||
39 | - There is a lot of documentation available both in electronic form on | 39 | - There is a lot of documentation available both in electronic form on |
40 | the Internet and in books, both Linux-specific and pertaining to | 40 | the Internet and in books, both Linux-specific and pertaining to |
41 | general UNIX questions. I'd recommend looking into the documentation | 41 | general UNIX questions. I'd recommend looking into the documentation |
42 | subdirectories on any Linux FTP site for the LDP (Linux Documentation | 42 | subdirectories on any Linux FTP site for the LDP (Linux Documentation |
43 | Project) books. This README is not meant to be documentation on the | 43 | Project) books. This README is not meant to be documentation on the |
44 | system: there are much better sources available. | 44 | system: there are much better sources available. |
45 | 45 | ||
46 | - There are various README files in the Documentation/ subdirectory: | 46 | - There are various README files in the Documentation/ subdirectory: |
47 | these typically contain kernel-specific installation notes for some | 47 | these typically contain kernel-specific installation notes for some |
48 | drivers for example. See Documentation/00-INDEX for a list of what | 48 | drivers for example. See Documentation/00-INDEX for a list of what |
49 | is contained in each file. Please read the Changes file, as it | 49 | is contained in each file. Please read the Changes file, as it |
50 | contains information about the problems, which may result by upgrading | 50 | contains information about the problems, which may result by upgrading |
51 | your kernel. | 51 | your kernel. |
52 | 52 | ||
53 | - The Documentation/DocBook/ subdirectory contains several guides for | 53 | - The Documentation/DocBook/ subdirectory contains several guides for |
54 | kernel developers and users. These guides can be rendered in a | 54 | kernel developers and users. These guides can be rendered in a |
55 | number of formats: PostScript (.ps), PDF, and HTML, among others. | 55 | number of formats: PostScript (.ps), PDF, and HTML, among others. |
56 | After installation, "make psdocs", "make pdfdocs", or "make htmldocs" | 56 | After installation, "make psdocs", "make pdfdocs", or "make htmldocs" |
57 | will render the documentation in the requested format. | 57 | will render the documentation in the requested format. |
58 | 58 | ||
59 | INSTALLING the kernel: | 59 | INSTALLING the kernel: |
60 | 60 | ||
61 | - If you install the full sources, put the kernel tarball in a | 61 | - If you install the full sources, put the kernel tarball in a |
62 | directory where you have permissions (eg. your home directory) and | 62 | directory where you have permissions (eg. your home directory) and |
63 | unpack it: | 63 | unpack it: |
64 | 64 | ||
65 | gzip -cd linux-2.6.XX.tar.gz | tar xvf - | 65 | gzip -cd linux-2.6.XX.tar.gz | tar xvf - |
66 | 66 | ||
67 | or | 67 | or |
68 | bzip2 -dc linux-2.6.XX.tar.bz2 | tar xvf - | 68 | bzip2 -dc linux-2.6.XX.tar.bz2 | tar xvf - |
69 | 69 | ||
70 | 70 | ||
71 | Replace "XX" with the version number of the latest kernel. | 71 | Replace "XX" with the version number of the latest kernel. |
72 | 72 | ||
73 | Do NOT use the /usr/src/linux area! This area has a (usually | 73 | Do NOT use the /usr/src/linux area! This area has a (usually |
74 | incomplete) set of kernel headers that are used by the library header | 74 | incomplete) set of kernel headers that are used by the library header |
75 | files. They should match the library, and not get messed up by | 75 | files. They should match the library, and not get messed up by |
76 | whatever the kernel-du-jour happens to be. | 76 | whatever the kernel-du-jour happens to be. |
77 | 77 | ||
78 | - You can also upgrade between 2.6.xx releases by patching. Patches are | 78 | - You can also upgrade between 2.6.xx releases by patching. Patches are |
79 | distributed in the traditional gzip and the newer bzip2 format. To | 79 | distributed in the traditional gzip and the newer bzip2 format. To |
80 | install by patching, get all the newer patch files, enter the | 80 | install by patching, get all the newer patch files, enter the |
81 | top level directory of the kernel source (linux-2.6.xx) and execute: | 81 | top level directory of the kernel source (linux-2.6.xx) and execute: |
82 | 82 | ||
83 | gzip -cd ../patch-2.6.xx.gz | patch -p1 | 83 | gzip -cd ../patch-2.6.xx.gz | patch -p1 |
84 | 84 | ||
85 | or | 85 | or |
86 | bzip2 -dc ../patch-2.6.xx.bz2 | patch -p1 | 86 | bzip2 -dc ../patch-2.6.xx.bz2 | patch -p1 |
87 | 87 | ||
88 | (repeat xx for all versions bigger than the version of your current | 88 | (repeat xx for all versions bigger than the version of your current |
89 | source tree, _in_order_) and you should be ok. You may want to remove | 89 | source tree, _in_order_) and you should be ok. You may want to remove |
90 | the backup files (xxx~ or xxx.orig), and make sure that there are no | 90 | the backup files (xxx~ or xxx.orig), and make sure that there are no |
91 | failed patches (xxx# or xxx.rej). If there are, either you or me has | 91 | failed patches (xxx# or xxx.rej). If there are, either you or me has |
92 | made a mistake. | 92 | made a mistake. |
93 | 93 | ||
94 | Unlike patches for the 2.6.x kernels, patches for the 2.6.x.y kernels | 94 | Unlike patches for the 2.6.x kernels, patches for the 2.6.x.y kernels |
95 | (also known as the -stable kernels) are not incremental but instead apply | 95 | (also known as the -stable kernels) are not incremental but instead apply |
96 | directly to the base 2.6.x kernel. Please read | 96 | directly to the base 2.6.x kernel. Please read |
97 | Documentation/applying-patches.txt for more information. | 97 | Documentation/applying-patches.txt for more information. |
98 | 98 | ||
99 | Alternatively, the script patch-kernel can be used to automate this | 99 | Alternatively, the script patch-kernel can be used to automate this |
100 | process. It determines the current kernel version and applies any | 100 | process. It determines the current kernel version and applies any |
101 | patches found. | 101 | patches found. |
102 | 102 | ||
103 | linux/scripts/patch-kernel linux | 103 | linux/scripts/patch-kernel linux |
104 | 104 | ||
105 | The first argument in the command above is the location of the | 105 | The first argument in the command above is the location of the |
106 | kernel source. Patches are applied from the current directory, but | 106 | kernel source. Patches are applied from the current directory, but |
107 | an alternative directory can be specified as the second argument. | 107 | an alternative directory can be specified as the second argument. |
108 | 108 | ||
109 | - If you are upgrading between releases using the stable series patches | 109 | - If you are upgrading between releases using the stable series patches |
110 | (for example, patch-2.6.xx.y), note that these "dot-releases" are | 110 | (for example, patch-2.6.xx.y), note that these "dot-releases" are |
111 | not incremental and must be applied to the 2.6.xx base tree. For | 111 | not incremental and must be applied to the 2.6.xx base tree. For |
112 | example, if your base kernel is 2.6.12 and you want to apply the | 112 | example, if your base kernel is 2.6.12 and you want to apply the |
113 | 2.6.12.3 patch, you do not and indeed must not first apply the | 113 | 2.6.12.3 patch, you do not and indeed must not first apply the |
114 | 2.6.12.1 and 2.6.12.2 patches. Similarly, if you are running kernel | 114 | 2.6.12.1 and 2.6.12.2 patches. Similarly, if you are running kernel |
115 | version 2.6.12.2 and want to jump to 2.6.12.3, you must first | 115 | version 2.6.12.2 and want to jump to 2.6.12.3, you must first |
116 | reverse the 2.6.12.2 patch (that is, patch -R) _before_ applying | 116 | reverse the 2.6.12.2 patch (that is, patch -R) _before_ applying |
117 | the 2.6.12.3 patch. | 117 | the 2.6.12.3 patch. |
118 | You can read more on this in Documentation/applying-patches.txt | 118 | You can read more on this in Documentation/applying-patches.txt |
119 | 119 | ||
120 | - Make sure you have no stale .o files and dependencies lying around: | 120 | - Make sure you have no stale .o files and dependencies lying around: |
121 | 121 | ||
122 | cd linux | 122 | cd linux |
123 | make mrproper | 123 | make mrproper |
124 | 124 | ||
125 | You should now have the sources correctly installed. | 125 | You should now have the sources correctly installed. |
126 | 126 | ||
127 | SOFTWARE REQUIREMENTS | 127 | SOFTWARE REQUIREMENTS |
128 | 128 | ||
129 | Compiling and running the 2.6.xx kernels requires up-to-date | 129 | Compiling and running the 2.6.xx kernels requires up-to-date |
130 | versions of various software packages. Consult | 130 | versions of various software packages. Consult |
131 | Documentation/Changes for the minimum version numbers required | 131 | Documentation/Changes for the minimum version numbers required |
132 | and how to get updates for these packages. Beware that using | 132 | and how to get updates for these packages. Beware that using |
133 | excessively old versions of these packages can cause indirect | 133 | excessively old versions of these packages can cause indirect |
134 | errors that are very difficult to track down, so don't assume that | 134 | errors that are very difficult to track down, so don't assume that |
135 | you can just update packages when obvious problems arise during | 135 | you can just update packages when obvious problems arise during |
136 | build or operation. | 136 | build or operation. |
137 | 137 | ||
138 | BUILD directory for the kernel: | 138 | BUILD directory for the kernel: |
139 | 139 | ||
140 | When compiling the kernel all output files will per default be | 140 | When compiling the kernel all output files will per default be |
141 | stored together with the kernel source code. | 141 | stored together with the kernel source code. |
142 | Using the option "make O=output/dir" allow you to specify an alternate | 142 | Using the option "make O=output/dir" allow you to specify an alternate |
143 | place for the output files (including .config). | 143 | place for the output files (including .config). |
144 | Example: | 144 | Example: |
145 | kernel source code: /usr/src/linux-2.6.N | 145 | kernel source code: /usr/src/linux-2.6.N |
146 | build directory: /home/name/build/kernel | 146 | build directory: /home/name/build/kernel |
147 | 147 | ||
148 | To configure and build the kernel use: | 148 | To configure and build the kernel use: |
149 | cd /usr/src/linux-2.6.N | 149 | cd /usr/src/linux-2.6.N |
150 | make O=/home/name/build/kernel menuconfig | 150 | make O=/home/name/build/kernel menuconfig |
151 | make O=/home/name/build/kernel | 151 | make O=/home/name/build/kernel |
152 | sudo make O=/home/name/build/kernel modules_install install | 152 | sudo make O=/home/name/build/kernel modules_install install |
153 | 153 | ||
154 | Please note: If the 'O=output/dir' option is used then it must be | 154 | Please note: If the 'O=output/dir' option is used then it must be |
155 | used for all invocations of make. | 155 | used for all invocations of make. |
156 | 156 | ||
157 | CONFIGURING the kernel: | 157 | CONFIGURING the kernel: |
158 | 158 | ||
159 | Do not skip this step even if you are only upgrading one minor | 159 | Do not skip this step even if you are only upgrading one minor |
160 | version. New configuration options are added in each release, and | 160 | version. New configuration options are added in each release, and |
161 | odd problems will turn up if the configuration files are not set up | 161 | odd problems will turn up if the configuration files are not set up |
162 | as expected. If you want to carry your existing configuration to a | 162 | as expected. If you want to carry your existing configuration to a |
163 | new version with minimal work, use "make oldconfig", which will | 163 | new version with minimal work, use "make oldconfig", which will |
164 | only ask you for the answers to new questions. | 164 | only ask you for the answers to new questions. |
165 | 165 | ||
166 | - Alternate configuration commands are: | 166 | - Alternate configuration commands are: |
167 | "make config" Plain text interface. | 167 | "make config" Plain text interface. |
168 | "make menuconfig" Text based color menus, radiolists & dialogs. | 168 | "make menuconfig" Text based color menus, radiolists & dialogs. |
169 | "make xconfig" X windows (Qt) based configuration tool. | 169 | "make xconfig" X windows (Qt) based configuration tool. |
170 | "make gconfig" X windows (Gtk) based configuration tool. | 170 | "make gconfig" X windows (Gtk) based configuration tool. |
171 | "make oldconfig" Default all questions based on the contents of | 171 | "make oldconfig" Default all questions based on the contents of |
172 | your existing ./.config file and asking about | 172 | your existing ./.config file and asking about |
173 | new config symbols. | 173 | new config symbols. |
174 | "make silentoldconfig" | 174 | "make silentoldconfig" |
175 | Like above, but avoids cluttering the screen | 175 | Like above, but avoids cluttering the screen |
176 | with questions already answered. | 176 | with questions already answered. |
177 | "make defconfig" Create a ./.config file by using the default | 177 | "make defconfig" Create a ./.config file by using the default |
178 | symbol values from arch/$ARCH/defconfig. | 178 | symbol values from arch/$ARCH/defconfig. |
179 | "make allyesconfig" | 179 | "make allyesconfig" |
180 | Create a ./.config file by setting symbol | 180 | Create a ./.config file by setting symbol |
181 | values to 'y' as much as possible. | 181 | values to 'y' as much as possible. |
182 | "make allmodconfig" | 182 | "make allmodconfig" |
183 | Create a ./.config file by setting symbol | 183 | Create a ./.config file by setting symbol |
184 | values to 'm' as much as possible. | 184 | values to 'm' as much as possible. |
185 | "make allnoconfig" Create a ./.config file by setting symbol | 185 | "make allnoconfig" Create a ./.config file by setting symbol |
186 | values to 'n' as much as possible. | 186 | values to 'n' as much as possible. |
187 | "make randconfig" Create a ./.config file by setting symbol | 187 | "make randconfig" Create a ./.config file by setting symbol |
188 | values to random values. | 188 | values to random values. |
189 | 189 | ||
190 | The allyesconfig/allmodconfig/allnoconfig/randconfig variants can | 190 | The allyesconfig/allmodconfig/allnoconfig/randconfig variants can |
191 | also use the environment variable KCONFIG_ALLCONFIG to specify a | 191 | also use the environment variable KCONFIG_ALLCONFIG to specify a |
192 | filename that contains config options that the user requires to be | 192 | filename that contains config options that the user requires to be |
193 | set to a specific value. If KCONFIG_ALLCONFIG=filename is not used, | 193 | set to a specific value. If KCONFIG_ALLCONFIG=filename is not used, |
194 | "make *config" checks for a file named "all{yes/mod/no/random}.config" | 194 | "make *config" checks for a file named "all{yes/mod/no/random}.config" |
195 | for symbol values that are to be forced. If this file is not found, | 195 | for symbol values that are to be forced. If this file is not found, |
196 | it checks for a file named "all.config" to contain forced values. | 196 | it checks for a file named "all.config" to contain forced values. |
197 | Finally it checks the environment variable K64BIT and if found, sets | ||
198 | the config symbol "64BIT" to the value of the K64BIT variable. | ||
199 | 197 | ||
200 | NOTES on "make config": | 198 | NOTES on "make config": |
201 | - having unnecessary drivers will make the kernel bigger, and can | 199 | - having unnecessary drivers will make the kernel bigger, and can |
202 | under some circumstances lead to problems: probing for a | 200 | under some circumstances lead to problems: probing for a |
203 | nonexistent controller card may confuse your other controllers | 201 | nonexistent controller card may confuse your other controllers |
204 | - compiling the kernel with "Processor type" set higher than 386 | 202 | - compiling the kernel with "Processor type" set higher than 386 |
205 | will result in a kernel that does NOT work on a 386. The | 203 | will result in a kernel that does NOT work on a 386. The |
206 | kernel will detect this on bootup, and give up. | 204 | kernel will detect this on bootup, and give up. |
207 | - A kernel with math-emulation compiled in will still use the | 205 | - A kernel with math-emulation compiled in will still use the |
208 | coprocessor if one is present: the math emulation will just | 206 | coprocessor if one is present: the math emulation will just |
209 | never get used in that case. The kernel will be slightly larger, | 207 | never get used in that case. The kernel will be slightly larger, |
210 | but will work on different machines regardless of whether they | 208 | but will work on different machines regardless of whether they |
211 | have a math coprocessor or not. | 209 | have a math coprocessor or not. |
212 | - the "kernel hacking" configuration details usually result in a | 210 | - the "kernel hacking" configuration details usually result in a |
213 | bigger or slower kernel (or both), and can even make the kernel | 211 | bigger or slower kernel (or both), and can even make the kernel |
214 | less stable by configuring some routines to actively try to | 212 | less stable by configuring some routines to actively try to |
215 | break bad code to find kernel problems (kmalloc()). Thus you | 213 | break bad code to find kernel problems (kmalloc()). Thus you |
216 | should probably answer 'n' to the questions for | 214 | should probably answer 'n' to the questions for |
217 | "development", "experimental", or "debugging" features. | 215 | "development", "experimental", or "debugging" features. |
218 | 216 | ||
219 | COMPILING the kernel: | 217 | COMPILING the kernel: |
220 | 218 | ||
221 | - Make sure you have at least gcc 3.2 available. | 219 | - Make sure you have at least gcc 3.2 available. |
222 | For more information, refer to Documentation/Changes. | 220 | For more information, refer to Documentation/Changes. |
223 | 221 | ||
224 | Please note that you can still run a.out user programs with this kernel. | 222 | Please note that you can still run a.out user programs with this kernel. |
225 | 223 | ||
226 | - Do a "make" to create a compressed kernel image. It is also | 224 | - Do a "make" to create a compressed kernel image. It is also |
227 | possible to do "make install" if you have lilo installed to suit the | 225 | possible to do "make install" if you have lilo installed to suit the |
228 | kernel makefiles, but you may want to check your particular lilo setup first. | 226 | kernel makefiles, but you may want to check your particular lilo setup first. |
229 | 227 | ||
230 | To do the actual install you have to be root, but none of the normal | 228 | To do the actual install you have to be root, but none of the normal |
231 | build should require that. Don't take the name of root in vain. | 229 | build should require that. Don't take the name of root in vain. |
232 | 230 | ||
233 | - If you configured any of the parts of the kernel as `modules', you | 231 | - If you configured any of the parts of the kernel as `modules', you |
234 | will also have to do "make modules_install". | 232 | will also have to do "make modules_install". |
235 | 233 | ||
236 | - Keep a backup kernel handy in case something goes wrong. This is | 234 | - Keep a backup kernel handy in case something goes wrong. This is |
237 | especially true for the development releases, since each new release | 235 | especially true for the development releases, since each new release |
238 | contains new code which has not been debugged. Make sure you keep a | 236 | contains new code which has not been debugged. Make sure you keep a |
239 | backup of the modules corresponding to that kernel, as well. If you | 237 | backup of the modules corresponding to that kernel, as well. If you |
240 | are installing a new kernel with the same version number as your | 238 | are installing a new kernel with the same version number as your |
241 | working kernel, make a backup of your modules directory before you | 239 | working kernel, make a backup of your modules directory before you |
242 | do a "make modules_install". | 240 | do a "make modules_install". |
243 | Alternatively, before compiling, use the kernel config option | 241 | Alternatively, before compiling, use the kernel config option |
244 | "LOCALVERSION" to append a unique suffix to the regular kernel version. | 242 | "LOCALVERSION" to append a unique suffix to the regular kernel version. |
245 | LOCALVERSION can be set in the "General Setup" menu. | 243 | LOCALVERSION can be set in the "General Setup" menu. |
246 | 244 | ||
247 | - In order to boot your new kernel, you'll need to copy the kernel | 245 | - In order to boot your new kernel, you'll need to copy the kernel |
248 | image (e.g. .../linux/arch/i386/boot/bzImage after compilation) | 246 | image (e.g. .../linux/arch/i386/boot/bzImage after compilation) |
249 | to the place where your regular bootable kernel is found. | 247 | to the place where your regular bootable kernel is found. |
250 | 248 | ||
251 | - Booting a kernel directly from a floppy without the assistance of a | 249 | - Booting a kernel directly from a floppy without the assistance of a |
252 | bootloader such as LILO, is no longer supported. | 250 | bootloader such as LILO, is no longer supported. |
253 | 251 | ||
254 | If you boot Linux from the hard drive, chances are you use LILO which | 252 | If you boot Linux from the hard drive, chances are you use LILO which |
255 | uses the kernel image as specified in the file /etc/lilo.conf. The | 253 | uses the kernel image as specified in the file /etc/lilo.conf. The |
256 | kernel image file is usually /vmlinuz, /boot/vmlinuz, /bzImage or | 254 | kernel image file is usually /vmlinuz, /boot/vmlinuz, /bzImage or |
257 | /boot/bzImage. To use the new kernel, save a copy of the old image | 255 | /boot/bzImage. To use the new kernel, save a copy of the old image |
258 | and copy the new image over the old one. Then, you MUST RERUN LILO | 256 | and copy the new image over the old one. Then, you MUST RERUN LILO |
259 | to update the loading map!! If you don't, you won't be able to boot | 257 | to update the loading map!! If you don't, you won't be able to boot |
260 | the new kernel image. | 258 | the new kernel image. |
261 | 259 | ||
262 | Reinstalling LILO is usually a matter of running /sbin/lilo. | 260 | Reinstalling LILO is usually a matter of running /sbin/lilo. |
263 | You may wish to edit /etc/lilo.conf to specify an entry for your | 261 | You may wish to edit /etc/lilo.conf to specify an entry for your |
264 | old kernel image (say, /vmlinux.old) in case the new one does not | 262 | old kernel image (say, /vmlinux.old) in case the new one does not |
265 | work. See the LILO docs for more information. | 263 | work. See the LILO docs for more information. |
266 | 264 | ||
267 | After reinstalling LILO, you should be all set. Shutdown the system, | 265 | After reinstalling LILO, you should be all set. Shutdown the system, |
268 | reboot, and enjoy! | 266 | reboot, and enjoy! |
269 | 267 | ||
270 | If you ever need to change the default root device, video mode, | 268 | If you ever need to change the default root device, video mode, |
271 | ramdisk size, etc. in the kernel image, use the 'rdev' program (or | 269 | ramdisk size, etc. in the kernel image, use the 'rdev' program (or |
272 | alternatively the LILO boot options when appropriate). No need to | 270 | alternatively the LILO boot options when appropriate). No need to |
273 | recompile the kernel to change these parameters. | 271 | recompile the kernel to change these parameters. |
274 | 272 | ||
275 | - Reboot with the new kernel and enjoy. | 273 | - Reboot with the new kernel and enjoy. |
276 | 274 | ||
277 | IF SOMETHING GOES WRONG: | 275 | IF SOMETHING GOES WRONG: |
278 | 276 | ||
279 | - If you have problems that seem to be due to kernel bugs, please check | 277 | - If you have problems that seem to be due to kernel bugs, please check |
280 | the file MAINTAINERS to see if there is a particular person associated | 278 | the file MAINTAINERS to see if there is a particular person associated |
281 | with the part of the kernel that you are having trouble with. If there | 279 | with the part of the kernel that you are having trouble with. If there |
282 | isn't anyone listed there, then the second best thing is to mail | 280 | isn't anyone listed there, then the second best thing is to mail |
283 | them to me (torvalds@linux-foundation.org), and possibly to any other | 281 | them to me (torvalds@linux-foundation.org), and possibly to any other |
284 | relevant mailing-list or to the newsgroup. | 282 | relevant mailing-list or to the newsgroup. |
285 | 283 | ||
286 | - In all bug-reports, *please* tell what kernel you are talking about, | 284 | - In all bug-reports, *please* tell what kernel you are talking about, |
287 | how to duplicate the problem, and what your setup is (use your common | 285 | how to duplicate the problem, and what your setup is (use your common |
288 | sense). If the problem is new, tell me so, and if the problem is | 286 | sense). If the problem is new, tell me so, and if the problem is |
289 | old, please try to tell me when you first noticed it. | 287 | old, please try to tell me when you first noticed it. |
290 | 288 | ||
291 | - If the bug results in a message like | 289 | - If the bug results in a message like |
292 | 290 | ||
293 | unable to handle kernel paging request at address C0000010 | 291 | unable to handle kernel paging request at address C0000010 |
294 | Oops: 0002 | 292 | Oops: 0002 |
295 | EIP: 0010:XXXXXXXX | 293 | EIP: 0010:XXXXXXXX |
296 | eax: xxxxxxxx ebx: xxxxxxxx ecx: xxxxxxxx edx: xxxxxxxx | 294 | eax: xxxxxxxx ebx: xxxxxxxx ecx: xxxxxxxx edx: xxxxxxxx |
297 | esi: xxxxxxxx edi: xxxxxxxx ebp: xxxxxxxx | 295 | esi: xxxxxxxx edi: xxxxxxxx ebp: xxxxxxxx |
298 | ds: xxxx es: xxxx fs: xxxx gs: xxxx | 296 | ds: xxxx es: xxxx fs: xxxx gs: xxxx |
299 | Pid: xx, process nr: xx | 297 | Pid: xx, process nr: xx |
300 | xx xx xx xx xx xx xx xx xx xx | 298 | xx xx xx xx xx xx xx xx xx xx |
301 | 299 | ||
302 | or similar kernel debugging information on your screen or in your | 300 | or similar kernel debugging information on your screen or in your |
303 | system log, please duplicate it *exactly*. The dump may look | 301 | system log, please duplicate it *exactly*. The dump may look |
304 | incomprehensible to you, but it does contain information that may | 302 | incomprehensible to you, but it does contain information that may |
305 | help debugging the problem. The text above the dump is also | 303 | help debugging the problem. The text above the dump is also |
306 | important: it tells something about why the kernel dumped code (in | 304 | important: it tells something about why the kernel dumped code (in |
307 | the above example it's due to a bad kernel pointer). More information | 305 | the above example it's due to a bad kernel pointer). More information |
308 | on making sense of the dump is in Documentation/oops-tracing.txt | 306 | on making sense of the dump is in Documentation/oops-tracing.txt |
309 | 307 | ||
310 | - If you compiled the kernel with CONFIG_KALLSYMS you can send the dump | 308 | - If you compiled the kernel with CONFIG_KALLSYMS you can send the dump |
311 | as is, otherwise you will have to use the "ksymoops" program to make | 309 | as is, otherwise you will have to use the "ksymoops" program to make |
312 | sense of the dump (but compiling with CONFIG_KALLSYMS is usually preferred). | 310 | sense of the dump (but compiling with CONFIG_KALLSYMS is usually preferred). |
313 | This utility can be downloaded from | 311 | This utility can be downloaded from |
314 | ftp://ftp.<country>.kernel.org/pub/linux/utils/kernel/ksymoops/ . | 312 | ftp://ftp.<country>.kernel.org/pub/linux/utils/kernel/ksymoops/ . |
315 | Alternately you can do the dump lookup by hand: | 313 | Alternately you can do the dump lookup by hand: |
316 | 314 | ||
317 | - In debugging dumps like the above, it helps enormously if you can | 315 | - In debugging dumps like the above, it helps enormously if you can |
318 | look up what the EIP value means. The hex value as such doesn't help | 316 | look up what the EIP value means. The hex value as such doesn't help |
319 | me or anybody else very much: it will depend on your particular | 317 | me or anybody else very much: it will depend on your particular |
320 | kernel setup. What you should do is take the hex value from the EIP | 318 | kernel setup. What you should do is take the hex value from the EIP |
321 | line (ignore the "0010:"), and look it up in the kernel namelist to | 319 | line (ignore the "0010:"), and look it up in the kernel namelist to |
322 | see which kernel function contains the offending address. | 320 | see which kernel function contains the offending address. |
323 | 321 | ||
324 | To find out the kernel function name, you'll need to find the system | 322 | To find out the kernel function name, you'll need to find the system |
325 | binary associated with the kernel that exhibited the symptom. This is | 323 | binary associated with the kernel that exhibited the symptom. This is |
326 | the file 'linux/vmlinux'. To extract the namelist and match it against | 324 | the file 'linux/vmlinux'. To extract the namelist and match it against |
327 | the EIP from the kernel crash, do: | 325 | the EIP from the kernel crash, do: |
328 | 326 | ||
329 | nm vmlinux | sort | less | 327 | nm vmlinux | sort | less |
330 | 328 | ||
331 | This will give you a list of kernel addresses sorted in ascending | 329 | This will give you a list of kernel addresses sorted in ascending |
332 | order, from which it is simple to find the function that contains the | 330 | order, from which it is simple to find the function that contains the |
333 | offending address. Note that the address given by the kernel | 331 | offending address. Note that the address given by the kernel |
334 | debugging messages will not necessarily match exactly with the | 332 | debugging messages will not necessarily match exactly with the |
335 | function addresses (in fact, that is very unlikely), so you can't | 333 | function addresses (in fact, that is very unlikely), so you can't |
336 | just 'grep' the list: the list will, however, give you the starting | 334 | just 'grep' the list: the list will, however, give you the starting |
337 | point of each kernel function, so by looking for the function that | 335 | point of each kernel function, so by looking for the function that |
338 | has a starting address lower than the one you are searching for but | 336 | has a starting address lower than the one you are searching for but |
339 | is followed by a function with a higher address you will find the one | 337 | is followed by a function with a higher address you will find the one |
340 | you want. In fact, it may be a good idea to include a bit of | 338 | you want. In fact, it may be a good idea to include a bit of |
341 | "context" in your problem report, giving a few lines around the | 339 | "context" in your problem report, giving a few lines around the |
342 | interesting one. | 340 | interesting one. |
343 | 341 | ||
344 | If you for some reason cannot do the above (you have a pre-compiled | 342 | If you for some reason cannot do the above (you have a pre-compiled |
345 | kernel image or similar), telling me as much about your setup as | 343 | kernel image or similar), telling me as much about your setup as |
346 | possible will help. Please read the REPORTING-BUGS document for details. | 344 | possible will help. Please read the REPORTING-BUGS document for details. |
347 | 345 | ||
348 | - Alternately, you can use gdb on a running kernel. (read-only; i.e. you | 346 | - Alternately, you can use gdb on a running kernel. (read-only; i.e. you |
349 | cannot change values or set break points.) To do this, first compile the | 347 | cannot change values or set break points.) To do this, first compile the |
350 | kernel with -g; edit arch/i386/Makefile appropriately, then do a "make | 348 | kernel with -g; edit arch/i386/Makefile appropriately, then do a "make |
351 | clean". You'll also need to enable CONFIG_PROC_FS (via "make config"). | 349 | clean". You'll also need to enable CONFIG_PROC_FS (via "make config"). |
352 | 350 | ||
353 | After you've rebooted with the new kernel, do "gdb vmlinux /proc/kcore". | 351 | After you've rebooted with the new kernel, do "gdb vmlinux /proc/kcore". |
354 | You can now use all the usual gdb commands. The command to look up the | 352 | You can now use all the usual gdb commands. The command to look up the |
355 | point where your system crashed is "l *0xXXXXXXXX". (Replace the XXXes | 353 | point where your system crashed is "l *0xXXXXXXXX". (Replace the XXXes |
356 | with the EIP value.) | 354 | with the EIP value.) |
357 | 355 | ||
358 | gdb'ing a non-running kernel currently fails because gdb (wrongly) | 356 | gdb'ing a non-running kernel currently fails because gdb (wrongly) |
359 | disregards the starting offset for which the kernel is compiled. | 357 | disregards the starting offset for which the kernel is compiled. |
360 | 358 | ||
361 | 359 |
arch/x86/Kconfig
1 | # x86 configuration | 1 | # x86 configuration |
2 | mainmenu "Linux Kernel Configuration for x86" | 2 | mainmenu "Linux Kernel Configuration for x86" |
3 | 3 | ||
4 | # Select 32 or 64 bit | 4 | # Select 32 or 64 bit |
5 | config 64BIT | 5 | config 64BIT |
6 | bool "64-bit kernel" | 6 | bool "64-bit kernel" if ARCH = "x86" |
7 | default n | 7 | default ARCH = "x86_64" |
8 | help | 8 | help |
9 | Say yes to build a 64-bit kernel - formerly known as x86_64 | 9 | Say yes to build a 64-bit kernel - formerly known as x86_64 |
10 | Say no to build a 32-bit kernel - formerly known as i386 | 10 | Say no to build a 32-bit kernel - formerly known as i386 |
11 | 11 | ||
12 | config X86_32 | 12 | config X86_32 |
13 | def_bool !64BIT | 13 | def_bool !64BIT |
14 | 14 | ||
15 | config X86_64 | 15 | config X86_64 |
16 | def_bool 64BIT | 16 | def_bool 64BIT |
17 | 17 | ||
18 | ### Arch settings | 18 | ### Arch settings |
19 | config X86 | 19 | config X86 |
20 | bool | 20 | bool |
21 | default y | 21 | default y |
22 | 22 | ||
23 | config GENERIC_TIME | 23 | config GENERIC_TIME |
24 | bool | 24 | bool |
25 | default y | 25 | default y |
26 | 26 | ||
27 | config GENERIC_CMOS_UPDATE | 27 | config GENERIC_CMOS_UPDATE |
28 | bool | 28 | bool |
29 | default y | 29 | default y |
30 | 30 | ||
31 | config CLOCKSOURCE_WATCHDOG | 31 | config CLOCKSOURCE_WATCHDOG |
32 | bool | 32 | bool |
33 | default y | 33 | default y |
34 | 34 | ||
35 | config GENERIC_CLOCKEVENTS | 35 | config GENERIC_CLOCKEVENTS |
36 | bool | 36 | bool |
37 | default y | 37 | default y |
38 | 38 | ||
39 | config GENERIC_CLOCKEVENTS_BROADCAST | 39 | config GENERIC_CLOCKEVENTS_BROADCAST |
40 | bool | 40 | bool |
41 | default y | 41 | default y |
42 | depends on X86_64 || (X86_32 && X86_LOCAL_APIC) | 42 | depends on X86_64 || (X86_32 && X86_LOCAL_APIC) |
43 | 43 | ||
44 | config LOCKDEP_SUPPORT | 44 | config LOCKDEP_SUPPORT |
45 | bool | 45 | bool |
46 | default y | 46 | default y |
47 | 47 | ||
48 | config STACKTRACE_SUPPORT | 48 | config STACKTRACE_SUPPORT |
49 | bool | 49 | bool |
50 | default y | 50 | default y |
51 | 51 | ||
52 | config SEMAPHORE_SLEEPERS | 52 | config SEMAPHORE_SLEEPERS |
53 | bool | 53 | bool |
54 | default y | 54 | default y |
55 | 55 | ||
56 | config MMU | 56 | config MMU |
57 | bool | 57 | bool |
58 | default y | 58 | default y |
59 | 59 | ||
60 | config ZONE_DMA | 60 | config ZONE_DMA |
61 | bool | 61 | bool |
62 | default y | 62 | default y |
63 | 63 | ||
64 | config QUICKLIST | 64 | config QUICKLIST |
65 | bool | 65 | bool |
66 | default X86_32 | 66 | default X86_32 |
67 | 67 | ||
68 | config SBUS | 68 | config SBUS |
69 | bool | 69 | bool |
70 | 70 | ||
71 | config GENERIC_ISA_DMA | 71 | config GENERIC_ISA_DMA |
72 | bool | 72 | bool |
73 | default y | 73 | default y |
74 | 74 | ||
75 | config GENERIC_IOMAP | 75 | config GENERIC_IOMAP |
76 | bool | 76 | bool |
77 | default y | 77 | default y |
78 | 78 | ||
79 | config GENERIC_BUG | 79 | config GENERIC_BUG |
80 | bool | 80 | bool |
81 | default y | 81 | default y |
82 | depends on BUG | 82 | depends on BUG |
83 | 83 | ||
84 | config GENERIC_HWEIGHT | 84 | config GENERIC_HWEIGHT |
85 | bool | 85 | bool |
86 | default y | 86 | default y |
87 | 87 | ||
88 | config ARCH_MAY_HAVE_PC_FDC | 88 | config ARCH_MAY_HAVE_PC_FDC |
89 | bool | 89 | bool |
90 | default y | 90 | default y |
91 | 91 | ||
92 | config DMI | 92 | config DMI |
93 | bool | 93 | bool |
94 | default y | 94 | default y |
95 | 95 | ||
96 | config RWSEM_GENERIC_SPINLOCK | 96 | config RWSEM_GENERIC_SPINLOCK |
97 | def_bool !X86_XADD | 97 | def_bool !X86_XADD |
98 | 98 | ||
99 | config RWSEM_XCHGADD_ALGORITHM | 99 | config RWSEM_XCHGADD_ALGORITHM |
100 | def_bool X86_XADD | 100 | def_bool X86_XADD |
101 | 101 | ||
102 | config ARCH_HAS_ILOG2_U32 | 102 | config ARCH_HAS_ILOG2_U32 |
103 | def_bool n | 103 | def_bool n |
104 | 104 | ||
105 | config ARCH_HAS_ILOG2_U64 | 105 | config ARCH_HAS_ILOG2_U64 |
106 | def_bool n | 106 | def_bool n |
107 | 107 | ||
108 | config GENERIC_CALIBRATE_DELAY | 108 | config GENERIC_CALIBRATE_DELAY |
109 | def_bool y | 109 | def_bool y |
110 | 110 | ||
111 | config GENERIC_TIME_VSYSCALL | 111 | config GENERIC_TIME_VSYSCALL |
112 | bool | 112 | bool |
113 | default X86_64 | 113 | default X86_64 |
114 | 114 | ||
115 | 115 | ||
116 | 116 | ||
117 | 117 | ||
118 | 118 | ||
119 | config ZONE_DMA32 | 119 | config ZONE_DMA32 |
120 | bool | 120 | bool |
121 | default X86_64 | 121 | default X86_64 |
122 | 122 | ||
123 | config ARCH_POPULATES_NODE_MAP | 123 | config ARCH_POPULATES_NODE_MAP |
124 | def_bool y | 124 | def_bool y |
125 | 125 | ||
126 | config AUDIT_ARCH | 126 | config AUDIT_ARCH |
127 | bool | 127 | bool |
128 | default X86_64 | 128 | default X86_64 |
129 | 129 | ||
130 | # Use the generic interrupt handling code in kernel/irq/: | 130 | # Use the generic interrupt handling code in kernel/irq/: |
131 | config GENERIC_HARDIRQS | 131 | config GENERIC_HARDIRQS |
132 | bool | 132 | bool |
133 | default y | 133 | default y |
134 | 134 | ||
135 | config GENERIC_IRQ_PROBE | 135 | config GENERIC_IRQ_PROBE |
136 | bool | 136 | bool |
137 | default y | 137 | default y |
138 | 138 | ||
139 | config GENERIC_PENDING_IRQ | 139 | config GENERIC_PENDING_IRQ |
140 | bool | 140 | bool |
141 | depends on GENERIC_HARDIRQS && SMP | 141 | depends on GENERIC_HARDIRQS && SMP |
142 | default y | 142 | default y |
143 | 143 | ||
144 | config X86_SMP | 144 | config X86_SMP |
145 | bool | 145 | bool |
146 | depends on X86_32 && SMP && !X86_VOYAGER | 146 | depends on X86_32 && SMP && !X86_VOYAGER |
147 | default y | 147 | default y |
148 | 148 | ||
149 | config X86_HT | 149 | config X86_HT |
150 | bool | 150 | bool |
151 | depends on SMP && !(X86_VISWS || X86_VOYAGER || MK8) | 151 | depends on SMP && !(X86_VISWS || X86_VOYAGER || MK8) |
152 | default y | 152 | default y |
153 | 153 | ||
154 | config X86_BIOS_REBOOT | 154 | config X86_BIOS_REBOOT |
155 | bool | 155 | bool |
156 | depends on X86_32 && !(X86_VISWS || X86_VOYAGER) | 156 | depends on X86_32 && !(X86_VISWS || X86_VOYAGER) |
157 | default y | 157 | default y |
158 | 158 | ||
159 | config X86_TRAMPOLINE | 159 | config X86_TRAMPOLINE |
160 | bool | 160 | bool |
161 | depends on X86_SMP || (X86_VOYAGER && SMP) | 161 | depends on X86_SMP || (X86_VOYAGER && SMP) |
162 | default y | 162 | default y |
163 | 163 | ||
164 | config KTIME_SCALAR | 164 | config KTIME_SCALAR |
165 | def_bool X86_32 | 165 | def_bool X86_32 |
166 | source "init/Kconfig" | 166 | source "init/Kconfig" |
167 | 167 | ||
168 | menu "Processor type and features" | 168 | menu "Processor type and features" |
169 | 169 | ||
170 | source "kernel/time/Kconfig" | 170 | source "kernel/time/Kconfig" |
171 | 171 | ||
172 | config SMP | 172 | config SMP |
173 | bool "Symmetric multi-processing support" | 173 | bool "Symmetric multi-processing support" |
174 | ---help--- | 174 | ---help--- |
175 | This enables support for systems with more than one CPU. If you have | 175 | This enables support for systems with more than one CPU. If you have |
176 | a system with only one CPU, like most personal computers, say N. If | 176 | a system with only one CPU, like most personal computers, say N. If |
177 | you have a system with more than one CPU, say Y. | 177 | you have a system with more than one CPU, say Y. |
178 | 178 | ||
179 | If you say N here, the kernel will run on single and multiprocessor | 179 | If you say N here, the kernel will run on single and multiprocessor |
180 | machines, but will use only one CPU of a multiprocessor machine. If | 180 | machines, but will use only one CPU of a multiprocessor machine. If |
181 | you say Y here, the kernel will run on many, but not all, | 181 | you say Y here, the kernel will run on many, but not all, |
182 | singleprocessor machines. On a singleprocessor machine, the kernel | 182 | singleprocessor machines. On a singleprocessor machine, the kernel |
183 | will run faster if you say N here. | 183 | will run faster if you say N here. |
184 | 184 | ||
185 | Note that if you say Y here and choose architecture "586" or | 185 | Note that if you say Y here and choose architecture "586" or |
186 | "Pentium" under "Processor family", the kernel will not work on 486 | 186 | "Pentium" under "Processor family", the kernel will not work on 486 |
187 | architectures. Similarly, multiprocessor kernels for the "PPro" | 187 | architectures. Similarly, multiprocessor kernels for the "PPro" |
188 | architecture may not work on all Pentium based boards. | 188 | architecture may not work on all Pentium based boards. |
189 | 189 | ||
190 | People using multiprocessor machines who say Y here should also say | 190 | People using multiprocessor machines who say Y here should also say |
191 | Y to "Enhanced Real Time Clock Support", below. The "Advanced Power | 191 | Y to "Enhanced Real Time Clock Support", below. The "Advanced Power |
192 | Management" code will be disabled if you say Y here. | 192 | Management" code will be disabled if you say Y here. |
193 | 193 | ||
194 | See also the <file:Documentation/smp.txt>, | 194 | See also the <file:Documentation/smp.txt>, |
195 | <file:Documentation/i386/IO-APIC.txt>, | 195 | <file:Documentation/i386/IO-APIC.txt>, |
196 | <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at | 196 | <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at |
197 | <http://www.tldp.org/docs.html#howto>. | 197 | <http://www.tldp.org/docs.html#howto>. |
198 | 198 | ||
199 | If you don't know what to do here, say N. | 199 | If you don't know what to do here, say N. |
200 | 200 | ||
201 | choice | 201 | choice |
202 | prompt "Subarchitecture Type" | 202 | prompt "Subarchitecture Type" |
203 | default X86_PC | 203 | default X86_PC |
204 | 204 | ||
205 | config X86_PC | 205 | config X86_PC |
206 | bool "PC-compatible" | 206 | bool "PC-compatible" |
207 | help | 207 | help |
208 | Choose this option if your computer is a standard PC or compatible. | 208 | Choose this option if your computer is a standard PC or compatible. |
209 | 209 | ||
210 | config X86_ELAN | 210 | config X86_ELAN |
211 | bool "AMD Elan" | 211 | bool "AMD Elan" |
212 | depends on X86_32 | 212 | depends on X86_32 |
213 | help | 213 | help |
214 | Select this for an AMD Elan processor. | 214 | Select this for an AMD Elan processor. |
215 | 215 | ||
216 | Do not use this option for K6/Athlon/Opteron processors! | 216 | Do not use this option for K6/Athlon/Opteron processors! |
217 | 217 | ||
218 | If unsure, choose "PC-compatible" instead. | 218 | If unsure, choose "PC-compatible" instead. |
219 | 219 | ||
220 | config X86_VOYAGER | 220 | config X86_VOYAGER |
221 | bool "Voyager (NCR)" | 221 | bool "Voyager (NCR)" |
222 | depends on X86_32 | 222 | depends on X86_32 |
223 | select SMP if !BROKEN | 223 | select SMP if !BROKEN |
224 | help | 224 | help |
225 | Voyager is an MCA-based 32-way capable SMP architecture proprietary | 225 | Voyager is an MCA-based 32-way capable SMP architecture proprietary |
226 | to NCR Corp. Machine classes 345x/35xx/4100/51xx are Voyager-based. | 226 | to NCR Corp. Machine classes 345x/35xx/4100/51xx are Voyager-based. |
227 | 227 | ||
228 | *** WARNING *** | 228 | *** WARNING *** |
229 | 229 | ||
230 | If you do not specifically know you have a Voyager based machine, | 230 | If you do not specifically know you have a Voyager based machine, |
231 | say N here, otherwise the kernel you build will not be bootable. | 231 | say N here, otherwise the kernel you build will not be bootable. |
232 | 232 | ||
233 | config X86_NUMAQ | 233 | config X86_NUMAQ |
234 | bool "NUMAQ (IBM/Sequent)" | 234 | bool "NUMAQ (IBM/Sequent)" |
235 | select SMP | 235 | select SMP |
236 | select NUMA | 236 | select NUMA |
237 | depends on X86_32 | 237 | depends on X86_32 |
238 | help | 238 | help |
239 | This option is used for getting Linux to run on a (IBM/Sequent) NUMA | 239 | This option is used for getting Linux to run on a (IBM/Sequent) NUMA |
240 | multiquad box. This changes the way that processors are bootstrapped, | 240 | multiquad box. This changes the way that processors are bootstrapped, |
241 | and uses Clustered Logical APIC addressing mode instead of Flat Logical. | 241 | and uses Clustered Logical APIC addressing mode instead of Flat Logical. |
242 | You will need a new lynxer.elf file to flash your firmware with - send | 242 | You will need a new lynxer.elf file to flash your firmware with - send |
243 | email to <Martin.Bligh@us.ibm.com>. | 243 | email to <Martin.Bligh@us.ibm.com>. |
244 | 244 | ||
245 | config X86_SUMMIT | 245 | config X86_SUMMIT |
246 | bool "Summit/EXA (IBM x440)" | 246 | bool "Summit/EXA (IBM x440)" |
247 | depends on X86_32 && SMP | 247 | depends on X86_32 && SMP |
248 | help | 248 | help |
249 | This option is needed for IBM systems that use the Summit/EXA chipset. | 249 | This option is needed for IBM systems that use the Summit/EXA chipset. |
250 | In particular, it is needed for the x440. | 250 | In particular, it is needed for the x440. |
251 | 251 | ||
252 | If you don't have one of these computers, you should say N here. | 252 | If you don't have one of these computers, you should say N here. |
253 | If you want to build a NUMA kernel, you must select ACPI. | 253 | If you want to build a NUMA kernel, you must select ACPI. |
254 | 254 | ||
255 | config X86_BIGSMP | 255 | config X86_BIGSMP |
256 | bool "Support for other sub-arch SMP systems with more than 8 CPUs" | 256 | bool "Support for other sub-arch SMP systems with more than 8 CPUs" |
257 | depends on X86_32 && SMP | 257 | depends on X86_32 && SMP |
258 | help | 258 | help |
259 | This option is needed for the systems that have more than 8 CPUs | 259 | This option is needed for the systems that have more than 8 CPUs |
260 | and if the system is not of any sub-arch type above. | 260 | and if the system is not of any sub-arch type above. |
261 | 261 | ||
262 | If you don't have such a system, you should say N here. | 262 | If you don't have such a system, you should say N here. |
263 | 263 | ||
264 | config X86_VISWS | 264 | config X86_VISWS |
265 | bool "SGI 320/540 (Visual Workstation)" | 265 | bool "SGI 320/540 (Visual Workstation)" |
266 | depends on X86_32 | 266 | depends on X86_32 |
267 | help | 267 | help |
268 | The SGI Visual Workstation series is an IA32-based workstation | 268 | The SGI Visual Workstation series is an IA32-based workstation |
269 | based on SGI systems chips with some legacy PC hardware attached. | 269 | based on SGI systems chips with some legacy PC hardware attached. |
270 | 270 | ||
271 | Say Y here to create a kernel to run on the SGI 320 or 540. | 271 | Say Y here to create a kernel to run on the SGI 320 or 540. |
272 | 272 | ||
273 | A kernel compiled for the Visual Workstation will not run on PCs | 273 | A kernel compiled for the Visual Workstation will not run on PCs |
274 | and vice versa. See <file:Documentation/sgi-visws.txt> for details. | 274 | and vice versa. See <file:Documentation/sgi-visws.txt> for details. |
275 | 275 | ||
276 | config X86_GENERICARCH | 276 | config X86_GENERICARCH |
277 | bool "Generic architecture (Summit, bigsmp, ES7000, default)" | 277 | bool "Generic architecture (Summit, bigsmp, ES7000, default)" |
278 | depends on X86_32 | 278 | depends on X86_32 |
279 | help | 279 | help |
280 | This option compiles in the Summit, bigsmp, ES7000, default subarchitectures. | 280 | This option compiles in the Summit, bigsmp, ES7000, default subarchitectures. |
281 | It is intended for a generic binary kernel. | 281 | It is intended for a generic binary kernel. |
282 | If you want a NUMA kernel, select ACPI. We need SRAT for NUMA. | 282 | If you want a NUMA kernel, select ACPI. We need SRAT for NUMA. |
283 | 283 | ||
284 | config X86_ES7000 | 284 | config X86_ES7000 |
285 | bool "Support for Unisys ES7000 IA32 series" | 285 | bool "Support for Unisys ES7000 IA32 series" |
286 | depends on X86_32 && SMP | 286 | depends on X86_32 && SMP |
287 | help | 287 | help |
288 | Support for Unisys ES7000 systems. Say 'Y' here if this kernel is | 288 | Support for Unisys ES7000 systems. Say 'Y' here if this kernel is |
289 | supposed to run on an IA32-based Unisys ES7000 system. | 289 | supposed to run on an IA32-based Unisys ES7000 system. |
290 | Only choose this option if you have such a system, otherwise you | 290 | Only choose this option if you have such a system, otherwise you |
291 | should say N here. | 291 | should say N here. |
292 | 292 | ||
293 | config X86_VSMP | 293 | config X86_VSMP |
294 | bool "Support for ScaleMP vSMP" | 294 | bool "Support for ScaleMP vSMP" |
295 | depends on X86_64 && PCI | 295 | depends on X86_64 && PCI |
296 | help | 296 | help |
297 | Support for ScaleMP vSMP systems. Say 'Y' here if this kernel is | 297 | Support for ScaleMP vSMP systems. Say 'Y' here if this kernel is |
298 | supposed to run on these EM64T-based machines. Only choose this option | 298 | supposed to run on these EM64T-based machines. Only choose this option |
299 | if you have one of these machines. | 299 | if you have one of these machines. |
300 | 300 | ||
301 | endchoice | 301 | endchoice |
302 | 302 | ||
303 | config SCHED_NO_NO_OMIT_FRAME_POINTER | 303 | config SCHED_NO_NO_OMIT_FRAME_POINTER |
304 | bool "Single-depth WCHAN output" | 304 | bool "Single-depth WCHAN output" |
305 | default y | 305 | default y |
306 | depends on X86_32 | 306 | depends on X86_32 |
307 | help | 307 | help |
308 | Calculate simpler /proc/<PID>/wchan values. If this option | 308 | Calculate simpler /proc/<PID>/wchan values. If this option |
309 | is disabled then wchan values will recurse back to the | 309 | is disabled then wchan values will recurse back to the |
310 | caller function. This provides more accurate wchan values, | 310 | caller function. This provides more accurate wchan values, |
311 | at the expense of slightly more scheduling overhead. | 311 | at the expense of slightly more scheduling overhead. |
312 | 312 | ||
313 | If in doubt, say "Y". | 313 | If in doubt, say "Y". |
314 | 314 | ||
315 | config PARAVIRT | 315 | config PARAVIRT |
316 | bool | 316 | bool |
317 | depends on X86_32 && !(X86_VISWS || X86_VOYAGER) | 317 | depends on X86_32 && !(X86_VISWS || X86_VOYAGER) |
318 | help | 318 | help |
319 | This changes the kernel so it can modify itself when it is run | 319 | This changes the kernel so it can modify itself when it is run |
320 | under a hypervisor, potentially improving performance significantly | 320 | under a hypervisor, potentially improving performance significantly |
321 | over full virtualization. However, when run without a hypervisor | 321 | over full virtualization. However, when run without a hypervisor |
322 | the kernel is theoretically slower and slightly larger. | 322 | the kernel is theoretically slower and slightly larger. |
323 | 323 | ||
324 | menuconfig PARAVIRT_GUEST | 324 | menuconfig PARAVIRT_GUEST |
325 | bool "Paravirtualized guest support" | 325 | bool "Paravirtualized guest support" |
326 | depends on X86_32 | 326 | depends on X86_32 |
327 | help | 327 | help |
328 | Say Y here to get to see options related to running Linux under | 328 | Say Y here to get to see options related to running Linux under |
329 | various hypervisors. This option alone does not add any kernel code. | 329 | various hypervisors. This option alone does not add any kernel code. |
330 | 330 | ||
331 | If you say N, all options in this submenu will be skipped and disabled. | 331 | If you say N, all options in this submenu will be skipped and disabled. |
332 | 332 | ||
333 | if PARAVIRT_GUEST | 333 | if PARAVIRT_GUEST |
334 | 334 | ||
335 | source "arch/x86/xen/Kconfig" | 335 | source "arch/x86/xen/Kconfig" |
336 | 336 | ||
337 | config VMI | 337 | config VMI |
338 | bool "VMI Guest support" | 338 | bool "VMI Guest support" |
339 | select PARAVIRT | 339 | select PARAVIRT |
340 | depends on !(X86_VISWS || X86_VOYAGER) | 340 | depends on !(X86_VISWS || X86_VOYAGER) |
341 | help | 341 | help |
342 | VMI provides a paravirtualized interface to the VMware ESX server | 342 | VMI provides a paravirtualized interface to the VMware ESX server |
343 | (it could be used by other hypervisors in theory too, but is not | 343 | (it could be used by other hypervisors in theory too, but is not |
344 | at the moment), by linking the kernel to a GPL-ed ROM module | 344 | at the moment), by linking the kernel to a GPL-ed ROM module |
345 | provided by the hypervisor. | 345 | provided by the hypervisor. |
346 | 346 | ||
347 | source "arch/x86/lguest/Kconfig" | 347 | source "arch/x86/lguest/Kconfig" |
348 | 348 | ||
349 | endif | 349 | endif |
350 | 350 | ||
351 | config ACPI_SRAT | 351 | config ACPI_SRAT |
352 | bool | 352 | bool |
353 | default y | 353 | default y |
354 | depends on X86_32 && ACPI && NUMA && (X86_SUMMIT || X86_GENERICARCH) | 354 | depends on X86_32 && ACPI && NUMA && (X86_SUMMIT || X86_GENERICARCH) |
355 | select ACPI_NUMA | 355 | select ACPI_NUMA |
356 | 356 | ||
357 | config HAVE_ARCH_PARSE_SRAT | 357 | config HAVE_ARCH_PARSE_SRAT |
358 | bool | 358 | bool |
359 | default y | 359 | default y |
360 | depends on ACPI_SRAT | 360 | depends on ACPI_SRAT |
361 | 361 | ||
362 | config X86_SUMMIT_NUMA | 362 | config X86_SUMMIT_NUMA |
363 | bool | 363 | bool |
364 | default y | 364 | default y |
365 | depends on X86_32 && NUMA && (X86_SUMMIT || X86_GENERICARCH) | 365 | depends on X86_32 && NUMA && (X86_SUMMIT || X86_GENERICARCH) |
366 | 366 | ||
367 | config X86_CYCLONE_TIMER | 367 | config X86_CYCLONE_TIMER |
368 | bool | 368 | bool |
369 | default y | 369 | default y |
370 | depends on X86_32 && X86_SUMMIT || X86_GENERICARCH | 370 | depends on X86_32 && X86_SUMMIT || X86_GENERICARCH |
371 | 371 | ||
372 | config ES7000_CLUSTERED_APIC | 372 | config ES7000_CLUSTERED_APIC |
373 | bool | 373 | bool |
374 | default y | 374 | default y |
375 | depends on SMP && X86_ES7000 && MPENTIUMIII | 375 | depends on SMP && X86_ES7000 && MPENTIUMIII |
376 | 376 | ||
377 | source "arch/x86/Kconfig.cpu" | 377 | source "arch/x86/Kconfig.cpu" |
378 | 378 | ||
379 | config HPET_TIMER | 379 | config HPET_TIMER |
380 | bool | 380 | bool |
381 | prompt "HPET Timer Support" if X86_32 | 381 | prompt "HPET Timer Support" if X86_32 |
382 | default X86_64 | 382 | default X86_64 |
383 | help | 383 | help |
384 | Use the IA-PC HPET (High Precision Event Timer) to manage | 384 | Use the IA-PC HPET (High Precision Event Timer) to manage |
385 | time in preference to the PIT and RTC, if a HPET is | 385 | time in preference to the PIT and RTC, if a HPET is |
386 | present. | 386 | present. |
387 | HPET is the next generation timer replacing legacy 8254s. | 387 | HPET is the next generation timer replacing legacy 8254s. |
388 | The HPET provides a stable time base on SMP | 388 | The HPET provides a stable time base on SMP |
389 | systems, unlike the TSC, but it is more expensive to access, | 389 | systems, unlike the TSC, but it is more expensive to access, |
390 | as it is off-chip. You can find the HPET spec at | 390 | as it is off-chip. You can find the HPET spec at |
391 | <http://www.intel.com/hardwaredesign/hpetspec.htm>. | 391 | <http://www.intel.com/hardwaredesign/hpetspec.htm>. |
392 | 392 | ||
393 | You can safely choose Y here. However, HPET will only be | 393 | You can safely choose Y here. However, HPET will only be |
394 | activated if the platform and the BIOS support this feature. | 394 | activated if the platform and the BIOS support this feature. |
395 | Otherwise the 8254 will be used for timing services. | 395 | Otherwise the 8254 will be used for timing services. |
396 | 396 | ||
397 | Choose N to continue using the legacy 8254 timer. | 397 | Choose N to continue using the legacy 8254 timer. |
398 | 398 | ||
399 | config HPET_EMULATE_RTC | 399 | config HPET_EMULATE_RTC |
400 | bool | 400 | bool |
401 | depends on HPET_TIMER && RTC=y | 401 | depends on HPET_TIMER && RTC=y |
402 | default y | 402 | default y |
403 | 403 | ||
404 | # Mark as embedded because too many people got it wrong. | 404 | # Mark as embedded because too many people got it wrong. |
405 | # The code disables itself when not needed. | 405 | # The code disables itself when not needed. |
406 | config GART_IOMMU | 406 | config GART_IOMMU |
407 | bool "GART IOMMU support" if EMBEDDED | 407 | bool "GART IOMMU support" if EMBEDDED |
408 | default y | 408 | default y |
409 | select SWIOTLB | 409 | select SWIOTLB |
410 | select AGP | 410 | select AGP |
411 | depends on X86_64 && PCI | 411 | depends on X86_64 && PCI |
412 | help | 412 | help |
413 | Support for full DMA access of devices with 32bit memory access only | 413 | Support for full DMA access of devices with 32bit memory access only |
414 | on systems with more than 3GB. This is usually needed for USB, | 414 | on systems with more than 3GB. This is usually needed for USB, |
415 | sound, many IDE/SATA chipsets and some other devices. | 415 | sound, many IDE/SATA chipsets and some other devices. |
416 | Provides a driver for the AMD Athlon64/Opteron/Turion/Sempron GART | 416 | Provides a driver for the AMD Athlon64/Opteron/Turion/Sempron GART |
417 | based hardware IOMMU and a software bounce buffer based IOMMU used | 417 | based hardware IOMMU and a software bounce buffer based IOMMU used |
418 | on Intel systems and as fallback. | 418 | on Intel systems and as fallback. |
419 | The code is only active when needed (enough memory and limited | 419 | The code is only active when needed (enough memory and limited |
420 | device) unless CONFIG_IOMMU_DEBUG or iommu=force is specified | 420 | device) unless CONFIG_IOMMU_DEBUG or iommu=force is specified |
421 | too. | 421 | too. |
422 | 422 | ||
423 | config CALGARY_IOMMU | 423 | config CALGARY_IOMMU |
424 | bool "IBM Calgary IOMMU support" | 424 | bool "IBM Calgary IOMMU support" |
425 | select SWIOTLB | 425 | select SWIOTLB |
426 | depends on X86_64 && PCI && EXPERIMENTAL | 426 | depends on X86_64 && PCI && EXPERIMENTAL |
427 | help | 427 | help |
428 | Support for hardware IOMMUs in IBM's xSeries x366 and x460 | 428 | Support for hardware IOMMUs in IBM's xSeries x366 and x460 |
429 | systems. Needed to run systems with more than 3GB of memory | 429 | systems. Needed to run systems with more than 3GB of memory |
430 | properly with 32-bit PCI devices that do not support DAC | 430 | properly with 32-bit PCI devices that do not support DAC |
431 | (Double Address Cycle). Calgary also supports bus level | 431 | (Double Address Cycle). Calgary also supports bus level |
432 | isolation, where all DMAs pass through the IOMMU. This | 432 | isolation, where all DMAs pass through the IOMMU. This |
433 | prevents them from going anywhere except their intended | 433 | prevents them from going anywhere except their intended |
434 | destination. This catches hard-to-find kernel bugs and | 434 | destination. This catches hard-to-find kernel bugs and |
435 | mis-behaving drivers and devices that do not use the DMA-API | 435 | mis-behaving drivers and devices that do not use the DMA-API |
436 | properly to set up their DMA buffers. The IOMMU can be | 436 | properly to set up their DMA buffers. The IOMMU can be |
437 | turned off at boot time with the iommu=off parameter. | 437 | turned off at boot time with the iommu=off parameter. |
438 | Normally the kernel will make the right choice by itself. | 438 | Normally the kernel will make the right choice by itself. |
439 | If unsure, say Y. | 439 | If unsure, say Y. |
440 | 440 | ||
441 | config CALGARY_IOMMU_ENABLED_BY_DEFAULT | 441 | config CALGARY_IOMMU_ENABLED_BY_DEFAULT |
442 | bool "Should Calgary be enabled by default?" | 442 | bool "Should Calgary be enabled by default?" |
443 | default y | 443 | default y |
444 | depends on CALGARY_IOMMU | 444 | depends on CALGARY_IOMMU |
445 | help | 445 | help |
446 | Should Calgary be enabled by default? if you choose 'y', Calgary | 446 | Should Calgary be enabled by default? if you choose 'y', Calgary |
447 | will be used (if it exists). If you choose 'n', Calgary will not be | 447 | will be used (if it exists). If you choose 'n', Calgary will not be |
448 | used even if it exists. If you choose 'n' and would like to use | 448 | used even if it exists. If you choose 'n' and would like to use |
449 | Calgary anyway, pass 'iommu=calgary' on the kernel command line. | 449 | Calgary anyway, pass 'iommu=calgary' on the kernel command line. |
450 | If unsure, say Y. | 450 | If unsure, say Y. |
451 | 451 | ||
452 | # need this always selected by IOMMU for the VIA workaround | 452 | # need this always selected by IOMMU for the VIA workaround |
453 | config SWIOTLB | 453 | config SWIOTLB |
454 | bool | 454 | bool |
455 | help | 455 | help |
456 | Support for software bounce buffers used on x86-64 systems | 456 | Support for software bounce buffers used on x86-64 systems |
457 | which don't have a hardware IOMMU (e.g. the current generation | 457 | which don't have a hardware IOMMU (e.g. the current generation |
458 | of Intel's x86-64 CPUs). Using this PCI devices which can only | 458 | of Intel's x86-64 CPUs). Using this PCI devices which can only |
459 | access 32-bits of memory can be used on systems with more than | 459 | access 32-bits of memory can be used on systems with more than |
460 | 3 GB of memory. If unsure, say Y. | 460 | 3 GB of memory. If unsure, say Y. |
461 | 461 | ||
462 | 462 | ||
463 | config NR_CPUS | 463 | config NR_CPUS |
464 | int "Maximum number of CPUs (2-255)" | 464 | int "Maximum number of CPUs (2-255)" |
465 | range 2 255 | 465 | range 2 255 |
466 | depends on SMP | 466 | depends on SMP |
467 | default "32" if X86_NUMAQ || X86_SUMMIT || X86_BIGSMP || X86_ES7000 | 467 | default "32" if X86_NUMAQ || X86_SUMMIT || X86_BIGSMP || X86_ES7000 |
468 | default "8" | 468 | default "8" |
469 | help | 469 | help |
470 | This allows you to specify the maximum number of CPUs which this | 470 | This allows you to specify the maximum number of CPUs which this |
471 | kernel will support. The maximum supported value is 255 and the | 471 | kernel will support. The maximum supported value is 255 and the |
472 | minimum value which makes sense is 2. | 472 | minimum value which makes sense is 2. |
473 | 473 | ||
474 | This is purely to save memory - each supported CPU adds | 474 | This is purely to save memory - each supported CPU adds |
475 | approximately eight kilobytes to the kernel image. | 475 | approximately eight kilobytes to the kernel image. |
476 | 476 | ||
477 | config SCHED_SMT | 477 | config SCHED_SMT |
478 | bool "SMT (Hyperthreading) scheduler support" | 478 | bool "SMT (Hyperthreading) scheduler support" |
479 | depends on (X86_64 && SMP) || (X86_32 && X86_HT) | 479 | depends on (X86_64 && SMP) || (X86_32 && X86_HT) |
480 | help | 480 | help |
481 | SMT scheduler support improves the CPU scheduler's decision making | 481 | SMT scheduler support improves the CPU scheduler's decision making |
482 | when dealing with Intel Pentium 4 chips with HyperThreading at a | 482 | when dealing with Intel Pentium 4 chips with HyperThreading at a |
483 | cost of slightly increased overhead in some places. If unsure say | 483 | cost of slightly increased overhead in some places. If unsure say |
484 | N here. | 484 | N here. |
485 | 485 | ||
486 | config SCHED_MC | 486 | config SCHED_MC |
487 | bool "Multi-core scheduler support" | 487 | bool "Multi-core scheduler support" |
488 | depends on (X86_64 && SMP) || (X86_32 && X86_HT) | 488 | depends on (X86_64 && SMP) || (X86_32 && X86_HT) |
489 | default y | 489 | default y |
490 | help | 490 | help |
491 | Multi-core scheduler support improves the CPU scheduler's decision | 491 | Multi-core scheduler support improves the CPU scheduler's decision |
492 | making when dealing with multi-core CPU chips at a cost of slightly | 492 | making when dealing with multi-core CPU chips at a cost of slightly |
493 | increased overhead in some places. If unsure say N here. | 493 | increased overhead in some places. If unsure say N here. |
494 | 494 | ||
495 | source "kernel/Kconfig.preempt" | 495 | source "kernel/Kconfig.preempt" |
496 | 496 | ||
497 | config X86_UP_APIC | 497 | config X86_UP_APIC |
498 | bool "Local APIC support on uniprocessors" | 498 | bool "Local APIC support on uniprocessors" |
499 | depends on X86_32 && !SMP && !(X86_VISWS || X86_VOYAGER || X86_GENERICARCH) | 499 | depends on X86_32 && !SMP && !(X86_VISWS || X86_VOYAGER || X86_GENERICARCH) |
500 | help | 500 | help |
501 | A local APIC (Advanced Programmable Interrupt Controller) is an | 501 | A local APIC (Advanced Programmable Interrupt Controller) is an |
502 | integrated interrupt controller in the CPU. If you have a single-CPU | 502 | integrated interrupt controller in the CPU. If you have a single-CPU |
503 | system which has a processor with a local APIC, you can say Y here to | 503 | system which has a processor with a local APIC, you can say Y here to |
504 | enable and use it. If you say Y here even though your machine doesn't | 504 | enable and use it. If you say Y here even though your machine doesn't |
505 | have a local APIC, then the kernel will still run with no slowdown at | 505 | have a local APIC, then the kernel will still run with no slowdown at |
506 | all. The local APIC supports CPU-generated self-interrupts (timer, | 506 | all. The local APIC supports CPU-generated self-interrupts (timer, |
507 | performance counters), and the NMI watchdog which detects hard | 507 | performance counters), and the NMI watchdog which detects hard |
508 | lockups. | 508 | lockups. |
509 | 509 | ||
510 | config X86_UP_IOAPIC | 510 | config X86_UP_IOAPIC |
511 | bool "IO-APIC support on uniprocessors" | 511 | bool "IO-APIC support on uniprocessors" |
512 | depends on X86_UP_APIC | 512 | depends on X86_UP_APIC |
513 | help | 513 | help |
514 | An IO-APIC (I/O Advanced Programmable Interrupt Controller) is an | 514 | An IO-APIC (I/O Advanced Programmable Interrupt Controller) is an |
515 | SMP-capable replacement for PC-style interrupt controllers. Most | 515 | SMP-capable replacement for PC-style interrupt controllers. Most |
516 | SMP systems and many recent uniprocessor systems have one. | 516 | SMP systems and many recent uniprocessor systems have one. |
517 | 517 | ||
518 | If you have a single-CPU system with an IO-APIC, you can say Y here | 518 | If you have a single-CPU system with an IO-APIC, you can say Y here |
519 | to use it. If you say Y here even though your machine doesn't have | 519 | to use it. If you say Y here even though your machine doesn't have |
520 | an IO-APIC, then the kernel will still run with no slowdown at all. | 520 | an IO-APIC, then the kernel will still run with no slowdown at all. |
521 | 521 | ||
522 | config X86_LOCAL_APIC | 522 | config X86_LOCAL_APIC |
523 | bool | 523 | bool |
524 | depends on X86_64 || (X86_32 && (X86_UP_APIC || ((X86_VISWS || SMP) && !X86_VOYAGER) || X86_GENERICARCH)) | 524 | depends on X86_64 || (X86_32 && (X86_UP_APIC || ((X86_VISWS || SMP) && !X86_VOYAGER) || X86_GENERICARCH)) |
525 | default y | 525 | default y |
526 | 526 | ||
527 | config X86_IO_APIC | 527 | config X86_IO_APIC |
528 | bool | 528 | bool |
529 | depends on X86_64 || (X86_32 && (X86_UP_IOAPIC || (SMP && !(X86_VISWS || X86_VOYAGER)) || X86_GENERICARCH)) | 529 | depends on X86_64 || (X86_32 && (X86_UP_IOAPIC || (SMP && !(X86_VISWS || X86_VOYAGER)) || X86_GENERICARCH)) |
530 | default y | 530 | default y |
531 | 531 | ||
532 | config X86_VISWS_APIC | 532 | config X86_VISWS_APIC |
533 | bool | 533 | bool |
534 | depends on X86_32 && X86_VISWS | 534 | depends on X86_32 && X86_VISWS |
535 | default y | 535 | default y |
536 | 536 | ||
537 | config X86_MCE | 537 | config X86_MCE |
538 | bool "Machine Check Exception" | 538 | bool "Machine Check Exception" |
539 | depends on !X86_VOYAGER | 539 | depends on !X86_VOYAGER |
540 | ---help--- | 540 | ---help--- |
541 | Machine Check Exception support allows the processor to notify the | 541 | Machine Check Exception support allows the processor to notify the |
542 | kernel if it detects a problem (e.g. overheating, component failure). | 542 | kernel if it detects a problem (e.g. overheating, component failure). |
543 | The action the kernel takes depends on the severity of the problem, | 543 | The action the kernel takes depends on the severity of the problem, |
544 | ranging from a warning message on the console, to halting the machine. | 544 | ranging from a warning message on the console, to halting the machine. |
545 | Your processor must be a Pentium or newer to support this - check the | 545 | Your processor must be a Pentium or newer to support this - check the |
546 | flags in /proc/cpuinfo for mce. Note that some older Pentium systems | 546 | flags in /proc/cpuinfo for mce. Note that some older Pentium systems |
547 | have a design flaw which leads to false MCE events - hence MCE is | 547 | have a design flaw which leads to false MCE events - hence MCE is |
548 | disabled on all P5 processors, unless explicitly enabled with "mce" | 548 | disabled on all P5 processors, unless explicitly enabled with "mce" |
549 | as a boot argument. Similarly, if MCE is built in and creates a | 549 | as a boot argument. Similarly, if MCE is built in and creates a |
550 | problem on some new non-standard machine, you can boot with "nomce" | 550 | problem on some new non-standard machine, you can boot with "nomce" |
551 | to disable it. MCE support simply ignores non-MCE processors like | 551 | to disable it. MCE support simply ignores non-MCE processors like |
552 | the 386 and 486, so nearly everyone can say Y here. | 552 | the 386 and 486, so nearly everyone can say Y here. |
553 | 553 | ||
554 | config X86_MCE_INTEL | 554 | config X86_MCE_INTEL |
555 | bool "Intel MCE features" | 555 | bool "Intel MCE features" |
556 | depends on X86_64 && X86_MCE && X86_LOCAL_APIC | 556 | depends on X86_64 && X86_MCE && X86_LOCAL_APIC |
557 | default y | 557 | default y |
558 | help | 558 | help |
559 | Additional support for intel specific MCE features such as | 559 | Additional support for intel specific MCE features such as |
560 | the thermal monitor. | 560 | the thermal monitor. |
561 | 561 | ||
562 | config X86_MCE_AMD | 562 | config X86_MCE_AMD |
563 | bool "AMD MCE features" | 563 | bool "AMD MCE features" |
564 | depends on X86_64 && X86_MCE && X86_LOCAL_APIC | 564 | depends on X86_64 && X86_MCE && X86_LOCAL_APIC |
565 | default y | 565 | default y |
566 | help | 566 | help |
567 | Additional support for AMD specific MCE features such as | 567 | Additional support for AMD specific MCE features such as |
568 | the DRAM Error Threshold. | 568 | the DRAM Error Threshold. |
569 | 569 | ||
570 | config X86_MCE_NONFATAL | 570 | config X86_MCE_NONFATAL |
571 | tristate "Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4" | 571 | tristate "Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4" |
572 | depends on X86_32 && X86_MCE | 572 | depends on X86_32 && X86_MCE |
573 | help | 573 | help |
574 | Enabling this feature starts a timer that triggers every 5 seconds which | 574 | Enabling this feature starts a timer that triggers every 5 seconds which |
575 | will look at the machine check registers to see if anything happened. | 575 | will look at the machine check registers to see if anything happened. |
576 | Non-fatal problems automatically get corrected (but still logged). | 576 | Non-fatal problems automatically get corrected (but still logged). |
577 | Disable this if you don't want to see these messages. | 577 | Disable this if you don't want to see these messages. |
578 | Seeing the messages this option prints out may be indicative of dying | 578 | Seeing the messages this option prints out may be indicative of dying |
579 | or out-of-spec (ie, overclocked) hardware. | 579 | or out-of-spec (ie, overclocked) hardware. |
580 | This option only does something on certain CPUs. | 580 | This option only does something on certain CPUs. |
581 | (AMD Athlon/Duron and Intel Pentium 4) | 581 | (AMD Athlon/Duron and Intel Pentium 4) |
582 | 582 | ||
583 | config X86_MCE_P4THERMAL | 583 | config X86_MCE_P4THERMAL |
584 | bool "check for P4 thermal throttling interrupt." | 584 | bool "check for P4 thermal throttling interrupt." |
585 | depends on X86_32 && X86_MCE && (X86_UP_APIC || SMP) && !X86_VISWS | 585 | depends on X86_32 && X86_MCE && (X86_UP_APIC || SMP) && !X86_VISWS |
586 | help | 586 | help |
587 | Enabling this feature will cause a message to be printed when the P4 | 587 | Enabling this feature will cause a message to be printed when the P4 |
588 | enters thermal throttling. | 588 | enters thermal throttling. |
589 | 589 | ||
590 | config VM86 | 590 | config VM86 |
591 | bool "Enable VM86 support" if EMBEDDED | 591 | bool "Enable VM86 support" if EMBEDDED |
592 | default y | 592 | default y |
593 | depends on X86_32 | 593 | depends on X86_32 |
594 | help | 594 | help |
595 | This option is required by programs like DOSEMU to run 16-bit legacy | 595 | This option is required by programs like DOSEMU to run 16-bit legacy |
596 | code on X86 processors. It also may be needed by software like | 596 | code on X86 processors. It also may be needed by software like |
597 | XFree86 to initialize some video cards via BIOS. Disabling this | 597 | XFree86 to initialize some video cards via BIOS. Disabling this |
598 | option saves about 6k. | 598 | option saves about 6k. |
599 | 599 | ||
600 | config TOSHIBA | 600 | config TOSHIBA |
601 | tristate "Toshiba Laptop support" | 601 | tristate "Toshiba Laptop support" |
602 | depends on X86_32 | 602 | depends on X86_32 |
603 | ---help--- | 603 | ---help--- |
604 | This adds a driver to safely access the System Management Mode of | 604 | This adds a driver to safely access the System Management Mode of |
605 | the CPU on Toshiba portables with a genuine Toshiba BIOS. It does | 605 | the CPU on Toshiba portables with a genuine Toshiba BIOS. It does |
606 | not work on models with a Phoenix BIOS. The System Management Mode | 606 | not work on models with a Phoenix BIOS. The System Management Mode |
607 | is used to set the BIOS and power saving options on Toshiba portables. | 607 | is used to set the BIOS and power saving options on Toshiba portables. |
608 | 608 | ||
609 | For information on utilities to make use of this driver see the | 609 | For information on utilities to make use of this driver see the |
610 | Toshiba Linux utilities web site at: | 610 | Toshiba Linux utilities web site at: |
611 | <http://www.buzzard.org.uk/toshiba/>. | 611 | <http://www.buzzard.org.uk/toshiba/>. |
612 | 612 | ||
613 | Say Y if you intend to run this kernel on a Toshiba portable. | 613 | Say Y if you intend to run this kernel on a Toshiba portable. |
614 | Say N otherwise. | 614 | Say N otherwise. |
615 | 615 | ||
616 | config I8K | 616 | config I8K |
617 | tristate "Dell laptop support" | 617 | tristate "Dell laptop support" |
618 | depends on X86_32 | 618 | depends on X86_32 |
619 | ---help--- | 619 | ---help--- |
620 | This adds a driver to safely access the System Management Mode | 620 | This adds a driver to safely access the System Management Mode |
621 | of the CPU on the Dell Inspiron 8000. The System Management Mode | 621 | of the CPU on the Dell Inspiron 8000. The System Management Mode |
622 | is used to read cpu temperature and cooling fan status and to | 622 | is used to read cpu temperature and cooling fan status and to |
623 | control the fans on the I8K portables. | 623 | control the fans on the I8K portables. |
624 | 624 | ||
625 | This driver has been tested only on the Inspiron 8000 but it may | 625 | This driver has been tested only on the Inspiron 8000 but it may |
626 | also work with other Dell laptops. You can force loading on other | 626 | also work with other Dell laptops. You can force loading on other |
627 | models by passing the parameter `force=1' to the module. Use at | 627 | models by passing the parameter `force=1' to the module. Use at |
628 | your own risk. | 628 | your own risk. |
629 | 629 | ||
630 | For information on utilities to make use of this driver see the | 630 | For information on utilities to make use of this driver see the |
631 | I8K Linux utilities web site at: | 631 | I8K Linux utilities web site at: |
632 | <http://people.debian.org/~dz/i8k/> | 632 | <http://people.debian.org/~dz/i8k/> |
633 | 633 | ||
634 | Say Y if you intend to run this kernel on a Dell Inspiron 8000. | 634 | Say Y if you intend to run this kernel on a Dell Inspiron 8000. |
635 | Say N otherwise. | 635 | Say N otherwise. |
636 | 636 | ||
637 | config X86_REBOOTFIXUPS | 637 | config X86_REBOOTFIXUPS |
638 | bool "Enable X86 board specific fixups for reboot" | 638 | bool "Enable X86 board specific fixups for reboot" |
639 | depends on X86_32 && X86 | 639 | depends on X86_32 && X86 |
640 | default n | 640 | default n |
641 | ---help--- | 641 | ---help--- |
642 | This enables chipset and/or board specific fixups to be done | 642 | This enables chipset and/or board specific fixups to be done |
643 | in order to get reboot to work correctly. This is only needed on | 643 | in order to get reboot to work correctly. This is only needed on |
644 | some combinations of hardware and BIOS. The symptom, for which | 644 | some combinations of hardware and BIOS. The symptom, for which |
645 | this config is intended, is when reboot ends with a stalled/hung | 645 | this config is intended, is when reboot ends with a stalled/hung |
646 | system. | 646 | system. |
647 | 647 | ||
648 | Currently, the only fixup is for the Geode machines using | 648 | Currently, the only fixup is for the Geode machines using |
649 | CS5530A and CS5536 chipsets. | 649 | CS5530A and CS5536 chipsets. |
650 | 650 | ||
651 | Say Y if you want to enable the fixup. Currently, it's safe to | 651 | Say Y if you want to enable the fixup. Currently, it's safe to |
652 | enable this option even if you don't need it. | 652 | enable this option even if you don't need it. |
653 | Say N otherwise. | 653 | Say N otherwise. |
654 | 654 | ||
655 | config MICROCODE | 655 | config MICROCODE |
656 | tristate "/dev/cpu/microcode - Intel IA32 CPU microcode support" | 656 | tristate "/dev/cpu/microcode - Intel IA32 CPU microcode support" |
657 | select FW_LOADER | 657 | select FW_LOADER |
658 | ---help--- | 658 | ---help--- |
659 | If you say Y here, you will be able to update the microcode on | 659 | If you say Y here, you will be able to update the microcode on |
660 | Intel processors in the IA32 family, e.g. Pentium Pro, Pentium II, | 660 | Intel processors in the IA32 family, e.g. Pentium Pro, Pentium II, |
661 | Pentium III, Pentium 4, Xeon etc. You will obviously need the | 661 | Pentium III, Pentium 4, Xeon etc. You will obviously need the |
662 | actual microcode binary data itself which is not shipped with the | 662 | actual microcode binary data itself which is not shipped with the |
663 | Linux kernel. | 663 | Linux kernel. |
664 | 664 | ||
665 | For latest news and information on obtaining all the required | 665 | For latest news and information on obtaining all the required |
666 | ingredients for this driver, check: | 666 | ingredients for this driver, check: |
667 | <http://www.urbanmyth.org/microcode/>. | 667 | <http://www.urbanmyth.org/microcode/>. |
668 | 668 | ||
669 | To compile this driver as a module, choose M here: the | 669 | To compile this driver as a module, choose M here: the |
670 | module will be called microcode. | 670 | module will be called microcode. |
671 | 671 | ||
672 | config MICROCODE_OLD_INTERFACE | 672 | config MICROCODE_OLD_INTERFACE |
673 | bool | 673 | bool |
674 | depends on MICROCODE | 674 | depends on MICROCODE |
675 | default y | 675 | default y |
676 | 676 | ||
677 | config X86_MSR | 677 | config X86_MSR |
678 | tristate "/dev/cpu/*/msr - Model-specific register support" | 678 | tristate "/dev/cpu/*/msr - Model-specific register support" |
679 | help | 679 | help |
680 | This device gives privileged processes access to the x86 | 680 | This device gives privileged processes access to the x86 |
681 | Model-Specific Registers (MSRs). It is a character device with | 681 | Model-Specific Registers (MSRs). It is a character device with |
682 | major 202 and minors 0 to 31 for /dev/cpu/0/msr to /dev/cpu/31/msr. | 682 | major 202 and minors 0 to 31 for /dev/cpu/0/msr to /dev/cpu/31/msr. |
683 | MSR accesses are directed to a specific CPU on multi-processor | 683 | MSR accesses are directed to a specific CPU on multi-processor |
684 | systems. | 684 | systems. |
685 | 685 | ||
686 | config X86_CPUID | 686 | config X86_CPUID |
687 | tristate "/dev/cpu/*/cpuid - CPU information support" | 687 | tristate "/dev/cpu/*/cpuid - CPU information support" |
688 | help | 688 | help |
689 | This device gives processes access to the x86 CPUID instruction to | 689 | This device gives processes access to the x86 CPUID instruction to |
690 | be executed on a specific processor. It is a character device | 690 | be executed on a specific processor. It is a character device |
691 | with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to | 691 | with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to |
692 | /dev/cpu/31/cpuid. | 692 | /dev/cpu/31/cpuid. |
693 | 693 | ||
694 | choice | 694 | choice |
695 | prompt "High Memory Support" | 695 | prompt "High Memory Support" |
696 | default HIGHMEM4G if !X86_NUMAQ | 696 | default HIGHMEM4G if !X86_NUMAQ |
697 | default HIGHMEM64G if X86_NUMAQ | 697 | default HIGHMEM64G if X86_NUMAQ |
698 | depends on X86_32 | 698 | depends on X86_32 |
699 | 699 | ||
700 | config NOHIGHMEM | 700 | config NOHIGHMEM |
701 | bool "off" | 701 | bool "off" |
702 | depends on !X86_NUMAQ | 702 | depends on !X86_NUMAQ |
703 | ---help--- | 703 | ---help--- |
704 | Linux can use up to 64 Gigabytes of physical memory on x86 systems. | 704 | Linux can use up to 64 Gigabytes of physical memory on x86 systems. |
705 | However, the address space of 32-bit x86 processors is only 4 | 705 | However, the address space of 32-bit x86 processors is only 4 |
706 | Gigabytes large. That means that, if you have a large amount of | 706 | Gigabytes large. That means that, if you have a large amount of |
707 | physical memory, not all of it can be "permanently mapped" by the | 707 | physical memory, not all of it can be "permanently mapped" by the |
708 | kernel. The physical memory that's not permanently mapped is called | 708 | kernel. The physical memory that's not permanently mapped is called |
709 | "high memory". | 709 | "high memory". |
710 | 710 | ||
711 | If you are compiling a kernel which will never run on a machine with | 711 | If you are compiling a kernel which will never run on a machine with |
712 | more than 1 Gigabyte total physical RAM, answer "off" here (default | 712 | more than 1 Gigabyte total physical RAM, answer "off" here (default |
713 | choice and suitable for most users). This will result in a "3GB/1GB" | 713 | choice and suitable for most users). This will result in a "3GB/1GB" |
714 | split: 3GB are mapped so that each process sees a 3GB virtual memory | 714 | split: 3GB are mapped so that each process sees a 3GB virtual memory |
715 | space and the remaining part of the 4GB virtual memory space is used | 715 | space and the remaining part of the 4GB virtual memory space is used |
716 | by the kernel to permanently map as much physical memory as | 716 | by the kernel to permanently map as much physical memory as |
717 | possible. | 717 | possible. |
718 | 718 | ||
719 | If the machine has between 1 and 4 Gigabytes physical RAM, then | 719 | If the machine has between 1 and 4 Gigabytes physical RAM, then |
720 | answer "4GB" here. | 720 | answer "4GB" here. |
721 | 721 | ||
722 | If more than 4 Gigabytes is used then answer "64GB" here. This | 722 | If more than 4 Gigabytes is used then answer "64GB" here. This |
723 | selection turns Intel PAE (Physical Address Extension) mode on. | 723 | selection turns Intel PAE (Physical Address Extension) mode on. |
724 | PAE implements 3-level paging on IA32 processors. PAE is fully | 724 | PAE implements 3-level paging on IA32 processors. PAE is fully |
725 | supported by Linux, PAE mode is implemented on all recent Intel | 725 | supported by Linux, PAE mode is implemented on all recent Intel |
726 | processors (Pentium Pro and better). NOTE: If you say "64GB" here, | 726 | processors (Pentium Pro and better). NOTE: If you say "64GB" here, |
727 | then the kernel will not boot on CPUs that don't support PAE! | 727 | then the kernel will not boot on CPUs that don't support PAE! |
728 | 728 | ||
729 | The actual amount of total physical memory will either be | 729 | The actual amount of total physical memory will either be |
730 | auto detected or can be forced by using a kernel command line option | 730 | auto detected or can be forced by using a kernel command line option |
731 | such as "mem=256M". (Try "man bootparam" or see the documentation of | 731 | such as "mem=256M". (Try "man bootparam" or see the documentation of |
732 | your boot loader (lilo or loadlin) about how to pass options to the | 732 | your boot loader (lilo or loadlin) about how to pass options to the |
733 | kernel at boot time.) | 733 | kernel at boot time.) |
734 | 734 | ||
735 | If unsure, say "off". | 735 | If unsure, say "off". |
736 | 736 | ||
737 | config HIGHMEM4G | 737 | config HIGHMEM4G |
738 | bool "4GB" | 738 | bool "4GB" |
739 | depends on !X86_NUMAQ | 739 | depends on !X86_NUMAQ |
740 | help | 740 | help |
741 | Select this if you have a 32-bit processor and between 1 and 4 | 741 | Select this if you have a 32-bit processor and between 1 and 4 |
742 | gigabytes of physical RAM. | 742 | gigabytes of physical RAM. |
743 | 743 | ||
744 | config HIGHMEM64G | 744 | config HIGHMEM64G |
745 | bool "64GB" | 745 | bool "64GB" |
746 | depends on !M386 && !M486 | 746 | depends on !M386 && !M486 |
747 | select X86_PAE | 747 | select X86_PAE |
748 | help | 748 | help |
749 | Select this if you have a 32-bit processor and more than 4 | 749 | Select this if you have a 32-bit processor and more than 4 |
750 | gigabytes of physical RAM. | 750 | gigabytes of physical RAM. |
751 | 751 | ||
752 | endchoice | 752 | endchoice |
753 | 753 | ||
754 | choice | 754 | choice |
755 | depends on EXPERIMENTAL | 755 | depends on EXPERIMENTAL |
756 | prompt "Memory split" if EMBEDDED | 756 | prompt "Memory split" if EMBEDDED |
757 | default VMSPLIT_3G | 757 | default VMSPLIT_3G |
758 | depends on X86_32 | 758 | depends on X86_32 |
759 | help | 759 | help |
760 | Select the desired split between kernel and user memory. | 760 | Select the desired split between kernel and user memory. |
761 | 761 | ||
762 | If the address range available to the kernel is less than the | 762 | If the address range available to the kernel is less than the |
763 | physical memory installed, the remaining memory will be available | 763 | physical memory installed, the remaining memory will be available |
764 | as "high memory". Accessing high memory is a little more costly | 764 | as "high memory". Accessing high memory is a little more costly |
765 | than low memory, as it needs to be mapped into the kernel first. | 765 | than low memory, as it needs to be mapped into the kernel first. |
766 | Note that increasing the kernel address space limits the range | 766 | Note that increasing the kernel address space limits the range |
767 | available to user programs, making the address space there | 767 | available to user programs, making the address space there |
768 | tighter. Selecting anything other than the default 3G/1G split | 768 | tighter. Selecting anything other than the default 3G/1G split |
769 | will also likely make your kernel incompatible with binary-only | 769 | will also likely make your kernel incompatible with binary-only |
770 | kernel modules. | 770 | kernel modules. |
771 | 771 | ||
772 | If you are not absolutely sure what you are doing, leave this | 772 | If you are not absolutely sure what you are doing, leave this |
773 | option alone! | 773 | option alone! |
774 | 774 | ||
775 | config VMSPLIT_3G | 775 | config VMSPLIT_3G |
776 | bool "3G/1G user/kernel split" | 776 | bool "3G/1G user/kernel split" |
777 | config VMSPLIT_3G_OPT | 777 | config VMSPLIT_3G_OPT |
778 | depends on !X86_PAE | 778 | depends on !X86_PAE |
779 | bool "3G/1G user/kernel split (for full 1G low memory)" | 779 | bool "3G/1G user/kernel split (for full 1G low memory)" |
780 | config VMSPLIT_2G | 780 | config VMSPLIT_2G |
781 | bool "2G/2G user/kernel split" | 781 | bool "2G/2G user/kernel split" |
782 | config VMSPLIT_2G_OPT | 782 | config VMSPLIT_2G_OPT |
783 | depends on !X86_PAE | 783 | depends on !X86_PAE |
784 | bool "2G/2G user/kernel split (for full 2G low memory)" | 784 | bool "2G/2G user/kernel split (for full 2G low memory)" |
785 | config VMSPLIT_1G | 785 | config VMSPLIT_1G |
786 | bool "1G/3G user/kernel split" | 786 | bool "1G/3G user/kernel split" |
787 | endchoice | 787 | endchoice |
788 | 788 | ||
789 | config PAGE_OFFSET | 789 | config PAGE_OFFSET |
790 | hex | 790 | hex |
791 | default 0xB0000000 if VMSPLIT_3G_OPT | 791 | default 0xB0000000 if VMSPLIT_3G_OPT |
792 | default 0x80000000 if VMSPLIT_2G | 792 | default 0x80000000 if VMSPLIT_2G |
793 | default 0x78000000 if VMSPLIT_2G_OPT | 793 | default 0x78000000 if VMSPLIT_2G_OPT |
794 | default 0x40000000 if VMSPLIT_1G | 794 | default 0x40000000 if VMSPLIT_1G |
795 | default 0xC0000000 | 795 | default 0xC0000000 |
796 | depends on X86_32 | 796 | depends on X86_32 |
797 | 797 | ||
798 | config HIGHMEM | 798 | config HIGHMEM |
799 | bool | 799 | bool |
800 | depends on X86_32 && (HIGHMEM64G || HIGHMEM4G) | 800 | depends on X86_32 && (HIGHMEM64G || HIGHMEM4G) |
801 | default y | 801 | default y |
802 | 802 | ||
803 | config X86_PAE | 803 | config X86_PAE |
804 | bool "PAE (Physical Address Extension) Support" | 804 | bool "PAE (Physical Address Extension) Support" |
805 | default n | 805 | default n |
806 | depends on X86_32 && !HIGHMEM4G | 806 | depends on X86_32 && !HIGHMEM4G |
807 | select RESOURCES_64BIT | 807 | select RESOURCES_64BIT |
808 | help | 808 | help |
809 | PAE is required for NX support, and furthermore enables | 809 | PAE is required for NX support, and furthermore enables |
810 | larger swapspace support for non-overcommit purposes. It | 810 | larger swapspace support for non-overcommit purposes. It |
811 | has the cost of more pagetable lookup overhead, and also | 811 | has the cost of more pagetable lookup overhead, and also |
812 | consumes more pagetable space per process. | 812 | consumes more pagetable space per process. |
813 | 813 | ||
814 | # Common NUMA Features | 814 | # Common NUMA Features |
815 | config NUMA | 815 | config NUMA |
816 | bool "Numa Memory Allocation and Scheduler Support (EXPERIMENTAL)" | 816 | bool "Numa Memory Allocation and Scheduler Support (EXPERIMENTAL)" |
817 | depends on SMP | 817 | depends on SMP |
818 | depends on X86_64 || (X86_32 && HIGHMEM64G && (X86_NUMAQ || (X86_SUMMIT || X86_GENERICARCH) && ACPI) && EXPERIMENTAL) | 818 | depends on X86_64 || (X86_32 && HIGHMEM64G && (X86_NUMAQ || (X86_SUMMIT || X86_GENERICARCH) && ACPI) && EXPERIMENTAL) |
819 | default n if X86_PC | 819 | default n if X86_PC |
820 | default y if (X86_NUMAQ || X86_SUMMIT) | 820 | default y if (X86_NUMAQ || X86_SUMMIT) |
821 | help | 821 | help |
822 | Enable NUMA (Non Uniform Memory Access) support. | 822 | Enable NUMA (Non Uniform Memory Access) support. |
823 | The kernel will try to allocate memory used by a CPU on the | 823 | The kernel will try to allocate memory used by a CPU on the |
824 | local memory controller of the CPU and add some more | 824 | local memory controller of the CPU and add some more |
825 | NUMA awareness to the kernel. | 825 | NUMA awareness to the kernel. |
826 | 826 | ||
827 | For i386 this is currently highly experimental and should be only | 827 | For i386 this is currently highly experimental and should be only |
828 | used for kernel development. It might also cause boot failures. | 828 | used for kernel development. It might also cause boot failures. |
829 | For x86_64 this is recommended on all multiprocessor Opteron systems. | 829 | For x86_64 this is recommended on all multiprocessor Opteron systems. |
830 | If the system is EM64T, you should say N unless your system is | 830 | If the system is EM64T, you should say N unless your system is |
831 | EM64T NUMA. | 831 | EM64T NUMA. |
832 | 832 | ||
833 | comment "NUMA (Summit) requires SMP, 64GB highmem support, ACPI" | 833 | comment "NUMA (Summit) requires SMP, 64GB highmem support, ACPI" |
834 | depends on X86_32 && X86_SUMMIT && (!HIGHMEM64G || !ACPI) | 834 | depends on X86_32 && X86_SUMMIT && (!HIGHMEM64G || !ACPI) |
835 | 835 | ||
836 | config K8_NUMA | 836 | config K8_NUMA |
837 | bool "Old style AMD Opteron NUMA detection" | 837 | bool "Old style AMD Opteron NUMA detection" |
838 | depends on X86_64 && NUMA && PCI | 838 | depends on X86_64 && NUMA && PCI |
839 | default y | 839 | default y |
840 | help | 840 | help |
841 | Enable K8 NUMA node topology detection. You should say Y here if | 841 | Enable K8 NUMA node topology detection. You should say Y here if |
842 | you have a multi processor AMD K8 system. This uses an old | 842 | you have a multi processor AMD K8 system. This uses an old |
843 | method to read the NUMA configuration directly from the builtin | 843 | method to read the NUMA configuration directly from the builtin |
844 | Northbridge of Opteron. It is recommended to use X86_64_ACPI_NUMA | 844 | Northbridge of Opteron. It is recommended to use X86_64_ACPI_NUMA |
845 | instead, which also takes priority if both are compiled in. | 845 | instead, which also takes priority if both are compiled in. |
846 | 846 | ||
847 | config X86_64_ACPI_NUMA | 847 | config X86_64_ACPI_NUMA |
848 | bool "ACPI NUMA detection" | 848 | bool "ACPI NUMA detection" |
849 | depends on X86_64 && NUMA && ACPI && PCI | 849 | depends on X86_64 && NUMA && ACPI && PCI |
850 | select ACPI_NUMA | 850 | select ACPI_NUMA |
851 | default y | 851 | default y |
852 | help | 852 | help |
853 | Enable ACPI SRAT based node topology detection. | 853 | Enable ACPI SRAT based node topology detection. |
854 | 854 | ||
855 | config NUMA_EMU | 855 | config NUMA_EMU |
856 | bool "NUMA emulation" | 856 | bool "NUMA emulation" |
857 | depends on X86_64 && NUMA | 857 | depends on X86_64 && NUMA |
858 | help | 858 | help |
859 | Enable NUMA emulation. A flat machine will be split | 859 | Enable NUMA emulation. A flat machine will be split |
860 | into virtual nodes when booted with "numa=fake=N", where N is the | 860 | into virtual nodes when booted with "numa=fake=N", where N is the |
861 | number of nodes. This is only useful for debugging. | 861 | number of nodes. This is only useful for debugging. |
862 | 862 | ||
863 | config NODES_SHIFT | 863 | config NODES_SHIFT |
864 | int | 864 | int |
865 | default "6" if X86_64 | 865 | default "6" if X86_64 |
866 | default "4" if X86_NUMAQ | 866 | default "4" if X86_NUMAQ |
867 | default "3" | 867 | default "3" |
868 | depends on NEED_MULTIPLE_NODES | 868 | depends on NEED_MULTIPLE_NODES |
869 | 869 | ||
870 | config HAVE_ARCH_BOOTMEM_NODE | 870 | config HAVE_ARCH_BOOTMEM_NODE |
871 | bool | 871 | bool |
872 | depends on X86_32 && NUMA | 872 | depends on X86_32 && NUMA |
873 | default y | 873 | default y |
874 | 874 | ||
875 | config ARCH_HAVE_MEMORY_PRESENT | 875 | config ARCH_HAVE_MEMORY_PRESENT |
876 | bool | 876 | bool |
877 | depends on X86_32 && DISCONTIGMEM | 877 | depends on X86_32 && DISCONTIGMEM |
878 | default y | 878 | default y |
879 | 879 | ||
880 | config NEED_NODE_MEMMAP_SIZE | 880 | config NEED_NODE_MEMMAP_SIZE |
881 | bool | 881 | bool |
882 | depends on X86_32 && (DISCONTIGMEM || SPARSEMEM) | 882 | depends on X86_32 && (DISCONTIGMEM || SPARSEMEM) |
883 | default y | 883 | default y |
884 | 884 | ||
885 | config HAVE_ARCH_ALLOC_REMAP | 885 | config HAVE_ARCH_ALLOC_REMAP |
886 | bool | 886 | bool |
887 | depends on X86_32 && NUMA | 887 | depends on X86_32 && NUMA |
888 | default y | 888 | default y |
889 | 889 | ||
890 | config ARCH_FLATMEM_ENABLE | 890 | config ARCH_FLATMEM_ENABLE |
891 | def_bool y | 891 | def_bool y |
892 | depends on (X86_32 && ARCH_SELECT_MEMORY_MODEL && X86_PC) || (X86_64 && !NUMA) | 892 | depends on (X86_32 && ARCH_SELECT_MEMORY_MODEL && X86_PC) || (X86_64 && !NUMA) |
893 | 893 | ||
894 | config ARCH_DISCONTIGMEM_ENABLE | 894 | config ARCH_DISCONTIGMEM_ENABLE |
895 | def_bool y | 895 | def_bool y |
896 | depends on NUMA | 896 | depends on NUMA |
897 | 897 | ||
898 | config ARCH_DISCONTIGMEM_DEFAULT | 898 | config ARCH_DISCONTIGMEM_DEFAULT |
899 | def_bool y | 899 | def_bool y |
900 | depends on NUMA | 900 | depends on NUMA |
901 | 901 | ||
902 | config ARCH_SPARSEMEM_ENABLE | 902 | config ARCH_SPARSEMEM_ENABLE |
903 | def_bool y | 903 | def_bool y |
904 | depends on NUMA || (EXPERIMENTAL && (X86_PC || X86_64)) | 904 | depends on NUMA || (EXPERIMENTAL && (X86_PC || X86_64)) |
905 | select SPARSEMEM_STATIC if X86_32 | 905 | select SPARSEMEM_STATIC if X86_32 |
906 | select SPARSEMEM_VMEMMAP_ENABLE if X86_64 | 906 | select SPARSEMEM_VMEMMAP_ENABLE if X86_64 |
907 | 907 | ||
908 | config ARCH_SELECT_MEMORY_MODEL | 908 | config ARCH_SELECT_MEMORY_MODEL |
909 | def_bool y | 909 | def_bool y |
910 | depends on X86_32 && ARCH_SPARSEMEM_ENABLE | 910 | depends on X86_32 && ARCH_SPARSEMEM_ENABLE |
911 | 911 | ||
912 | config ARCH_MEMORY_PROBE | 912 | config ARCH_MEMORY_PROBE |
913 | def_bool X86_64 | 913 | def_bool X86_64 |
914 | depends on MEMORY_HOTPLUG | 914 | depends on MEMORY_HOTPLUG |
915 | 915 | ||
916 | source "mm/Kconfig" | 916 | source "mm/Kconfig" |
917 | 917 | ||
918 | config HIGHPTE | 918 | config HIGHPTE |
919 | bool "Allocate 3rd-level pagetables from highmem" | 919 | bool "Allocate 3rd-level pagetables from highmem" |
920 | depends on X86_32 && (HIGHMEM4G || HIGHMEM64G) | 920 | depends on X86_32 && (HIGHMEM4G || HIGHMEM64G) |
921 | help | 921 | help |
922 | The VM uses one page table entry for each page of physical memory. | 922 | The VM uses one page table entry for each page of physical memory. |
923 | For systems with a lot of RAM, this can be wasteful of precious | 923 | For systems with a lot of RAM, this can be wasteful of precious |
924 | low memory. Setting this option will put user-space page table | 924 | low memory. Setting this option will put user-space page table |
925 | entries in high memory. | 925 | entries in high memory. |
926 | 926 | ||
927 | config MATH_EMULATION | 927 | config MATH_EMULATION |
928 | bool | 928 | bool |
929 | prompt "Math emulation" if X86_32 | 929 | prompt "Math emulation" if X86_32 |
930 | ---help--- | 930 | ---help--- |
931 | Linux can emulate a math coprocessor (used for floating point | 931 | Linux can emulate a math coprocessor (used for floating point |
932 | operations) if you don't have one. 486DX and Pentium processors have | 932 | operations) if you don't have one. 486DX and Pentium processors have |
933 | a math coprocessor built in, 486SX and 386 do not, unless you added | 933 | a math coprocessor built in, 486SX and 386 do not, unless you added |
934 | a 487DX or 387, respectively. (The messages during boot time can | 934 | a 487DX or 387, respectively. (The messages during boot time can |
935 | give you some hints here ["man dmesg"].) Everyone needs either a | 935 | give you some hints here ["man dmesg"].) Everyone needs either a |
936 | coprocessor or this emulation. | 936 | coprocessor or this emulation. |
937 | 937 | ||
938 | If you don't have a math coprocessor, you need to say Y here; if you | 938 | If you don't have a math coprocessor, you need to say Y here; if you |
939 | say Y here even though you have a coprocessor, the coprocessor will | 939 | say Y here even though you have a coprocessor, the coprocessor will |
940 | be used nevertheless. (This behavior can be changed with the kernel | 940 | be used nevertheless. (This behavior can be changed with the kernel |
941 | command line option "no387", which comes handy if your coprocessor | 941 | command line option "no387", which comes handy if your coprocessor |
942 | is broken. Try "man bootparam" or see the documentation of your boot | 942 | is broken. Try "man bootparam" or see the documentation of your boot |
943 | loader (lilo or loadlin) about how to pass options to the kernel at | 943 | loader (lilo or loadlin) about how to pass options to the kernel at |
944 | boot time.) This means that it is a good idea to say Y here if you | 944 | boot time.) This means that it is a good idea to say Y here if you |
945 | intend to use this kernel on different machines. | 945 | intend to use this kernel on different machines. |
946 | 946 | ||
947 | More information about the internals of the Linux math coprocessor | 947 | More information about the internals of the Linux math coprocessor |
948 | emulation can be found in <file:arch/x86/math-emu/README>. | 948 | emulation can be found in <file:arch/x86/math-emu/README>. |
949 | 949 | ||
950 | If you are not sure, say Y; apart from resulting in a 66 KB bigger | 950 | If you are not sure, say Y; apart from resulting in a 66 KB bigger |
951 | kernel, it won't hurt. | 951 | kernel, it won't hurt. |
952 | 952 | ||
953 | config MTRR | 953 | config MTRR |
954 | bool "MTRR (Memory Type Range Register) support" | 954 | bool "MTRR (Memory Type Range Register) support" |
955 | ---help--- | 955 | ---help--- |
956 | On Intel P6 family processors (Pentium Pro, Pentium II and later) | 956 | On Intel P6 family processors (Pentium Pro, Pentium II and later) |
957 | the Memory Type Range Registers (MTRRs) may be used to control | 957 | the Memory Type Range Registers (MTRRs) may be used to control |
958 | processor access to memory ranges. This is most useful if you have | 958 | processor access to memory ranges. This is most useful if you have |
959 | a video (VGA) card on a PCI or AGP bus. Enabling write-combining | 959 | a video (VGA) card on a PCI or AGP bus. Enabling write-combining |
960 | allows bus write transfers to be combined into a larger transfer | 960 | allows bus write transfers to be combined into a larger transfer |
961 | before bursting over the PCI/AGP bus. This can increase performance | 961 | before bursting over the PCI/AGP bus. This can increase performance |
962 | of image write operations 2.5 times or more. Saying Y here creates a | 962 | of image write operations 2.5 times or more. Saying Y here creates a |
963 | /proc/mtrr file which may be used to manipulate your processor's | 963 | /proc/mtrr file which may be used to manipulate your processor's |
964 | MTRRs. Typically the X server should use this. | 964 | MTRRs. Typically the X server should use this. |
965 | 965 | ||
966 | This code has a reasonably generic interface so that similar | 966 | This code has a reasonably generic interface so that similar |
967 | control registers on other processors can be easily supported | 967 | control registers on other processors can be easily supported |
968 | as well: | 968 | as well: |
969 | 969 | ||
970 | The Cyrix 6x86, 6x86MX and M II processors have Address Range | 970 | The Cyrix 6x86, 6x86MX and M II processors have Address Range |
971 | Registers (ARRs) which provide a similar functionality to MTRRs. For | 971 | Registers (ARRs) which provide a similar functionality to MTRRs. For |
972 | these, the ARRs are used to emulate the MTRRs. | 972 | these, the ARRs are used to emulate the MTRRs. |
973 | The AMD K6-2 (stepping 8 and above) and K6-3 processors have two | 973 | The AMD K6-2 (stepping 8 and above) and K6-3 processors have two |
974 | MTRRs. The Centaur C6 (WinChip) has 8 MCRs, allowing | 974 | MTRRs. The Centaur C6 (WinChip) has 8 MCRs, allowing |
975 | write-combining. All of these processors are supported by this code | 975 | write-combining. All of these processors are supported by this code |
976 | and it makes sense to say Y here if you have one of them. | 976 | and it makes sense to say Y here if you have one of them. |
977 | 977 | ||
978 | Saying Y here also fixes a problem with buggy SMP BIOSes which only | 978 | Saying Y here also fixes a problem with buggy SMP BIOSes which only |
979 | set the MTRRs for the boot CPU and not for the secondary CPUs. This | 979 | set the MTRRs for the boot CPU and not for the secondary CPUs. This |
980 | can lead to all sorts of problems, so it's good to say Y here. | 980 | can lead to all sorts of problems, so it's good to say Y here. |
981 | 981 | ||
982 | You can safely say Y even if your machine doesn't have MTRRs, you'll | 982 | You can safely say Y even if your machine doesn't have MTRRs, you'll |
983 | just add about 9 KB to your kernel. | 983 | just add about 9 KB to your kernel. |
984 | 984 | ||
985 | See <file:Documentation/mtrr.txt> for more information. | 985 | See <file:Documentation/mtrr.txt> for more information. |
986 | 986 | ||
987 | config EFI | 987 | config EFI |
988 | bool "Boot from EFI support" | 988 | bool "Boot from EFI support" |
989 | depends on X86_32 && ACPI | 989 | depends on X86_32 && ACPI |
990 | default n | 990 | default n |
991 | ---help--- | 991 | ---help--- |
992 | This enables the kernel to boot on EFI platforms using | 992 | This enables the kernel to boot on EFI platforms using |
993 | system configuration information passed to it from the firmware. | 993 | system configuration information passed to it from the firmware. |
994 | This also enables the kernel to use any EFI runtime services that are | 994 | This also enables the kernel to use any EFI runtime services that are |
995 | available (such as the EFI variable services). | 995 | available (such as the EFI variable services). |
996 | 996 | ||
997 | This option is only useful on systems that have EFI firmware | 997 | This option is only useful on systems that have EFI firmware |
998 | and will result in a kernel image that is ~8k larger. In addition, | 998 | and will result in a kernel image that is ~8k larger. In addition, |
999 | you must use the latest ELILO loader available at | 999 | you must use the latest ELILO loader available at |
1000 | <http://elilo.sourceforge.net> in order to take advantage of | 1000 | <http://elilo.sourceforge.net> in order to take advantage of |
1001 | kernel initialization using EFI information (neither GRUB nor LILO know | 1001 | kernel initialization using EFI information (neither GRUB nor LILO know |
1002 | anything about EFI). However, even with this option, the resultant | 1002 | anything about EFI). However, even with this option, the resultant |
1003 | kernel should continue to boot on existing non-EFI platforms. | 1003 | kernel should continue to boot on existing non-EFI platforms. |
1004 | 1004 | ||
1005 | config IRQBALANCE | 1005 | config IRQBALANCE |
1006 | bool "Enable kernel irq balancing" | 1006 | bool "Enable kernel irq balancing" |
1007 | depends on X86_32 && SMP && X86_IO_APIC | 1007 | depends on X86_32 && SMP && X86_IO_APIC |
1008 | default y | 1008 | default y |
1009 | help | 1009 | help |
1010 | The default yes will allow the kernel to do irq load balancing. | 1010 | The default yes will allow the kernel to do irq load balancing. |
1011 | Saying no will keep the kernel from doing irq load balancing. | 1011 | Saying no will keep the kernel from doing irq load balancing. |
1012 | 1012 | ||
1013 | # turning this on wastes a bunch of space. | 1013 | # turning this on wastes a bunch of space. |
1014 | # Summit needs it only when NUMA is on | 1014 | # Summit needs it only when NUMA is on |
1015 | config BOOT_IOREMAP | 1015 | config BOOT_IOREMAP |
1016 | bool | 1016 | bool |
1017 | depends on X86_32 && (((X86_SUMMIT || X86_GENERICARCH) && NUMA) || (X86 && EFI)) | 1017 | depends on X86_32 && (((X86_SUMMIT || X86_GENERICARCH) && NUMA) || (X86 && EFI)) |
1018 | default y | 1018 | default y |
1019 | 1019 | ||
1020 | config SECCOMP | 1020 | config SECCOMP |
1021 | bool "Enable seccomp to safely compute untrusted bytecode" | 1021 | bool "Enable seccomp to safely compute untrusted bytecode" |
1022 | depends on PROC_FS | 1022 | depends on PROC_FS |
1023 | default y | 1023 | default y |
1024 | help | 1024 | help |
1025 | This kernel feature is useful for number crunching applications | 1025 | This kernel feature is useful for number crunching applications |
1026 | that may need to compute untrusted bytecode during their | 1026 | that may need to compute untrusted bytecode during their |
1027 | execution. By using pipes or other transports made available to | 1027 | execution. By using pipes or other transports made available to |
1028 | the process as file descriptors supporting the read/write | 1028 | the process as file descriptors supporting the read/write |
1029 | syscalls, it's possible to isolate those applications in | 1029 | syscalls, it's possible to isolate those applications in |
1030 | their own address space using seccomp. Once seccomp is | 1030 | their own address space using seccomp. Once seccomp is |
1031 | enabled via /proc/<pid>/seccomp, it cannot be disabled | 1031 | enabled via /proc/<pid>/seccomp, it cannot be disabled |
1032 | and the task is only allowed to execute a few safe syscalls | 1032 | and the task is only allowed to execute a few safe syscalls |
1033 | defined by each seccomp mode. | 1033 | defined by each seccomp mode. |
1034 | 1034 | ||
1035 | If unsure, say Y. Only embedded should say N here. | 1035 | If unsure, say Y. Only embedded should say N here. |
1036 | 1036 | ||
1037 | config CC_STACKPROTECTOR | 1037 | config CC_STACKPROTECTOR |
1038 | bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)" | 1038 | bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)" |
1039 | depends on X86_64 && EXPERIMENTAL | 1039 | depends on X86_64 && EXPERIMENTAL |
1040 | help | 1040 | help |
1041 | This option turns on the -fstack-protector GCC feature. This | 1041 | This option turns on the -fstack-protector GCC feature. This |
1042 | feature puts, at the beginning of critical functions, a canary | 1042 | feature puts, at the beginning of critical functions, a canary |
1043 | value on the stack just before the return address, and validates | 1043 | value on the stack just before the return address, and validates |
1044 | the value just before actually returning. Stack based buffer | 1044 | the value just before actually returning. Stack based buffer |
1045 | overflows (that need to overwrite this return address) now also | 1045 | overflows (that need to overwrite this return address) now also |
1046 | overwrite the canary, which gets detected and the attack is then | 1046 | overwrite the canary, which gets detected and the attack is then |
1047 | neutralized via a kernel panic. | 1047 | neutralized via a kernel panic. |
1048 | 1048 | ||
1049 | This feature requires gcc version 4.2 or above, or a distribution | 1049 | This feature requires gcc version 4.2 or above, or a distribution |
1050 | gcc with the feature backported. Older versions are automatically | 1050 | gcc with the feature backported. Older versions are automatically |
1051 | detected and for those versions, this configuration option is ignored. | 1051 | detected and for those versions, this configuration option is ignored. |
1052 | 1052 | ||
1053 | config CC_STACKPROTECTOR_ALL | 1053 | config CC_STACKPROTECTOR_ALL |
1054 | bool "Use stack-protector for all functions" | 1054 | bool "Use stack-protector for all functions" |
1055 | depends on CC_STACKPROTECTOR | 1055 | depends on CC_STACKPROTECTOR |
1056 | help | 1056 | help |
1057 | Normally, GCC only inserts the canary value protection for | 1057 | Normally, GCC only inserts the canary value protection for |
1058 | functions that use large-ish on-stack buffers. By enabling | 1058 | functions that use large-ish on-stack buffers. By enabling |
1059 | this option, GCC will be asked to do this for ALL functions. | 1059 | this option, GCC will be asked to do this for ALL functions. |
1060 | 1060 | ||
1061 | source kernel/Kconfig.hz | 1061 | source kernel/Kconfig.hz |
1062 | 1062 | ||
1063 | config KEXEC | 1063 | config KEXEC |
1064 | bool "kexec system call" | 1064 | bool "kexec system call" |
1065 | help | 1065 | help |
1066 | kexec is a system call that implements the ability to shutdown your | 1066 | kexec is a system call that implements the ability to shutdown your |
1067 | current kernel, and to start another kernel. It is like a reboot | 1067 | current kernel, and to start another kernel. It is like a reboot |
1068 | but it is independent of the system firmware. And like a reboot | 1068 | but it is independent of the system firmware. And like a reboot |
1069 | you can start any kernel with it, not just Linux. | 1069 | you can start any kernel with it, not just Linux. |
1070 | 1070 | ||
1071 | The name comes from the similarity to the exec system call. | 1071 | The name comes from the similarity to the exec system call. |
1072 | 1072 | ||
1073 | It is an ongoing process to be certain the hardware in a machine | 1073 | It is an ongoing process to be certain the hardware in a machine |
1074 | is properly shutdown, so do not be surprised if this code does not | 1074 | is properly shutdown, so do not be surprised if this code does not |
1075 | initially work for you. It may help to enable device hotplugging | 1075 | initially work for you. It may help to enable device hotplugging |
1076 | support. As of this writing the exact hardware interface is | 1076 | support. As of this writing the exact hardware interface is |
1077 | strongly in flux, so no good recommendation can be made. | 1077 | strongly in flux, so no good recommendation can be made. |
1078 | 1078 | ||
1079 | config CRASH_DUMP | 1079 | config CRASH_DUMP |
1080 | bool "kernel crash dumps (EXPERIMENTAL)" | 1080 | bool "kernel crash dumps (EXPERIMENTAL)" |
1081 | depends on EXPERIMENTAL | 1081 | depends on EXPERIMENTAL |
1082 | depends on X86_64 || (X86_32 && HIGHMEM) | 1082 | depends on X86_64 || (X86_32 && HIGHMEM) |
1083 | help | 1083 | help |
1084 | Generate crash dump after being started by kexec. | 1084 | Generate crash dump after being started by kexec. |
1085 | This should be normally only set in special crash dump kernels | 1085 | This should be normally only set in special crash dump kernels |
1086 | which are loaded in the main kernel with kexec-tools into | 1086 | which are loaded in the main kernel with kexec-tools into |
1087 | a specially reserved region and then later executed after | 1087 | a specially reserved region and then later executed after |
1088 | a crash by kdump/kexec. The crash dump kernel must be compiled | 1088 | a crash by kdump/kexec. The crash dump kernel must be compiled |
1089 | to a memory address not used by the main kernel or BIOS using | 1089 | to a memory address not used by the main kernel or BIOS using |
1090 | PHYSICAL_START, or it must be built as a relocatable image | 1090 | PHYSICAL_START, or it must be built as a relocatable image |
1091 | (CONFIG_RELOCATABLE=y). | 1091 | (CONFIG_RELOCATABLE=y). |
1092 | For more details see Documentation/kdump/kdump.txt | 1092 | For more details see Documentation/kdump/kdump.txt |
1093 | 1093 | ||
1094 | config PHYSICAL_START | 1094 | config PHYSICAL_START |
1095 | hex "Physical address where the kernel is loaded" if (EMBEDDED || CRASH_DUMP) | 1095 | hex "Physical address where the kernel is loaded" if (EMBEDDED || CRASH_DUMP) |
1096 | default "0x1000000" if X86_NUMAQ | 1096 | default "0x1000000" if X86_NUMAQ |
1097 | default "0x200000" if X86_64 | 1097 | default "0x200000" if X86_64 |
1098 | default "0x100000" | 1098 | default "0x100000" |
1099 | help | 1099 | help |
1100 | This gives the physical address where the kernel is loaded. | 1100 | This gives the physical address where the kernel is loaded. |
1101 | 1101 | ||
1102 | If kernel is a not relocatable (CONFIG_RELOCATABLE=n) then | 1102 | If kernel is a not relocatable (CONFIG_RELOCATABLE=n) then |
1103 | bzImage will decompress itself to above physical address and | 1103 | bzImage will decompress itself to above physical address and |
1104 | run from there. Otherwise, bzImage will run from the address where | 1104 | run from there. Otherwise, bzImage will run from the address where |
1105 | it has been loaded by the boot loader and will ignore above physical | 1105 | it has been loaded by the boot loader and will ignore above physical |
1106 | address. | 1106 | address. |
1107 | 1107 | ||
1108 | In normal kdump cases one does not have to set/change this option | 1108 | In normal kdump cases one does not have to set/change this option |
1109 | as now bzImage can be compiled as a completely relocatable image | 1109 | as now bzImage can be compiled as a completely relocatable image |
1110 | (CONFIG_RELOCATABLE=y) and be used to load and run from a different | 1110 | (CONFIG_RELOCATABLE=y) and be used to load and run from a different |
1111 | address. This option is mainly useful for the folks who don't want | 1111 | address. This option is mainly useful for the folks who don't want |
1112 | to use a bzImage for capturing the crash dump and want to use a | 1112 | to use a bzImage for capturing the crash dump and want to use a |
1113 | vmlinux instead. vmlinux is not relocatable hence a kernel needs | 1113 | vmlinux instead. vmlinux is not relocatable hence a kernel needs |
1114 | to be specifically compiled to run from a specific memory area | 1114 | to be specifically compiled to run from a specific memory area |
1115 | (normally a reserved region) and this option comes handy. | 1115 | (normally a reserved region) and this option comes handy. |
1116 | 1116 | ||
1117 | So if you are using bzImage for capturing the crash dump, leave | 1117 | So if you are using bzImage for capturing the crash dump, leave |
1118 | the value here unchanged to 0x100000 and set CONFIG_RELOCATABLE=y. | 1118 | the value here unchanged to 0x100000 and set CONFIG_RELOCATABLE=y. |
1119 | Otherwise if you plan to use vmlinux for capturing the crash dump | 1119 | Otherwise if you plan to use vmlinux for capturing the crash dump |
1120 | change this value to start of the reserved region (Typically 16MB | 1120 | change this value to start of the reserved region (Typically 16MB |
1121 | 0x1000000). In other words, it can be set based on the "X" value as | 1121 | 0x1000000). In other words, it can be set based on the "X" value as |
1122 | specified in the "crashkernel=YM@XM" command line boot parameter | 1122 | specified in the "crashkernel=YM@XM" command line boot parameter |
1123 | passed to the panic-ed kernel. Typically this parameter is set as | 1123 | passed to the panic-ed kernel. Typically this parameter is set as |
1124 | crashkernel=64M@16M. Please take a look at | 1124 | crashkernel=64M@16M. Please take a look at |
1125 | Documentation/kdump/kdump.txt for more details about crash dumps. | 1125 | Documentation/kdump/kdump.txt for more details about crash dumps. |
1126 | 1126 | ||
1127 | Usage of bzImage for capturing the crash dump is recommended as | 1127 | Usage of bzImage for capturing the crash dump is recommended as |
1128 | one does not have to build two kernels. Same kernel can be used | 1128 | one does not have to build two kernels. Same kernel can be used |
1129 | as production kernel and capture kernel. Above option should have | 1129 | as production kernel and capture kernel. Above option should have |
1130 | gone away after relocatable bzImage support is introduced. But it | 1130 | gone away after relocatable bzImage support is introduced. But it |
1131 | is present because there are users out there who continue to use | 1131 | is present because there are users out there who continue to use |
1132 | vmlinux for dump capture. This option should go away down the | 1132 | vmlinux for dump capture. This option should go away down the |
1133 | line. | 1133 | line. |
1134 | 1134 | ||
1135 | Don't change this unless you know what you are doing. | 1135 | Don't change this unless you know what you are doing. |
1136 | 1136 | ||
1137 | config RELOCATABLE | 1137 | config RELOCATABLE |
1138 | bool "Build a relocatable kernel (EXPERIMENTAL)" | 1138 | bool "Build a relocatable kernel (EXPERIMENTAL)" |
1139 | depends on EXPERIMENTAL | 1139 | depends on EXPERIMENTAL |
1140 | help | 1140 | help |
1141 | This builds a kernel image that retains relocation information | 1141 | This builds a kernel image that retains relocation information |
1142 | so it can be loaded someplace besides the default 1MB. | 1142 | so it can be loaded someplace besides the default 1MB. |
1143 | The relocations tend to make the kernel binary about 10% larger, | 1143 | The relocations tend to make the kernel binary about 10% larger, |
1144 | but are discarded at runtime. | 1144 | but are discarded at runtime. |
1145 | 1145 | ||
1146 | One use is for the kexec on panic case where the recovery kernel | 1146 | One use is for the kexec on panic case where the recovery kernel |
1147 | must live at a different physical address than the primary | 1147 | must live at a different physical address than the primary |
1148 | kernel. | 1148 | kernel. |
1149 | 1149 | ||
1150 | Note: If CONFIG_RELOCATABLE=y, then the kernel runs from the address | 1150 | Note: If CONFIG_RELOCATABLE=y, then the kernel runs from the address |
1151 | it has been loaded at and the compile time physical address | 1151 | it has been loaded at and the compile time physical address |
1152 | (CONFIG_PHYSICAL_START) is ignored. | 1152 | (CONFIG_PHYSICAL_START) is ignored. |
1153 | 1153 | ||
1154 | config PHYSICAL_ALIGN | 1154 | config PHYSICAL_ALIGN |
1155 | hex | 1155 | hex |
1156 | prompt "Alignment value to which kernel should be aligned" if X86_32 | 1156 | prompt "Alignment value to which kernel should be aligned" if X86_32 |
1157 | default "0x100000" if X86_32 | 1157 | default "0x100000" if X86_32 |
1158 | default "0x200000" if X86_64 | 1158 | default "0x200000" if X86_64 |
1159 | range 0x2000 0x400000 | 1159 | range 0x2000 0x400000 |
1160 | help | 1160 | help |
1161 | This value puts the alignment restrictions on physical address | 1161 | This value puts the alignment restrictions on physical address |
1162 | where kernel is loaded and run from. Kernel is compiled for an | 1162 | where kernel is loaded and run from. Kernel is compiled for an |
1163 | address which meets above alignment restriction. | 1163 | address which meets above alignment restriction. |
1164 | 1164 | ||
1165 | If bootloader loads the kernel at a non-aligned address and | 1165 | If bootloader loads the kernel at a non-aligned address and |
1166 | CONFIG_RELOCATABLE is set, kernel will move itself to nearest | 1166 | CONFIG_RELOCATABLE is set, kernel will move itself to nearest |
1167 | address aligned to above value and run from there. | 1167 | address aligned to above value and run from there. |
1168 | 1168 | ||
1169 | If bootloader loads the kernel at a non-aligned address and | 1169 | If bootloader loads the kernel at a non-aligned address and |
1170 | CONFIG_RELOCATABLE is not set, kernel will ignore the run time | 1170 | CONFIG_RELOCATABLE is not set, kernel will ignore the run time |
1171 | load address and decompress itself to the address it has been | 1171 | load address and decompress itself to the address it has been |
1172 | compiled for and run from there. The address for which kernel is | 1172 | compiled for and run from there. The address for which kernel is |
1173 | compiled already meets above alignment restrictions. Hence the | 1173 | compiled already meets above alignment restrictions. Hence the |
1174 | end result is that kernel runs from a physical address meeting | 1174 | end result is that kernel runs from a physical address meeting |
1175 | above alignment restrictions. | 1175 | above alignment restrictions. |
1176 | 1176 | ||
1177 | Don't change this unless you know what you are doing. | 1177 | Don't change this unless you know what you are doing. |
1178 | 1178 | ||
1179 | config HOTPLUG_CPU | 1179 | config HOTPLUG_CPU |
1180 | bool "Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)" | 1180 | bool "Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)" |
1181 | depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER | 1181 | depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER |
1182 | ---help--- | 1182 | ---help--- |
1183 | Say Y here to experiment with turning CPUs off and on, and to | 1183 | Say Y here to experiment with turning CPUs off and on, and to |
1184 | enable suspend on SMP systems. CPUs can be controlled through | 1184 | enable suspend on SMP systems. CPUs can be controlled through |
1185 | /sys/devices/system/cpu. | 1185 | /sys/devices/system/cpu. |
1186 | Say N if you want to disable CPU hotplug and don't need to | 1186 | Say N if you want to disable CPU hotplug and don't need to |
1187 | suspend. | 1187 | suspend. |
1188 | 1188 | ||
1189 | config COMPAT_VDSO | 1189 | config COMPAT_VDSO |
1190 | bool "Compat VDSO support" | 1190 | bool "Compat VDSO support" |
1191 | default y | 1191 | default y |
1192 | depends on X86_32 | 1192 | depends on X86_32 |
1193 | help | 1193 | help |
1194 | Map the VDSO to the predictable old-style address too. | 1194 | Map the VDSO to the predictable old-style address too. |
1195 | ---help--- | 1195 | ---help--- |
1196 | Say N here if you are running a sufficiently recent glibc | 1196 | Say N here if you are running a sufficiently recent glibc |
1197 | version (2.3.3 or later), to remove the high-mapped | 1197 | version (2.3.3 or later), to remove the high-mapped |
1198 | VDSO mapping and to exclusively use the randomized VDSO. | 1198 | VDSO mapping and to exclusively use the randomized VDSO. |
1199 | 1199 | ||
1200 | If unsure, say Y. | 1200 | If unsure, say Y. |
1201 | 1201 | ||
1202 | endmenu | 1202 | endmenu |
1203 | 1203 | ||
1204 | config ARCH_ENABLE_MEMORY_HOTPLUG | 1204 | config ARCH_ENABLE_MEMORY_HOTPLUG |
1205 | def_bool y | 1205 | def_bool y |
1206 | depends on X86_64 || (X86_32 && HIGHMEM) | 1206 | depends on X86_64 || (X86_32 && HIGHMEM) |
1207 | 1207 | ||
1208 | config MEMORY_HOTPLUG_RESERVE | 1208 | config MEMORY_HOTPLUG_RESERVE |
1209 | def_bool X86_64 | 1209 | def_bool X86_64 |
1210 | depends on (MEMORY_HOTPLUG && DISCONTIGMEM) | 1210 | depends on (MEMORY_HOTPLUG && DISCONTIGMEM) |
1211 | 1211 | ||
1212 | config HAVE_ARCH_EARLY_PFN_TO_NID | 1212 | config HAVE_ARCH_EARLY_PFN_TO_NID |
1213 | def_bool X86_64 | 1213 | def_bool X86_64 |
1214 | depends on NUMA | 1214 | depends on NUMA |
1215 | 1215 | ||
1216 | config OUT_OF_LINE_PFN_TO_PAGE | 1216 | config OUT_OF_LINE_PFN_TO_PAGE |
1217 | def_bool X86_64 | 1217 | def_bool X86_64 |
1218 | depends on DISCONTIGMEM | 1218 | depends on DISCONTIGMEM |
1219 | 1219 | ||
1220 | menu "Power management options" | 1220 | menu "Power management options" |
1221 | depends on !X86_VOYAGER | 1221 | depends on !X86_VOYAGER |
1222 | 1222 | ||
1223 | config ARCH_HIBERNATION_HEADER | 1223 | config ARCH_HIBERNATION_HEADER |
1224 | bool | 1224 | bool |
1225 | depends on X86_64 && HIBERNATION | 1225 | depends on X86_64 && HIBERNATION |
1226 | default y | 1226 | default y |
1227 | 1227 | ||
1228 | source "kernel/power/Kconfig" | 1228 | source "kernel/power/Kconfig" |
1229 | 1229 | ||
1230 | source "drivers/acpi/Kconfig" | 1230 | source "drivers/acpi/Kconfig" |
1231 | 1231 | ||
1232 | menuconfig APM | 1232 | menuconfig APM |
1233 | tristate "APM (Advanced Power Management) BIOS support" | 1233 | tristate "APM (Advanced Power Management) BIOS support" |
1234 | depends on X86_32 && PM_SLEEP && !X86_VISWS | 1234 | depends on X86_32 && PM_SLEEP && !X86_VISWS |
1235 | ---help--- | 1235 | ---help--- |
1236 | APM is a BIOS specification for saving power using several different | 1236 | APM is a BIOS specification for saving power using several different |
1237 | techniques. This is mostly useful for battery powered laptops with | 1237 | techniques. This is mostly useful for battery powered laptops with |
1238 | APM compliant BIOSes. If you say Y here, the system time will be | 1238 | APM compliant BIOSes. If you say Y here, the system time will be |
1239 | reset after a RESUME operation, the /proc/apm device will provide | 1239 | reset after a RESUME operation, the /proc/apm device will provide |
1240 | battery status information, and user-space programs will receive | 1240 | battery status information, and user-space programs will receive |
1241 | notification of APM "events" (e.g. battery status change). | 1241 | notification of APM "events" (e.g. battery status change). |
1242 | 1242 | ||
1243 | If you select "Y" here, you can disable actual use of the APM | 1243 | If you select "Y" here, you can disable actual use of the APM |
1244 | BIOS by passing the "apm=off" option to the kernel at boot time. | 1244 | BIOS by passing the "apm=off" option to the kernel at boot time. |
1245 | 1245 | ||
1246 | Note that the APM support is almost completely disabled for | 1246 | Note that the APM support is almost completely disabled for |
1247 | machines with more than one CPU. | 1247 | machines with more than one CPU. |
1248 | 1248 | ||
1249 | In order to use APM, you will need supporting software. For location | 1249 | In order to use APM, you will need supporting software. For location |
1250 | and more information, read <file:Documentation/pm.txt> and the | 1250 | and more information, read <file:Documentation/pm.txt> and the |
1251 | Battery Powered Linux mini-HOWTO, available from | 1251 | Battery Powered Linux mini-HOWTO, available from |
1252 | <http://www.tldp.org/docs.html#howto>. | 1252 | <http://www.tldp.org/docs.html#howto>. |
1253 | 1253 | ||
1254 | This driver does not spin down disk drives (see the hdparm(8) | 1254 | This driver does not spin down disk drives (see the hdparm(8) |
1255 | manpage ("man 8 hdparm") for that), and it doesn't turn off | 1255 | manpage ("man 8 hdparm") for that), and it doesn't turn off |
1256 | VESA-compliant "green" monitors. | 1256 | VESA-compliant "green" monitors. |
1257 | 1257 | ||
1258 | This driver does not support the TI 4000M TravelMate and the ACER | 1258 | This driver does not support the TI 4000M TravelMate and the ACER |
1259 | 486/DX4/75 because they don't have compliant BIOSes. Many "green" | 1259 | 486/DX4/75 because they don't have compliant BIOSes. Many "green" |
1260 | desktop machines also don't have compliant BIOSes, and this driver | 1260 | desktop machines also don't have compliant BIOSes, and this driver |
1261 | may cause those machines to panic during the boot phase. | 1261 | may cause those machines to panic during the boot phase. |
1262 | 1262 | ||
1263 | Generally, if you don't have a battery in your machine, there isn't | 1263 | Generally, if you don't have a battery in your machine, there isn't |
1264 | much point in using this driver and you should say N. If you get | 1264 | much point in using this driver and you should say N. If you get |
1265 | random kernel OOPSes or reboots that don't seem to be related to | 1265 | random kernel OOPSes or reboots that don't seem to be related to |
1266 | anything, try disabling/enabling this option (or disabling/enabling | 1266 | anything, try disabling/enabling this option (or disabling/enabling |
1267 | APM in your BIOS). | 1267 | APM in your BIOS). |
1268 | 1268 | ||
1269 | Some other things you should try when experiencing seemingly random, | 1269 | Some other things you should try when experiencing seemingly random, |
1270 | "weird" problems: | 1270 | "weird" problems: |
1271 | 1271 | ||
1272 | 1) make sure that you have enough swap space and that it is | 1272 | 1) make sure that you have enough swap space and that it is |
1273 | enabled. | 1273 | enabled. |
1274 | 2) pass the "no-hlt" option to the kernel | 1274 | 2) pass the "no-hlt" option to the kernel |
1275 | 3) switch on floating point emulation in the kernel and pass | 1275 | 3) switch on floating point emulation in the kernel and pass |
1276 | the "no387" option to the kernel | 1276 | the "no387" option to the kernel |
1277 | 4) pass the "floppy=nodma" option to the kernel | 1277 | 4) pass the "floppy=nodma" option to the kernel |
1278 | 5) pass the "mem=4M" option to the kernel (thereby disabling | 1278 | 5) pass the "mem=4M" option to the kernel (thereby disabling |
1279 | all but the first 4 MB of RAM) | 1279 | all but the first 4 MB of RAM) |
1280 | 6) make sure that the CPU is not over clocked. | 1280 | 6) make sure that the CPU is not over clocked. |
1281 | 7) read the sig11 FAQ at <http://www.bitwizard.nl/sig11/> | 1281 | 7) read the sig11 FAQ at <http://www.bitwizard.nl/sig11/> |
1282 | 8) disable the cache from your BIOS settings | 1282 | 8) disable the cache from your BIOS settings |
1283 | 9) install a fan for the video card or exchange video RAM | 1283 | 9) install a fan for the video card or exchange video RAM |
1284 | 10) install a better fan for the CPU | 1284 | 10) install a better fan for the CPU |
1285 | 11) exchange RAM chips | 1285 | 11) exchange RAM chips |
1286 | 12) exchange the motherboard. | 1286 | 12) exchange the motherboard. |
1287 | 1287 | ||
1288 | To compile this driver as a module, choose M here: the | 1288 | To compile this driver as a module, choose M here: the |
1289 | module will be called apm. | 1289 | module will be called apm. |
1290 | 1290 | ||
1291 | if APM | 1291 | if APM |
1292 | 1292 | ||
1293 | config APM_IGNORE_USER_SUSPEND | 1293 | config APM_IGNORE_USER_SUSPEND |
1294 | bool "Ignore USER SUSPEND" | 1294 | bool "Ignore USER SUSPEND" |
1295 | help | 1295 | help |
1296 | This option will ignore USER SUSPEND requests. On machines with a | 1296 | This option will ignore USER SUSPEND requests. On machines with a |
1297 | compliant APM BIOS, you want to say N. However, on the NEC Versa M | 1297 | compliant APM BIOS, you want to say N. However, on the NEC Versa M |
1298 | series notebooks, it is necessary to say Y because of a BIOS bug. | 1298 | series notebooks, it is necessary to say Y because of a BIOS bug. |
1299 | 1299 | ||
1300 | config APM_DO_ENABLE | 1300 | config APM_DO_ENABLE |
1301 | bool "Enable PM at boot time" | 1301 | bool "Enable PM at boot time" |
1302 | ---help--- | 1302 | ---help--- |
1303 | Enable APM features at boot time. From page 36 of the APM BIOS | 1303 | Enable APM features at boot time. From page 36 of the APM BIOS |
1304 | specification: "When disabled, the APM BIOS does not automatically | 1304 | specification: "When disabled, the APM BIOS does not automatically |
1305 | power manage devices, enter the Standby State, enter the Suspend | 1305 | power manage devices, enter the Standby State, enter the Suspend |
1306 | State, or take power saving steps in response to CPU Idle calls." | 1306 | State, or take power saving steps in response to CPU Idle calls." |
1307 | This driver will make CPU Idle calls when Linux is idle (unless this | 1307 | This driver will make CPU Idle calls when Linux is idle (unless this |
1308 | feature is turned off -- see "Do CPU IDLE calls", below). This | 1308 | feature is turned off -- see "Do CPU IDLE calls", below). This |
1309 | should always save battery power, but more complicated APM features | 1309 | should always save battery power, but more complicated APM features |
1310 | will be dependent on your BIOS implementation. You may need to turn | 1310 | will be dependent on your BIOS implementation. You may need to turn |
1311 | this option off if your computer hangs at boot time when using APM | 1311 | this option off if your computer hangs at boot time when using APM |
1312 | support, or if it beeps continuously instead of suspending. Turn | 1312 | support, or if it beeps continuously instead of suspending. Turn |
1313 | this off if you have a NEC UltraLite Versa 33/C or a Toshiba | 1313 | this off if you have a NEC UltraLite Versa 33/C or a Toshiba |
1314 | T400CDT. This is off by default since most machines do fine without | 1314 | T400CDT. This is off by default since most machines do fine without |
1315 | this feature. | 1315 | this feature. |
1316 | 1316 | ||
1317 | config APM_CPU_IDLE | 1317 | config APM_CPU_IDLE |
1318 | bool "Make CPU Idle calls when idle" | 1318 | bool "Make CPU Idle calls when idle" |
1319 | help | 1319 | help |
1320 | Enable calls to APM CPU Idle/CPU Busy inside the kernel's idle loop. | 1320 | Enable calls to APM CPU Idle/CPU Busy inside the kernel's idle loop. |
1321 | On some machines, this can activate improved power savings, such as | 1321 | On some machines, this can activate improved power savings, such as |
1322 | a slowed CPU clock rate, when the machine is idle. These idle calls | 1322 | a slowed CPU clock rate, when the machine is idle. These idle calls |
1323 | are made after the idle loop has run for some length of time (e.g., | 1323 | are made after the idle loop has run for some length of time (e.g., |
1324 | 333 mS). On some machines, this will cause a hang at boot time or | 1324 | 333 mS). On some machines, this will cause a hang at boot time or |
1325 | whenever the CPU becomes idle. (On machines with more than one CPU, | 1325 | whenever the CPU becomes idle. (On machines with more than one CPU, |
1326 | this option does nothing.) | 1326 | this option does nothing.) |
1327 | 1327 | ||
1328 | config APM_DISPLAY_BLANK | 1328 | config APM_DISPLAY_BLANK |
1329 | bool "Enable console blanking using APM" | 1329 | bool "Enable console blanking using APM" |
1330 | help | 1330 | help |
1331 | Enable console blanking using the APM. Some laptops can use this to | 1331 | Enable console blanking using the APM. Some laptops can use this to |
1332 | turn off the LCD backlight when the screen blanker of the Linux | 1332 | turn off the LCD backlight when the screen blanker of the Linux |
1333 | virtual console blanks the screen. Note that this is only used by | 1333 | virtual console blanks the screen. Note that this is only used by |
1334 | the virtual console screen blanker, and won't turn off the backlight | 1334 | the virtual console screen blanker, and won't turn off the backlight |
1335 | when using the X Window system. This also doesn't have anything to | 1335 | when using the X Window system. This also doesn't have anything to |
1336 | do with your VESA-compliant power-saving monitor. Further, this | 1336 | do with your VESA-compliant power-saving monitor. Further, this |
1337 | option doesn't work for all laptops -- it might not turn off your | 1337 | option doesn't work for all laptops -- it might not turn off your |
1338 | backlight at all, or it might print a lot of errors to the console, | 1338 | backlight at all, or it might print a lot of errors to the console, |
1339 | especially if you are using gpm. | 1339 | especially if you are using gpm. |
1340 | 1340 | ||
1341 | config APM_ALLOW_INTS | 1341 | config APM_ALLOW_INTS |
1342 | bool "Allow interrupts during APM BIOS calls" | 1342 | bool "Allow interrupts during APM BIOS calls" |
1343 | help | 1343 | help |
1344 | Normally we disable external interrupts while we are making calls to | 1344 | Normally we disable external interrupts while we are making calls to |
1345 | the APM BIOS as a measure to lessen the effects of a badly behaving | 1345 | the APM BIOS as a measure to lessen the effects of a badly behaving |
1346 | BIOS implementation. The BIOS should reenable interrupts if it | 1346 | BIOS implementation. The BIOS should reenable interrupts if it |
1347 | needs to. Unfortunately, some BIOSes do not -- especially those in | 1347 | needs to. Unfortunately, some BIOSes do not -- especially those in |
1348 | many of the newer IBM Thinkpads. If you experience hangs when you | 1348 | many of the newer IBM Thinkpads. If you experience hangs when you |
1349 | suspend, try setting this to Y. Otherwise, say N. | 1349 | suspend, try setting this to Y. Otherwise, say N. |
1350 | 1350 | ||
1351 | config APM_REAL_MODE_POWER_OFF | 1351 | config APM_REAL_MODE_POWER_OFF |
1352 | bool "Use real mode APM BIOS call to power off" | 1352 | bool "Use real mode APM BIOS call to power off" |
1353 | help | 1353 | help |
1354 | Use real mode APM BIOS calls to switch off the computer. This is | 1354 | Use real mode APM BIOS calls to switch off the computer. This is |
1355 | a work-around for a number of buggy BIOSes. Switch this option on if | 1355 | a work-around for a number of buggy BIOSes. Switch this option on if |
1356 | your computer crashes instead of powering off properly. | 1356 | your computer crashes instead of powering off properly. |
1357 | 1357 | ||
1358 | endif # APM | 1358 | endif # APM |
1359 | 1359 | ||
1360 | source "arch/x86/kernel/cpu/cpufreq/Kconfig" | 1360 | source "arch/x86/kernel/cpu/cpufreq/Kconfig" |
1361 | 1361 | ||
1362 | source "drivers/cpuidle/Kconfig" | 1362 | source "drivers/cpuidle/Kconfig" |
1363 | 1363 | ||
1364 | endmenu | 1364 | endmenu |
1365 | 1365 | ||
1366 | 1366 | ||
1367 | menu "Bus options (PCI etc.)" | 1367 | menu "Bus options (PCI etc.)" |
1368 | 1368 | ||
1369 | config PCI | 1369 | config PCI |
1370 | bool "PCI support" if !X86_VISWS | 1370 | bool "PCI support" if !X86_VISWS |
1371 | depends on !X86_VOYAGER | 1371 | depends on !X86_VOYAGER |
1372 | default y if X86_VISWS | 1372 | default y if X86_VISWS |
1373 | select ARCH_SUPPORTS_MSI if (X86_LOCAL_APIC && X86_IO_APIC) | 1373 | select ARCH_SUPPORTS_MSI if (X86_LOCAL_APIC && X86_IO_APIC) |
1374 | help | 1374 | help |
1375 | Find out whether you have a PCI motherboard. PCI is the name of a | 1375 | Find out whether you have a PCI motherboard. PCI is the name of a |
1376 | bus system, i.e. the way the CPU talks to the other stuff inside | 1376 | bus system, i.e. the way the CPU talks to the other stuff inside |
1377 | your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or | 1377 | your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or |
1378 | VESA. If you have PCI, say Y, otherwise N. | 1378 | VESA. If you have PCI, say Y, otherwise N. |
1379 | 1379 | ||
1380 | The PCI-HOWTO, available from | 1380 | The PCI-HOWTO, available from |
1381 | <http://www.tldp.org/docs.html#howto>, contains valuable | 1381 | <http://www.tldp.org/docs.html#howto>, contains valuable |
1382 | information about which PCI hardware does work under Linux and which | 1382 | information about which PCI hardware does work under Linux and which |
1383 | doesn't. | 1383 | doesn't. |
1384 | 1384 | ||
1385 | choice | 1385 | choice |
1386 | prompt "PCI access mode" | 1386 | prompt "PCI access mode" |
1387 | depends on X86_32 && PCI && !X86_VISWS | 1387 | depends on X86_32 && PCI && !X86_VISWS |
1388 | default PCI_GOANY | 1388 | default PCI_GOANY |
1389 | ---help--- | 1389 | ---help--- |
1390 | On PCI systems, the BIOS can be used to detect the PCI devices and | 1390 | On PCI systems, the BIOS can be used to detect the PCI devices and |
1391 | determine their configuration. However, some old PCI motherboards | 1391 | determine their configuration. However, some old PCI motherboards |
1392 | have BIOS bugs and may crash if this is done. Also, some embedded | 1392 | have BIOS bugs and may crash if this is done. Also, some embedded |
1393 | PCI-based systems don't have any BIOS at all. Linux can also try to | 1393 | PCI-based systems don't have any BIOS at all. Linux can also try to |
1394 | detect the PCI hardware directly without using the BIOS. | 1394 | detect the PCI hardware directly without using the BIOS. |
1395 | 1395 | ||
1396 | With this option, you can specify how Linux should detect the | 1396 | With this option, you can specify how Linux should detect the |
1397 | PCI devices. If you choose "BIOS", the BIOS will be used, | 1397 | PCI devices. If you choose "BIOS", the BIOS will be used, |
1398 | if you choose "Direct", the BIOS won't be used, and if you | 1398 | if you choose "Direct", the BIOS won't be used, and if you |
1399 | choose "MMConfig", then PCI Express MMCONFIG will be used. | 1399 | choose "MMConfig", then PCI Express MMCONFIG will be used. |
1400 | If you choose "Any", the kernel will try MMCONFIG, then the | 1400 | If you choose "Any", the kernel will try MMCONFIG, then the |
1401 | direct access method and falls back to the BIOS if that doesn't | 1401 | direct access method and falls back to the BIOS if that doesn't |
1402 | work. If unsure, go with the default, which is "Any". | 1402 | work. If unsure, go with the default, which is "Any". |
1403 | 1403 | ||
1404 | config PCI_GOBIOS | 1404 | config PCI_GOBIOS |
1405 | bool "BIOS" | 1405 | bool "BIOS" |
1406 | 1406 | ||
1407 | config PCI_GOMMCONFIG | 1407 | config PCI_GOMMCONFIG |
1408 | bool "MMConfig" | 1408 | bool "MMConfig" |
1409 | 1409 | ||
1410 | config PCI_GODIRECT | 1410 | config PCI_GODIRECT |
1411 | bool "Direct" | 1411 | bool "Direct" |
1412 | 1412 | ||
1413 | config PCI_GOANY | 1413 | config PCI_GOANY |
1414 | bool "Any" | 1414 | bool "Any" |
1415 | 1415 | ||
1416 | endchoice | 1416 | endchoice |
1417 | 1417 | ||
1418 | config PCI_BIOS | 1418 | config PCI_BIOS |
1419 | bool | 1419 | bool |
1420 | depends on X86_32 && !X86_VISWS && PCI && (PCI_GOBIOS || PCI_GOANY) | 1420 | depends on X86_32 && !X86_VISWS && PCI && (PCI_GOBIOS || PCI_GOANY) |
1421 | default y | 1421 | default y |
1422 | 1422 | ||
1423 | # x86-64 doesn't support PCI BIOS access from long mode so always go direct. | 1423 | # x86-64 doesn't support PCI BIOS access from long mode so always go direct. |
1424 | config PCI_DIRECT | 1424 | config PCI_DIRECT |
1425 | bool | 1425 | bool |
1426 | depends on PCI && (X86_64 || (PCI_GODIRECT || PCI_GOANY) || X86_VISWS) | 1426 | depends on PCI && (X86_64 || (PCI_GODIRECT || PCI_GOANY) || X86_VISWS) |
1427 | default y | 1427 | default y |
1428 | 1428 | ||
1429 | config PCI_MMCONFIG | 1429 | config PCI_MMCONFIG |
1430 | bool | 1430 | bool |
1431 | depends on X86_32 && PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY) | 1431 | depends on X86_32 && PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY) |
1432 | default y | 1432 | default y |
1433 | 1433 | ||
1434 | config PCI_DOMAINS | 1434 | config PCI_DOMAINS |
1435 | bool | 1435 | bool |
1436 | depends on PCI | 1436 | depends on PCI |
1437 | default y | 1437 | default y |
1438 | 1438 | ||
1439 | config PCI_MMCONFIG | 1439 | config PCI_MMCONFIG |
1440 | bool "Support mmconfig PCI config space access" | 1440 | bool "Support mmconfig PCI config space access" |
1441 | depends on X86_64 && PCI && ACPI | 1441 | depends on X86_64 && PCI && ACPI |
1442 | 1442 | ||
1443 | config DMAR | 1443 | config DMAR |
1444 | bool "Support for DMA Remapping Devices (EXPERIMENTAL)" | 1444 | bool "Support for DMA Remapping Devices (EXPERIMENTAL)" |
1445 | depends on X86_64 && PCI_MSI && ACPI && EXPERIMENTAL | 1445 | depends on X86_64 && PCI_MSI && ACPI && EXPERIMENTAL |
1446 | help | 1446 | help |
1447 | DMA remapping (DMAR) devices support enables independent address | 1447 | DMA remapping (DMAR) devices support enables independent address |
1448 | translations for Direct Memory Access (DMA) from devices. | 1448 | translations for Direct Memory Access (DMA) from devices. |
1449 | These DMA remapping devices are reported via ACPI tables | 1449 | These DMA remapping devices are reported via ACPI tables |
1450 | and include PCI device scope covered by these DMA | 1450 | and include PCI device scope covered by these DMA |
1451 | remapping devices. | 1451 | remapping devices. |
1452 | 1452 | ||
1453 | config DMAR_GFX_WA | 1453 | config DMAR_GFX_WA |
1454 | bool "Support for Graphics workaround" | 1454 | bool "Support for Graphics workaround" |
1455 | depends on DMAR | 1455 | depends on DMAR |
1456 | default y | 1456 | default y |
1457 | help | 1457 | help |
1458 | Current Graphics drivers tend to use physical address | 1458 | Current Graphics drivers tend to use physical address |
1459 | for DMA and avoid using DMA APIs. Setting this config | 1459 | for DMA and avoid using DMA APIs. Setting this config |
1460 | option permits the IOMMU driver to set a unity map for | 1460 | option permits the IOMMU driver to set a unity map for |
1461 | all the OS-visible memory. Hence the driver can continue | 1461 | all the OS-visible memory. Hence the driver can continue |
1462 | to use physical addresses for DMA. | 1462 | to use physical addresses for DMA. |
1463 | 1463 | ||
1464 | config DMAR_FLOPPY_WA | 1464 | config DMAR_FLOPPY_WA |
1465 | bool | 1465 | bool |
1466 | depends on DMAR | 1466 | depends on DMAR |
1467 | default y | 1467 | default y |
1468 | help | 1468 | help |
1469 | Floppy disk drivers are know to bypass DMA API calls | 1469 | Floppy disk drivers are know to bypass DMA API calls |
1470 | thereby failing to work when IOMMU is enabled. This | 1470 | thereby failing to work when IOMMU is enabled. This |
1471 | workaround will setup a 1:1 mapping for the first | 1471 | workaround will setup a 1:1 mapping for the first |
1472 | 16M to make floppy (an ISA device) work. | 1472 | 16M to make floppy (an ISA device) work. |
1473 | 1473 | ||
1474 | source "drivers/pci/pcie/Kconfig" | 1474 | source "drivers/pci/pcie/Kconfig" |
1475 | 1475 | ||
1476 | source "drivers/pci/Kconfig" | 1476 | source "drivers/pci/Kconfig" |
1477 | 1477 | ||
1478 | # x86_64 have no ISA slots, but do have ISA-style DMA. | 1478 | # x86_64 have no ISA slots, but do have ISA-style DMA. |
1479 | config ISA_DMA_API | 1479 | config ISA_DMA_API |
1480 | bool | 1480 | bool |
1481 | default y | 1481 | default y |
1482 | 1482 | ||
1483 | if X86_32 | 1483 | if X86_32 |
1484 | 1484 | ||
1485 | config ISA | 1485 | config ISA |
1486 | bool "ISA support" | 1486 | bool "ISA support" |
1487 | depends on !(X86_VOYAGER || X86_VISWS) | 1487 | depends on !(X86_VOYAGER || X86_VISWS) |
1488 | help | 1488 | help |
1489 | Find out whether you have ISA slots on your motherboard. ISA is the | 1489 | Find out whether you have ISA slots on your motherboard. ISA is the |
1490 | name of a bus system, i.e. the way the CPU talks to the other stuff | 1490 | name of a bus system, i.e. the way the CPU talks to the other stuff |
1491 | inside your box. Other bus systems are PCI, EISA, MicroChannel | 1491 | inside your box. Other bus systems are PCI, EISA, MicroChannel |
1492 | (MCA) or VESA. ISA is an older system, now being displaced by PCI; | 1492 | (MCA) or VESA. ISA is an older system, now being displaced by PCI; |
1493 | newer boards don't support it. If you have ISA, say Y, otherwise N. | 1493 | newer boards don't support it. If you have ISA, say Y, otherwise N. |
1494 | 1494 | ||
1495 | config EISA | 1495 | config EISA |
1496 | bool "EISA support" | 1496 | bool "EISA support" |
1497 | depends on ISA | 1497 | depends on ISA |
1498 | ---help--- | 1498 | ---help--- |
1499 | The Extended Industry Standard Architecture (EISA) bus was | 1499 | The Extended Industry Standard Architecture (EISA) bus was |
1500 | developed as an open alternative to the IBM MicroChannel bus. | 1500 | developed as an open alternative to the IBM MicroChannel bus. |
1501 | 1501 | ||
1502 | The EISA bus provided some of the features of the IBM MicroChannel | 1502 | The EISA bus provided some of the features of the IBM MicroChannel |
1503 | bus while maintaining backward compatibility with cards made for | 1503 | bus while maintaining backward compatibility with cards made for |
1504 | the older ISA bus. The EISA bus saw limited use between 1988 and | 1504 | the older ISA bus. The EISA bus saw limited use between 1988 and |
1505 | 1995 when it was made obsolete by the PCI bus. | 1505 | 1995 when it was made obsolete by the PCI bus. |
1506 | 1506 | ||
1507 | Say Y here if you are building a kernel for an EISA-based machine. | 1507 | Say Y here if you are building a kernel for an EISA-based machine. |
1508 | 1508 | ||
1509 | Otherwise, say N. | 1509 | Otherwise, say N. |
1510 | 1510 | ||
1511 | source "drivers/eisa/Kconfig" | 1511 | source "drivers/eisa/Kconfig" |
1512 | 1512 | ||
1513 | config MCA | 1513 | config MCA |
1514 | bool "MCA support" if !(X86_VISWS || X86_VOYAGER) | 1514 | bool "MCA support" if !(X86_VISWS || X86_VOYAGER) |
1515 | default y if X86_VOYAGER | 1515 | default y if X86_VOYAGER |
1516 | help | 1516 | help |
1517 | MicroChannel Architecture is found in some IBM PS/2 machines and | 1517 | MicroChannel Architecture is found in some IBM PS/2 machines and |
1518 | laptops. It is a bus system similar to PCI or ISA. See | 1518 | laptops. It is a bus system similar to PCI or ISA. See |
1519 | <file:Documentation/mca.txt> (and especially the web page given | 1519 | <file:Documentation/mca.txt> (and especially the web page given |
1520 | there) before attempting to build an MCA bus kernel. | 1520 | there) before attempting to build an MCA bus kernel. |
1521 | 1521 | ||
1522 | source "drivers/mca/Kconfig" | 1522 | source "drivers/mca/Kconfig" |
1523 | 1523 | ||
1524 | config SCx200 | 1524 | config SCx200 |
1525 | tristate "NatSemi SCx200 support" | 1525 | tristate "NatSemi SCx200 support" |
1526 | depends on !X86_VOYAGER | 1526 | depends on !X86_VOYAGER |
1527 | help | 1527 | help |
1528 | This provides basic support for National Semiconductor's | 1528 | This provides basic support for National Semiconductor's |
1529 | (now AMD's) Geode processors. The driver probes for the | 1529 | (now AMD's) Geode processors. The driver probes for the |
1530 | PCI-IDs of several on-chip devices, so its a good dependency | 1530 | PCI-IDs of several on-chip devices, so its a good dependency |
1531 | for other scx200_* drivers. | 1531 | for other scx200_* drivers. |
1532 | 1532 | ||
1533 | If compiled as a module, the driver is named scx200. | 1533 | If compiled as a module, the driver is named scx200. |
1534 | 1534 | ||
1535 | config SCx200HR_TIMER | 1535 | config SCx200HR_TIMER |
1536 | tristate "NatSemi SCx200 27MHz High-Resolution Timer Support" | 1536 | tristate "NatSemi SCx200 27MHz High-Resolution Timer Support" |
1537 | depends on SCx200 && GENERIC_TIME | 1537 | depends on SCx200 && GENERIC_TIME |
1538 | default y | 1538 | default y |
1539 | help | 1539 | help |
1540 | This driver provides a clocksource built upon the on-chip | 1540 | This driver provides a clocksource built upon the on-chip |
1541 | 27MHz high-resolution timer. Its also a workaround for | 1541 | 27MHz high-resolution timer. Its also a workaround for |
1542 | NSC Geode SC-1100's buggy TSC, which loses time when the | 1542 | NSC Geode SC-1100's buggy TSC, which loses time when the |
1543 | processor goes idle (as is done by the scheduler). The | 1543 | processor goes idle (as is done by the scheduler). The |
1544 | other workaround is idle=poll boot option. | 1544 | other workaround is idle=poll boot option. |
1545 | 1545 | ||
1546 | config GEODE_MFGPT_TIMER | 1546 | config GEODE_MFGPT_TIMER |
1547 | bool "Geode Multi-Function General Purpose Timer (MFGPT) events" | 1547 | bool "Geode Multi-Function General Purpose Timer (MFGPT) events" |
1548 | depends on MGEODE_LX && GENERIC_TIME && GENERIC_CLOCKEVENTS | 1548 | depends on MGEODE_LX && GENERIC_TIME && GENERIC_CLOCKEVENTS |
1549 | default y | 1549 | default y |
1550 | help | 1550 | help |
1551 | This driver provides a clock event source based on the MFGPT | 1551 | This driver provides a clock event source based on the MFGPT |
1552 | timer(s) in the CS5535 and CS5536 companion chip for the geode. | 1552 | timer(s) in the CS5535 and CS5536 companion chip for the geode. |
1553 | MFGPTs have a better resolution and max interval than the | 1553 | MFGPTs have a better resolution and max interval than the |
1554 | generic PIT, and are suitable for use as high-res timers. | 1554 | generic PIT, and are suitable for use as high-res timers. |
1555 | 1555 | ||
1556 | endif # X86_32 | 1556 | endif # X86_32 |
1557 | 1557 | ||
1558 | config K8_NB | 1558 | config K8_NB |
1559 | def_bool y | 1559 | def_bool y |
1560 | depends on AGP_AMD64 || (X86_64 && (GART_IOMMU || (PCI && NUMA))) | 1560 | depends on AGP_AMD64 || (X86_64 && (GART_IOMMU || (PCI && NUMA))) |
1561 | 1561 | ||
1562 | source "drivers/pcmcia/Kconfig" | 1562 | source "drivers/pcmcia/Kconfig" |
1563 | 1563 | ||
1564 | source "drivers/pci/hotplug/Kconfig" | 1564 | source "drivers/pci/hotplug/Kconfig" |
1565 | 1565 | ||
1566 | endmenu | 1566 | endmenu |
1567 | 1567 | ||
1568 | 1568 | ||
1569 | menu "Executable file formats / Emulations" | 1569 | menu "Executable file formats / Emulations" |
1570 | 1570 | ||
1571 | source "fs/Kconfig.binfmt" | 1571 | source "fs/Kconfig.binfmt" |
1572 | 1572 | ||
1573 | config IA32_EMULATION | 1573 | config IA32_EMULATION |
1574 | bool "IA32 Emulation" | 1574 | bool "IA32 Emulation" |
1575 | depends on X86_64 | 1575 | depends on X86_64 |
1576 | help | 1576 | help |
1577 | Include code to run 32-bit programs under a 64-bit kernel. You should | 1577 | Include code to run 32-bit programs under a 64-bit kernel. You should |
1578 | likely turn this on, unless you're 100% sure that you don't have any | 1578 | likely turn this on, unless you're 100% sure that you don't have any |
1579 | 32-bit programs left. | 1579 | 32-bit programs left. |
1580 | 1580 | ||
1581 | config IA32_AOUT | 1581 | config IA32_AOUT |
1582 | tristate "IA32 a.out support" | 1582 | tristate "IA32 a.out support" |
1583 | depends on IA32_EMULATION | 1583 | depends on IA32_EMULATION |
1584 | help | 1584 | help |
1585 | Support old a.out binaries in the 32bit emulation. | 1585 | Support old a.out binaries in the 32bit emulation. |
1586 | 1586 | ||
1587 | config COMPAT | 1587 | config COMPAT |
1588 | bool | 1588 | bool |
1589 | depends on IA32_EMULATION | 1589 | depends on IA32_EMULATION |
1590 | default y | 1590 | default y |
1591 | 1591 | ||
1592 | config COMPAT_FOR_U64_ALIGNMENT | 1592 | config COMPAT_FOR_U64_ALIGNMENT |
1593 | def_bool COMPAT | 1593 | def_bool COMPAT |
1594 | depends on X86_64 | 1594 | depends on X86_64 |
1595 | 1595 | ||
1596 | config SYSVIPC_COMPAT | 1596 | config SYSVIPC_COMPAT |
1597 | bool | 1597 | bool |
1598 | depends on X86_64 && COMPAT && SYSVIPC | 1598 | depends on X86_64 && COMPAT && SYSVIPC |
1599 | default y | 1599 | default y |
1600 | 1600 | ||
1601 | endmenu | 1601 | endmenu |
1602 | 1602 | ||
1603 | 1603 | ||
1604 | source "net/Kconfig" | 1604 | source "net/Kconfig" |
1605 | 1605 | ||
1606 | source "drivers/Kconfig" | 1606 | source "drivers/Kconfig" |
1607 | 1607 | ||
1608 | source "drivers/firmware/Kconfig" | 1608 | source "drivers/firmware/Kconfig" |
1609 | 1609 | ||
1610 | source "fs/Kconfig" | 1610 | source "fs/Kconfig" |
1611 | 1611 | ||
1612 | source "kernel/Kconfig.instrumentation" | 1612 | source "kernel/Kconfig.instrumentation" |
1613 | 1613 | ||
1614 | source "arch/x86/Kconfig.debug" | 1614 | source "arch/x86/Kconfig.debug" |
1615 | 1615 | ||
1616 | source "security/Kconfig" | 1616 | source "security/Kconfig" |
1617 | 1617 | ||
1618 | source "crypto/Kconfig" | 1618 | source "crypto/Kconfig" |
1619 | 1619 | ||
1620 | source "lib/Kconfig" | 1620 | source "lib/Kconfig" |
1621 | 1621 |
scripts/kconfig/conf.c
1 | /* | 1 | /* |
2 | * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> | 2 | * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> |
3 | * Released under the terms of the GNU GPL v2.0. | 3 | * Released under the terms of the GNU GPL v2.0. |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include <ctype.h> | 6 | #include <ctype.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #include <stdio.h> | 8 | #include <stdio.h> |
9 | #include <string.h> | 9 | #include <string.h> |
10 | #include <unistd.h> | 10 | #include <unistd.h> |
11 | #include <time.h> | 11 | #include <time.h> |
12 | #include <sys/stat.h> | 12 | #include <sys/stat.h> |
13 | 13 | ||
14 | #define LKC_DIRECT_LINK | 14 | #define LKC_DIRECT_LINK |
15 | #include "lkc.h" | 15 | #include "lkc.h" |
16 | 16 | ||
17 | static void conf(struct menu *menu); | 17 | static void conf(struct menu *menu); |
18 | static void check_conf(struct menu *menu); | 18 | static void check_conf(struct menu *menu); |
19 | 19 | ||
20 | enum { | 20 | enum { |
21 | ask_all, | 21 | ask_all, |
22 | ask_new, | 22 | ask_new, |
23 | ask_silent, | 23 | ask_silent, |
24 | set_default, | 24 | set_default, |
25 | set_yes, | 25 | set_yes, |
26 | set_mod, | 26 | set_mod, |
27 | set_no, | 27 | set_no, |
28 | set_random | 28 | set_random |
29 | } input_mode = ask_all; | 29 | } input_mode = ask_all; |
30 | char *defconfig_file; | 30 | char *defconfig_file; |
31 | 31 | ||
32 | static int indent = 1; | 32 | static int indent = 1; |
33 | static int valid_stdin = 1; | 33 | static int valid_stdin = 1; |
34 | static int conf_cnt; | 34 | static int conf_cnt; |
35 | static char line[128]; | 35 | static char line[128]; |
36 | static struct menu *rootEntry; | 36 | static struct menu *rootEntry; |
37 | 37 | ||
38 | static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); | 38 | static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); |
39 | 39 | ||
40 | static const char *get_help(struct menu *menu) | 40 | static const char *get_help(struct menu *menu) |
41 | { | 41 | { |
42 | if (menu_has_help(menu)) | 42 | if (menu_has_help(menu)) |
43 | return menu_get_help(menu); | 43 | return menu_get_help(menu); |
44 | else | 44 | else |
45 | return nohelp_text; | 45 | return nohelp_text; |
46 | } | 46 | } |
47 | 47 | ||
48 | static void strip(char *str) | 48 | static void strip(char *str) |
49 | { | 49 | { |
50 | char *p = str; | 50 | char *p = str; |
51 | int l; | 51 | int l; |
52 | 52 | ||
53 | while ((isspace(*p))) | 53 | while ((isspace(*p))) |
54 | p++; | 54 | p++; |
55 | l = strlen(p); | 55 | l = strlen(p); |
56 | if (p != str) | 56 | if (p != str) |
57 | memmove(str, p, l + 1); | 57 | memmove(str, p, l + 1); |
58 | if (!l) | 58 | if (!l) |
59 | return; | 59 | return; |
60 | p = str + l - 1; | 60 | p = str + l - 1; |
61 | while ((isspace(*p))) | 61 | while ((isspace(*p))) |
62 | *p-- = 0; | 62 | *p-- = 0; |
63 | } | 63 | } |
64 | 64 | ||
65 | static void check_stdin(void) | 65 | static void check_stdin(void) |
66 | { | 66 | { |
67 | if (!valid_stdin && input_mode == ask_silent) { | 67 | if (!valid_stdin && input_mode == ask_silent) { |
68 | printf(_("aborted!\n\n")); | 68 | printf(_("aborted!\n\n")); |
69 | printf(_("Console input/output is redirected. ")); | 69 | printf(_("Console input/output is redirected. ")); |
70 | printf(_("Run 'make oldconfig' to update configuration.\n\n")); | 70 | printf(_("Run 'make oldconfig' to update configuration.\n\n")); |
71 | exit(1); | 71 | exit(1); |
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | static int conf_askvalue(struct symbol *sym, const char *def) | 75 | static int conf_askvalue(struct symbol *sym, const char *def) |
76 | { | 76 | { |
77 | enum symbol_type type = sym_get_type(sym); | 77 | enum symbol_type type = sym_get_type(sym); |
78 | tristate val; | 78 | tristate val; |
79 | 79 | ||
80 | if (!sym_has_value(sym)) | 80 | if (!sym_has_value(sym)) |
81 | printf("(NEW) "); | 81 | printf("(NEW) "); |
82 | 82 | ||
83 | line[0] = '\n'; | 83 | line[0] = '\n'; |
84 | line[1] = 0; | 84 | line[1] = 0; |
85 | 85 | ||
86 | if (!sym_is_changable(sym)) { | 86 | if (!sym_is_changable(sym)) { |
87 | printf("%s\n", def); | 87 | printf("%s\n", def); |
88 | line[0] = '\n'; | 88 | line[0] = '\n'; |
89 | line[1] = 0; | 89 | line[1] = 0; |
90 | return 0; | 90 | return 0; |
91 | } | 91 | } |
92 | 92 | ||
93 | switch (input_mode) { | 93 | switch (input_mode) { |
94 | case set_no: | 94 | case set_no: |
95 | case set_mod: | 95 | case set_mod: |
96 | case set_yes: | 96 | case set_yes: |
97 | case set_random: | 97 | case set_random: |
98 | if (sym_has_value(sym)) { | 98 | if (sym_has_value(sym)) { |
99 | printf("%s\n", def); | 99 | printf("%s\n", def); |
100 | return 0; | 100 | return 0; |
101 | } | 101 | } |
102 | break; | 102 | break; |
103 | case ask_new: | 103 | case ask_new: |
104 | case ask_silent: | 104 | case ask_silent: |
105 | if (sym_has_value(sym)) { | 105 | if (sym_has_value(sym)) { |
106 | printf("%s\n", def); | 106 | printf("%s\n", def); |
107 | return 0; | 107 | return 0; |
108 | } | 108 | } |
109 | check_stdin(); | 109 | check_stdin(); |
110 | case ask_all: | 110 | case ask_all: |
111 | fflush(stdout); | 111 | fflush(stdout); |
112 | fgets(line, 128, stdin); | 112 | fgets(line, 128, stdin); |
113 | return 1; | 113 | return 1; |
114 | case set_default: | 114 | case set_default: |
115 | printf("%s\n", def); | 115 | printf("%s\n", def); |
116 | return 1; | 116 | return 1; |
117 | default: | 117 | default: |
118 | break; | 118 | break; |
119 | } | 119 | } |
120 | 120 | ||
121 | switch (type) { | 121 | switch (type) { |
122 | case S_INT: | 122 | case S_INT: |
123 | case S_HEX: | 123 | case S_HEX: |
124 | case S_STRING: | 124 | case S_STRING: |
125 | printf("%s\n", def); | 125 | printf("%s\n", def); |
126 | return 1; | 126 | return 1; |
127 | default: | 127 | default: |
128 | ; | 128 | ; |
129 | } | 129 | } |
130 | switch (input_mode) { | 130 | switch (input_mode) { |
131 | case set_yes: | 131 | case set_yes: |
132 | if (sym_tristate_within_range(sym, yes)) { | 132 | if (sym_tristate_within_range(sym, yes)) { |
133 | line[0] = 'y'; | 133 | line[0] = 'y'; |
134 | line[1] = '\n'; | 134 | line[1] = '\n'; |
135 | line[2] = 0; | 135 | line[2] = 0; |
136 | break; | 136 | break; |
137 | } | 137 | } |
138 | case set_mod: | 138 | case set_mod: |
139 | if (type == S_TRISTATE) { | 139 | if (type == S_TRISTATE) { |
140 | if (sym_tristate_within_range(sym, mod)) { | 140 | if (sym_tristate_within_range(sym, mod)) { |
141 | line[0] = 'm'; | 141 | line[0] = 'm'; |
142 | line[1] = '\n'; | 142 | line[1] = '\n'; |
143 | line[2] = 0; | 143 | line[2] = 0; |
144 | break; | 144 | break; |
145 | } | 145 | } |
146 | } else { | 146 | } else { |
147 | if (sym_tristate_within_range(sym, yes)) { | 147 | if (sym_tristate_within_range(sym, yes)) { |
148 | line[0] = 'y'; | 148 | line[0] = 'y'; |
149 | line[1] = '\n'; | 149 | line[1] = '\n'; |
150 | line[2] = 0; | 150 | line[2] = 0; |
151 | break; | 151 | break; |
152 | } | 152 | } |
153 | } | 153 | } |
154 | case set_no: | 154 | case set_no: |
155 | if (sym_tristate_within_range(sym, no)) { | 155 | if (sym_tristate_within_range(sym, no)) { |
156 | line[0] = 'n'; | 156 | line[0] = 'n'; |
157 | line[1] = '\n'; | 157 | line[1] = '\n'; |
158 | line[2] = 0; | 158 | line[2] = 0; |
159 | break; | 159 | break; |
160 | } | 160 | } |
161 | case set_random: | 161 | case set_random: |
162 | do { | 162 | do { |
163 | val = (tristate)(random() % 3); | 163 | val = (tristate)(random() % 3); |
164 | } while (!sym_tristate_within_range(sym, val)); | 164 | } while (!sym_tristate_within_range(sym, val)); |
165 | switch (val) { | 165 | switch (val) { |
166 | case no: line[0] = 'n'; break; | 166 | case no: line[0] = 'n'; break; |
167 | case mod: line[0] = 'm'; break; | 167 | case mod: line[0] = 'm'; break; |
168 | case yes: line[0] = 'y'; break; | 168 | case yes: line[0] = 'y'; break; |
169 | } | 169 | } |
170 | line[1] = '\n'; | 170 | line[1] = '\n'; |
171 | line[2] = 0; | 171 | line[2] = 0; |
172 | break; | 172 | break; |
173 | default: | 173 | default: |
174 | break; | 174 | break; |
175 | } | 175 | } |
176 | printf("%s", line); | 176 | printf("%s", line); |
177 | return 1; | 177 | return 1; |
178 | } | 178 | } |
179 | 179 | ||
180 | int conf_string(struct menu *menu) | 180 | int conf_string(struct menu *menu) |
181 | { | 181 | { |
182 | struct symbol *sym = menu->sym; | 182 | struct symbol *sym = menu->sym; |
183 | const char *def; | 183 | const char *def; |
184 | 184 | ||
185 | while (1) { | 185 | while (1) { |
186 | printf("%*s%s ", indent - 1, "", menu->prompt->text); | 186 | printf("%*s%s ", indent - 1, "", menu->prompt->text); |
187 | printf("(%s) ", sym->name); | 187 | printf("(%s) ", sym->name); |
188 | def = sym_get_string_value(sym); | 188 | def = sym_get_string_value(sym); |
189 | if (sym_get_string_value(sym)) | 189 | if (sym_get_string_value(sym)) |
190 | printf("[%s] ", def); | 190 | printf("[%s] ", def); |
191 | if (!conf_askvalue(sym, def)) | 191 | if (!conf_askvalue(sym, def)) |
192 | return 0; | 192 | return 0; |
193 | switch (line[0]) { | 193 | switch (line[0]) { |
194 | case '\n': | 194 | case '\n': |
195 | break; | 195 | break; |
196 | case '?': | 196 | case '?': |
197 | /* print help */ | 197 | /* print help */ |
198 | if (line[1] == '\n') { | 198 | if (line[1] == '\n') { |
199 | printf("\n%s\n", get_help(menu)); | 199 | printf("\n%s\n", get_help(menu)); |
200 | def = NULL; | 200 | def = NULL; |
201 | break; | 201 | break; |
202 | } | 202 | } |
203 | default: | 203 | default: |
204 | line[strlen(line)-1] = 0; | 204 | line[strlen(line)-1] = 0; |
205 | def = line; | 205 | def = line; |
206 | } | 206 | } |
207 | if (def && sym_set_string_value(sym, def)) | 207 | if (def && sym_set_string_value(sym, def)) |
208 | return 0; | 208 | return 0; |
209 | } | 209 | } |
210 | } | 210 | } |
211 | 211 | ||
212 | static int conf_sym(struct menu *menu) | 212 | static int conf_sym(struct menu *menu) |
213 | { | 213 | { |
214 | struct symbol *sym = menu->sym; | 214 | struct symbol *sym = menu->sym; |
215 | int type; | 215 | int type; |
216 | tristate oldval, newval; | 216 | tristate oldval, newval; |
217 | 217 | ||
218 | while (1) { | 218 | while (1) { |
219 | printf("%*s%s ", indent - 1, "", menu->prompt->text); | 219 | printf("%*s%s ", indent - 1, "", menu->prompt->text); |
220 | if (sym->name) | 220 | if (sym->name) |
221 | printf("(%s) ", sym->name); | 221 | printf("(%s) ", sym->name); |
222 | type = sym_get_type(sym); | 222 | type = sym_get_type(sym); |
223 | putchar('['); | 223 | putchar('['); |
224 | oldval = sym_get_tristate_value(sym); | 224 | oldval = sym_get_tristate_value(sym); |
225 | switch (oldval) { | 225 | switch (oldval) { |
226 | case no: | 226 | case no: |
227 | putchar('N'); | 227 | putchar('N'); |
228 | break; | 228 | break; |
229 | case mod: | 229 | case mod: |
230 | putchar('M'); | 230 | putchar('M'); |
231 | break; | 231 | break; |
232 | case yes: | 232 | case yes: |
233 | putchar('Y'); | 233 | putchar('Y'); |
234 | break; | 234 | break; |
235 | } | 235 | } |
236 | if (oldval != no && sym_tristate_within_range(sym, no)) | 236 | if (oldval != no && sym_tristate_within_range(sym, no)) |
237 | printf("/n"); | 237 | printf("/n"); |
238 | if (oldval != mod && sym_tristate_within_range(sym, mod)) | 238 | if (oldval != mod && sym_tristate_within_range(sym, mod)) |
239 | printf("/m"); | 239 | printf("/m"); |
240 | if (oldval != yes && sym_tristate_within_range(sym, yes)) | 240 | if (oldval != yes && sym_tristate_within_range(sym, yes)) |
241 | printf("/y"); | 241 | printf("/y"); |
242 | if (menu_has_help(menu)) | 242 | if (menu_has_help(menu)) |
243 | printf("/?"); | 243 | printf("/?"); |
244 | printf("] "); | 244 | printf("] "); |
245 | if (!conf_askvalue(sym, sym_get_string_value(sym))) | 245 | if (!conf_askvalue(sym, sym_get_string_value(sym))) |
246 | return 0; | 246 | return 0; |
247 | strip(line); | 247 | strip(line); |
248 | 248 | ||
249 | switch (line[0]) { | 249 | switch (line[0]) { |
250 | case 'n': | 250 | case 'n': |
251 | case 'N': | 251 | case 'N': |
252 | newval = no; | 252 | newval = no; |
253 | if (!line[1] || !strcmp(&line[1], "o")) | 253 | if (!line[1] || !strcmp(&line[1], "o")) |
254 | break; | 254 | break; |
255 | continue; | 255 | continue; |
256 | case 'm': | 256 | case 'm': |
257 | case 'M': | 257 | case 'M': |
258 | newval = mod; | 258 | newval = mod; |
259 | if (!line[1]) | 259 | if (!line[1]) |
260 | break; | 260 | break; |
261 | continue; | 261 | continue; |
262 | case 'y': | 262 | case 'y': |
263 | case 'Y': | 263 | case 'Y': |
264 | newval = yes; | 264 | newval = yes; |
265 | if (!line[1] || !strcmp(&line[1], "es")) | 265 | if (!line[1] || !strcmp(&line[1], "es")) |
266 | break; | 266 | break; |
267 | continue; | 267 | continue; |
268 | case 0: | 268 | case 0: |
269 | newval = oldval; | 269 | newval = oldval; |
270 | break; | 270 | break; |
271 | case '?': | 271 | case '?': |
272 | goto help; | 272 | goto help; |
273 | default: | 273 | default: |
274 | continue; | 274 | continue; |
275 | } | 275 | } |
276 | if (sym_set_tristate_value(sym, newval)) | 276 | if (sym_set_tristate_value(sym, newval)) |
277 | return 0; | 277 | return 0; |
278 | help: | 278 | help: |
279 | printf("\n%s\n", get_help(menu)); | 279 | printf("\n%s\n", get_help(menu)); |
280 | } | 280 | } |
281 | } | 281 | } |
282 | 282 | ||
283 | static int conf_choice(struct menu *menu) | 283 | static int conf_choice(struct menu *menu) |
284 | { | 284 | { |
285 | struct symbol *sym, *def_sym; | 285 | struct symbol *sym, *def_sym; |
286 | struct menu *child; | 286 | struct menu *child; |
287 | int type; | 287 | int type; |
288 | bool is_new; | 288 | bool is_new; |
289 | 289 | ||
290 | sym = menu->sym; | 290 | sym = menu->sym; |
291 | type = sym_get_type(sym); | 291 | type = sym_get_type(sym); |
292 | is_new = !sym_has_value(sym); | 292 | is_new = !sym_has_value(sym); |
293 | if (sym_is_changable(sym)) { | 293 | if (sym_is_changable(sym)) { |
294 | conf_sym(menu); | 294 | conf_sym(menu); |
295 | sym_calc_value(sym); | 295 | sym_calc_value(sym); |
296 | switch (sym_get_tristate_value(sym)) { | 296 | switch (sym_get_tristate_value(sym)) { |
297 | case no: | 297 | case no: |
298 | return 1; | 298 | return 1; |
299 | case mod: | 299 | case mod: |
300 | return 0; | 300 | return 0; |
301 | case yes: | 301 | case yes: |
302 | break; | 302 | break; |
303 | } | 303 | } |
304 | } else { | 304 | } else { |
305 | switch (sym_get_tristate_value(sym)) { | 305 | switch (sym_get_tristate_value(sym)) { |
306 | case no: | 306 | case no: |
307 | return 1; | 307 | return 1; |
308 | case mod: | 308 | case mod: |
309 | printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu)); | 309 | printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu)); |
310 | return 0; | 310 | return 0; |
311 | case yes: | 311 | case yes: |
312 | break; | 312 | break; |
313 | } | 313 | } |
314 | } | 314 | } |
315 | 315 | ||
316 | while (1) { | 316 | while (1) { |
317 | int cnt, def; | 317 | int cnt, def; |
318 | 318 | ||
319 | printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu)); | 319 | printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu)); |
320 | def_sym = sym_get_choice_value(sym); | 320 | def_sym = sym_get_choice_value(sym); |
321 | cnt = def = 0; | 321 | cnt = def = 0; |
322 | line[0] = 0; | 322 | line[0] = 0; |
323 | for (child = menu->list; child; child = child->next) { | 323 | for (child = menu->list; child; child = child->next) { |
324 | if (!menu_is_visible(child)) | 324 | if (!menu_is_visible(child)) |
325 | continue; | 325 | continue; |
326 | if (!child->sym) { | 326 | if (!child->sym) { |
327 | printf("%*c %s\n", indent, '*', menu_get_prompt(child)); | 327 | printf("%*c %s\n", indent, '*', menu_get_prompt(child)); |
328 | continue; | 328 | continue; |
329 | } | 329 | } |
330 | cnt++; | 330 | cnt++; |
331 | if (child->sym == def_sym) { | 331 | if (child->sym == def_sym) { |
332 | def = cnt; | 332 | def = cnt; |
333 | printf("%*c", indent, '>'); | 333 | printf("%*c", indent, '>'); |
334 | } else | 334 | } else |
335 | printf("%*c", indent, ' '); | 335 | printf("%*c", indent, ' '); |
336 | printf(" %d. %s", cnt, menu_get_prompt(child)); | 336 | printf(" %d. %s", cnt, menu_get_prompt(child)); |
337 | if (child->sym->name) | 337 | if (child->sym->name) |
338 | printf(" (%s)", child->sym->name); | 338 | printf(" (%s)", child->sym->name); |
339 | if (!sym_has_value(child->sym)) | 339 | if (!sym_has_value(child->sym)) |
340 | printf(" (NEW)"); | 340 | printf(" (NEW)"); |
341 | printf("\n"); | 341 | printf("\n"); |
342 | } | 342 | } |
343 | printf("%*schoice", indent - 1, ""); | 343 | printf("%*schoice", indent - 1, ""); |
344 | if (cnt == 1) { | 344 | if (cnt == 1) { |
345 | printf("[1]: 1\n"); | 345 | printf("[1]: 1\n"); |
346 | goto conf_childs; | 346 | goto conf_childs; |
347 | } | 347 | } |
348 | printf("[1-%d", cnt); | 348 | printf("[1-%d", cnt); |
349 | if (menu_has_help(menu)) | 349 | if (menu_has_help(menu)) |
350 | printf("?"); | 350 | printf("?"); |
351 | printf("]: "); | 351 | printf("]: "); |
352 | switch (input_mode) { | 352 | switch (input_mode) { |
353 | case ask_new: | 353 | case ask_new: |
354 | case ask_silent: | 354 | case ask_silent: |
355 | if (!is_new) { | 355 | if (!is_new) { |
356 | cnt = def; | 356 | cnt = def; |
357 | printf("%d\n", cnt); | 357 | printf("%d\n", cnt); |
358 | break; | 358 | break; |
359 | } | 359 | } |
360 | check_stdin(); | 360 | check_stdin(); |
361 | case ask_all: | 361 | case ask_all: |
362 | fflush(stdout); | 362 | fflush(stdout); |
363 | fgets(line, 128, stdin); | 363 | fgets(line, 128, stdin); |
364 | strip(line); | 364 | strip(line); |
365 | if (line[0] == '?') { | 365 | if (line[0] == '?') { |
366 | printf("\n%s\n", get_help(menu)); | 366 | printf("\n%s\n", get_help(menu)); |
367 | continue; | 367 | continue; |
368 | } | 368 | } |
369 | if (!line[0]) | 369 | if (!line[0]) |
370 | cnt = def; | 370 | cnt = def; |
371 | else if (isdigit(line[0])) | 371 | else if (isdigit(line[0])) |
372 | cnt = atoi(line); | 372 | cnt = atoi(line); |
373 | else | 373 | else |
374 | continue; | 374 | continue; |
375 | break; | 375 | break; |
376 | case set_random: | 376 | case set_random: |
377 | def = (random() % cnt) + 1; | 377 | def = (random() % cnt) + 1; |
378 | case set_default: | 378 | case set_default: |
379 | case set_yes: | 379 | case set_yes: |
380 | case set_mod: | 380 | case set_mod: |
381 | case set_no: | 381 | case set_no: |
382 | cnt = def; | 382 | cnt = def; |
383 | printf("%d\n", cnt); | 383 | printf("%d\n", cnt); |
384 | break; | 384 | break; |
385 | } | 385 | } |
386 | 386 | ||
387 | conf_childs: | 387 | conf_childs: |
388 | for (child = menu->list; child; child = child->next) { | 388 | for (child = menu->list; child; child = child->next) { |
389 | if (!child->sym || !menu_is_visible(child)) | 389 | if (!child->sym || !menu_is_visible(child)) |
390 | continue; | 390 | continue; |
391 | if (!--cnt) | 391 | if (!--cnt) |
392 | break; | 392 | break; |
393 | } | 393 | } |
394 | if (!child) | 394 | if (!child) |
395 | continue; | 395 | continue; |
396 | if (line[strlen(line) - 1] == '?') { | 396 | if (line[strlen(line) - 1] == '?') { |
397 | printf("\n%s\n", get_help(child)); | 397 | printf("\n%s\n", get_help(child)); |
398 | continue; | 398 | continue; |
399 | } | 399 | } |
400 | sym_set_choice_value(sym, child->sym); | 400 | sym_set_choice_value(sym, child->sym); |
401 | if (child->list) { | 401 | if (child->list) { |
402 | indent += 2; | 402 | indent += 2; |
403 | conf(child->list); | 403 | conf(child->list); |
404 | indent -= 2; | 404 | indent -= 2; |
405 | } | 405 | } |
406 | return 1; | 406 | return 1; |
407 | } | 407 | } |
408 | } | 408 | } |
409 | 409 | ||
410 | static void conf(struct menu *menu) | 410 | static void conf(struct menu *menu) |
411 | { | 411 | { |
412 | struct symbol *sym; | 412 | struct symbol *sym; |
413 | struct property *prop; | 413 | struct property *prop; |
414 | struct menu *child; | 414 | struct menu *child; |
415 | 415 | ||
416 | if (!menu_is_visible(menu)) | 416 | if (!menu_is_visible(menu)) |
417 | return; | 417 | return; |
418 | 418 | ||
419 | sym = menu->sym; | 419 | sym = menu->sym; |
420 | prop = menu->prompt; | 420 | prop = menu->prompt; |
421 | if (prop) { | 421 | if (prop) { |
422 | const char *prompt; | 422 | const char *prompt; |
423 | 423 | ||
424 | switch (prop->type) { | 424 | switch (prop->type) { |
425 | case P_MENU: | 425 | case P_MENU: |
426 | if (input_mode == ask_silent && rootEntry != menu) { | 426 | if (input_mode == ask_silent && rootEntry != menu) { |
427 | check_conf(menu); | 427 | check_conf(menu); |
428 | return; | 428 | return; |
429 | } | 429 | } |
430 | case P_COMMENT: | 430 | case P_COMMENT: |
431 | prompt = menu_get_prompt(menu); | 431 | prompt = menu_get_prompt(menu); |
432 | if (prompt) | 432 | if (prompt) |
433 | printf("%*c\n%*c %s\n%*c\n", | 433 | printf("%*c\n%*c %s\n%*c\n", |
434 | indent, '*', | 434 | indent, '*', |
435 | indent, '*', prompt, | 435 | indent, '*', prompt, |
436 | indent, '*'); | 436 | indent, '*'); |
437 | default: | 437 | default: |
438 | ; | 438 | ; |
439 | } | 439 | } |
440 | } | 440 | } |
441 | 441 | ||
442 | if (!sym) | 442 | if (!sym) |
443 | goto conf_childs; | 443 | goto conf_childs; |
444 | 444 | ||
445 | if (sym_is_choice(sym)) { | 445 | if (sym_is_choice(sym)) { |
446 | conf_choice(menu); | 446 | conf_choice(menu); |
447 | if (sym->curr.tri != mod) | 447 | if (sym->curr.tri != mod) |
448 | return; | 448 | return; |
449 | goto conf_childs; | 449 | goto conf_childs; |
450 | } | 450 | } |
451 | 451 | ||
452 | switch (sym->type) { | 452 | switch (sym->type) { |
453 | case S_INT: | 453 | case S_INT: |
454 | case S_HEX: | 454 | case S_HEX: |
455 | case S_STRING: | 455 | case S_STRING: |
456 | conf_string(menu); | 456 | conf_string(menu); |
457 | break; | 457 | break; |
458 | default: | 458 | default: |
459 | conf_sym(menu); | 459 | conf_sym(menu); |
460 | break; | 460 | break; |
461 | } | 461 | } |
462 | 462 | ||
463 | conf_childs: | 463 | conf_childs: |
464 | if (sym) | 464 | if (sym) |
465 | indent += 2; | 465 | indent += 2; |
466 | for (child = menu->list; child; child = child->next) | 466 | for (child = menu->list; child; child = child->next) |
467 | conf(child); | 467 | conf(child); |
468 | if (sym) | 468 | if (sym) |
469 | indent -= 2; | 469 | indent -= 2; |
470 | } | 470 | } |
471 | 471 | ||
472 | static void check_conf(struct menu *menu) | 472 | static void check_conf(struct menu *menu) |
473 | { | 473 | { |
474 | struct symbol *sym; | 474 | struct symbol *sym; |
475 | struct menu *child; | 475 | struct menu *child; |
476 | 476 | ||
477 | if (!menu_is_visible(menu)) | 477 | if (!menu_is_visible(menu)) |
478 | return; | 478 | return; |
479 | 479 | ||
480 | sym = menu->sym; | 480 | sym = menu->sym; |
481 | if (sym && !sym_has_value(sym)) { | 481 | if (sym && !sym_has_value(sym)) { |
482 | if (sym_is_changable(sym) || | 482 | if (sym_is_changable(sym) || |
483 | (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) { | 483 | (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) { |
484 | if (!conf_cnt++) | 484 | if (!conf_cnt++) |
485 | printf(_("*\n* Restart config...\n*\n")); | 485 | printf(_("*\n* Restart config...\n*\n")); |
486 | rootEntry = menu_get_parent_menu(menu); | 486 | rootEntry = menu_get_parent_menu(menu); |
487 | conf(rootEntry); | 487 | conf(rootEntry); |
488 | } | 488 | } |
489 | } | 489 | } |
490 | 490 | ||
491 | for (child = menu->list; child; child = child->next) | 491 | for (child = menu->list; child; child = child->next) |
492 | check_conf(child); | 492 | check_conf(child); |
493 | } | 493 | } |
494 | 494 | ||
495 | int main(int ac, char **av) | 495 | int main(int ac, char **av) |
496 | { | 496 | { |
497 | int i = 1; | 497 | int i = 1; |
498 | const char *name; | 498 | const char *name; |
499 | struct stat tmpstat; | 499 | struct stat tmpstat; |
500 | 500 | ||
501 | if (ac > i && av[i][0] == '-') { | 501 | if (ac > i && av[i][0] == '-') { |
502 | switch (av[i++][1]) { | 502 | switch (av[i++][1]) { |
503 | case 'o': | 503 | case 'o': |
504 | input_mode = ask_new; | 504 | input_mode = ask_new; |
505 | break; | 505 | break; |
506 | case 's': | 506 | case 's': |
507 | input_mode = ask_silent; | 507 | input_mode = ask_silent; |
508 | valid_stdin = isatty(0) && isatty(1) && isatty(2); | 508 | valid_stdin = isatty(0) && isatty(1) && isatty(2); |
509 | break; | 509 | break; |
510 | case 'd': | 510 | case 'd': |
511 | input_mode = set_default; | 511 | input_mode = set_default; |
512 | break; | 512 | break; |
513 | case 'D': | 513 | case 'D': |
514 | input_mode = set_default; | 514 | input_mode = set_default; |
515 | defconfig_file = av[i++]; | 515 | defconfig_file = av[i++]; |
516 | if (!defconfig_file) { | 516 | if (!defconfig_file) { |
517 | printf(_("%s: No default config file specified\n"), | 517 | printf(_("%s: No default config file specified\n"), |
518 | av[0]); | 518 | av[0]); |
519 | exit(1); | 519 | exit(1); |
520 | } | 520 | } |
521 | break; | 521 | break; |
522 | case 'n': | 522 | case 'n': |
523 | input_mode = set_no; | 523 | input_mode = set_no; |
524 | break; | 524 | break; |
525 | case 'm': | 525 | case 'm': |
526 | input_mode = set_mod; | 526 | input_mode = set_mod; |
527 | break; | 527 | break; |
528 | case 'y': | 528 | case 'y': |
529 | input_mode = set_yes; | 529 | input_mode = set_yes; |
530 | break; | 530 | break; |
531 | case 'r': | 531 | case 'r': |
532 | input_mode = set_random; | 532 | input_mode = set_random; |
533 | srandom(time(NULL)); | 533 | srandom(time(NULL)); |
534 | break; | 534 | break; |
535 | case 'h': | 535 | case 'h': |
536 | case '?': | 536 | case '?': |
537 | fprintf(stderr, "See README for usage info\n"); | 537 | fprintf(stderr, "See README for usage info\n"); |
538 | exit(0); | 538 | exit(0); |
539 | } | 539 | } |
540 | } | 540 | } |
541 | name = av[i]; | 541 | name = av[i]; |
542 | if (!name) { | 542 | if (!name) { |
543 | printf(_("%s: Kconfig file missing\n"), av[0]); | 543 | printf(_("%s: Kconfig file missing\n"), av[0]); |
544 | exit(1); | 544 | exit(1); |
545 | } | 545 | } |
546 | conf_parse(name); | 546 | conf_parse(name); |
547 | //zconfdump(stdout); | 547 | //zconfdump(stdout); |
548 | switch (input_mode) { | 548 | switch (input_mode) { |
549 | case set_default: | 549 | case set_default: |
550 | if (!defconfig_file) | 550 | if (!defconfig_file) |
551 | defconfig_file = conf_get_default_confname(); | 551 | defconfig_file = conf_get_default_confname(); |
552 | if (conf_read(defconfig_file)) { | 552 | if (conf_read(defconfig_file)) { |
553 | printf("***\n" | 553 | printf("***\n" |
554 | "*** Can't find default configuration \"%s\"!\n" | 554 | "*** Can't find default configuration \"%s\"!\n" |
555 | "***\n", defconfig_file); | 555 | "***\n", defconfig_file); |
556 | exit(1); | 556 | exit(1); |
557 | } | 557 | } |
558 | break; | 558 | break; |
559 | case ask_silent: | 559 | case ask_silent: |
560 | if (stat(".config", &tmpstat)) { | 560 | if (stat(".config", &tmpstat)) { |
561 | printf(_("***\n" | 561 | printf(_("***\n" |
562 | "*** You have not yet configured your kernel!\n" | 562 | "*** You have not yet configured your kernel!\n" |
563 | "*** (missing kernel .config file)\n" | 563 | "*** (missing kernel .config file)\n" |
564 | "***\n" | 564 | "***\n" |
565 | "*** Please run some configurator (e.g. \"make oldconfig\" or\n" | 565 | "*** Please run some configurator (e.g. \"make oldconfig\" or\n" |
566 | "*** \"make menuconfig\" or \"make xconfig\").\n" | 566 | "*** \"make menuconfig\" or \"make xconfig\").\n" |
567 | "***\n")); | 567 | "***\n")); |
568 | exit(1); | 568 | exit(1); |
569 | } | 569 | } |
570 | case ask_all: | 570 | case ask_all: |
571 | case ask_new: | 571 | case ask_new: |
572 | conf_read(NULL); | 572 | conf_read(NULL); |
573 | break; | 573 | break; |
574 | case set_no: | 574 | case set_no: |
575 | case set_mod: | 575 | case set_mod: |
576 | case set_yes: | 576 | case set_yes: |
577 | case set_random: | 577 | case set_random: |
578 | name = getenv("KCONFIG_ALLCONFIG"); | 578 | name = getenv("KCONFIG_ALLCONFIG"); |
579 | if (name && !stat(name, &tmpstat)) { | 579 | if (name && !stat(name, &tmpstat)) { |
580 | conf_read_simple(name, S_DEF_USER); | 580 | conf_read_simple(name, S_DEF_USER); |
581 | break; | 581 | break; |
582 | } | 582 | } |
583 | switch (input_mode) { | 583 | switch (input_mode) { |
584 | case set_no: name = "allno.config"; break; | 584 | case set_no: name = "allno.config"; break; |
585 | case set_mod: name = "allmod.config"; break; | 585 | case set_mod: name = "allmod.config"; break; |
586 | case set_yes: name = "allyes.config"; break; | 586 | case set_yes: name = "allyes.config"; break; |
587 | case set_random: name = "allrandom.config"; break; | 587 | case set_random: name = "allrandom.config"; break; |
588 | default: break; | 588 | default: break; |
589 | } | 589 | } |
590 | if (!stat(name, &tmpstat)) | 590 | if (!stat(name, &tmpstat)) |
591 | conf_read_simple(name, S_DEF_USER); | 591 | conf_read_simple(name, S_DEF_USER); |
592 | else if (!stat("all.config", &tmpstat)) | 592 | else if (!stat("all.config", &tmpstat)) |
593 | conf_read_simple("all.config", S_DEF_USER); | 593 | conf_read_simple("all.config", S_DEF_USER); |
594 | conf_set_env_sym("K64BIT", "64BIT", S_DEF_USER); | ||
595 | break; | 594 | break; |
596 | default: | 595 | default: |
597 | break; | 596 | break; |
598 | } | 597 | } |
599 | 598 | ||
600 | if (input_mode != ask_silent) { | 599 | if (input_mode != ask_silent) { |
601 | rootEntry = &rootmenu; | 600 | rootEntry = &rootmenu; |
602 | conf(&rootmenu); | 601 | conf(&rootmenu); |
603 | if (input_mode == ask_all) { | 602 | if (input_mode == ask_all) { |
604 | input_mode = ask_silent; | 603 | input_mode = ask_silent; |
605 | valid_stdin = 1; | 604 | valid_stdin = 1; |
606 | } | 605 | } |
607 | } else if (conf_get_changed()) { | 606 | } else if (conf_get_changed()) { |
608 | name = getenv("KCONFIG_NOSILENTUPDATE"); | 607 | name = getenv("KCONFIG_NOSILENTUPDATE"); |
609 | if (name && *name) { | 608 | if (name && *name) { |
610 | fprintf(stderr, _("\n*** Kernel configuration requires explicit update.\n\n")); | 609 | fprintf(stderr, _("\n*** Kernel configuration requires explicit update.\n\n")); |
611 | return 1; | 610 | return 1; |
612 | } | 611 | } |
613 | } else | 612 | } else |
614 | goto skip_check; | 613 | goto skip_check; |
615 | 614 | ||
616 | do { | 615 | do { |
617 | conf_cnt = 0; | 616 | conf_cnt = 0; |
618 | check_conf(&rootmenu); | 617 | check_conf(&rootmenu); |
619 | } while (conf_cnt); | 618 | } while (conf_cnt); |
620 | if (conf_write(NULL)) { | 619 | if (conf_write(NULL)) { |
621 | fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); | 620 | fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); |
622 | return 1; | 621 | return 1; |
623 | } | 622 | } |
624 | skip_check: | 623 | skip_check: |
625 | if (input_mode == ask_silent && conf_write_autoconf()) { | 624 | if (input_mode == ask_silent && conf_write_autoconf()) { |
626 | fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); | 625 | fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); |
627 | return 1; | 626 | return 1; |
628 | } | 627 | } |
629 | 628 | ||
630 | return 0; | 629 | return 0; |
631 | } | 630 | } |
632 | 631 |
scripts/kconfig/confdata.c
1 | /* | 1 | /* |
2 | * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> | 2 | * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> |
3 | * Released under the terms of the GNU GPL v2.0. | 3 | * Released under the terms of the GNU GPL v2.0. |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include <sys/stat.h> | 6 | #include <sys/stat.h> |
7 | #include <ctype.h> | 7 | #include <ctype.h> |
8 | #include <fcntl.h> | 8 | #include <fcntl.h> |
9 | #include <stdio.h> | 9 | #include <stdio.h> |
10 | #include <stdlib.h> | 10 | #include <stdlib.h> |
11 | #include <string.h> | 11 | #include <string.h> |
12 | #include <time.h> | 12 | #include <time.h> |
13 | #include <unistd.h> | 13 | #include <unistd.h> |
14 | 14 | ||
15 | #define LKC_DIRECT_LINK | 15 | #define LKC_DIRECT_LINK |
16 | #include "lkc.h" | 16 | #include "lkc.h" |
17 | 17 | ||
18 | static void conf_warning(const char *fmt, ...) | 18 | static void conf_warning(const char *fmt, ...) |
19 | __attribute__ ((format (printf, 1, 2))); | 19 | __attribute__ ((format (printf, 1, 2))); |
20 | 20 | ||
21 | static const char *conf_filename; | 21 | static const char *conf_filename; |
22 | static int conf_lineno, conf_warnings, conf_unsaved; | 22 | static int conf_lineno, conf_warnings, conf_unsaved; |
23 | 23 | ||
24 | const char conf_defname[] = "arch/$ARCH/defconfig"; | 24 | const char conf_defname[] = "arch/$ARCH/defconfig"; |
25 | 25 | ||
26 | static void conf_warning(const char *fmt, ...) | 26 | static void conf_warning(const char *fmt, ...) |
27 | { | 27 | { |
28 | va_list ap; | 28 | va_list ap; |
29 | va_start(ap, fmt); | 29 | va_start(ap, fmt); |
30 | fprintf(stderr, "%s:%d:warning: ", conf_filename, conf_lineno); | 30 | fprintf(stderr, "%s:%d:warning: ", conf_filename, conf_lineno); |
31 | vfprintf(stderr, fmt, ap); | 31 | vfprintf(stderr, fmt, ap); |
32 | fprintf(stderr, "\n"); | 32 | fprintf(stderr, "\n"); |
33 | va_end(ap); | 33 | va_end(ap); |
34 | conf_warnings++; | 34 | conf_warnings++; |
35 | } | 35 | } |
36 | 36 | ||
37 | const char *conf_get_configname(void) | 37 | const char *conf_get_configname(void) |
38 | { | 38 | { |
39 | char *name = getenv("KCONFIG_CONFIG"); | 39 | char *name = getenv("KCONFIG_CONFIG"); |
40 | 40 | ||
41 | return name ? name : ".config"; | 41 | return name ? name : ".config"; |
42 | } | 42 | } |
43 | 43 | ||
44 | static char *conf_expand_value(const char *in) | 44 | static char *conf_expand_value(const char *in) |
45 | { | 45 | { |
46 | struct symbol *sym; | 46 | struct symbol *sym; |
47 | const char *src; | 47 | const char *src; |
48 | static char res_value[SYMBOL_MAXLENGTH]; | 48 | static char res_value[SYMBOL_MAXLENGTH]; |
49 | char *dst, name[SYMBOL_MAXLENGTH]; | 49 | char *dst, name[SYMBOL_MAXLENGTH]; |
50 | 50 | ||
51 | res_value[0] = 0; | 51 | res_value[0] = 0; |
52 | dst = name; | 52 | dst = name; |
53 | while ((src = strchr(in, '$'))) { | 53 | while ((src = strchr(in, '$'))) { |
54 | strncat(res_value, in, src - in); | 54 | strncat(res_value, in, src - in); |
55 | src++; | 55 | src++; |
56 | dst = name; | 56 | dst = name; |
57 | while (isalnum(*src) || *src == '_') | 57 | while (isalnum(*src) || *src == '_') |
58 | *dst++ = *src++; | 58 | *dst++ = *src++; |
59 | *dst = 0; | 59 | *dst = 0; |
60 | sym = sym_lookup(name, 0); | 60 | sym = sym_lookup(name, 0); |
61 | sym_calc_value(sym); | 61 | sym_calc_value(sym); |
62 | strcat(res_value, sym_get_string_value(sym)); | 62 | strcat(res_value, sym_get_string_value(sym)); |
63 | in = src; | 63 | in = src; |
64 | } | 64 | } |
65 | strcat(res_value, in); | 65 | strcat(res_value, in); |
66 | 66 | ||
67 | return res_value; | 67 | return res_value; |
68 | } | 68 | } |
69 | 69 | ||
70 | char *conf_get_default_confname(void) | 70 | char *conf_get_default_confname(void) |
71 | { | 71 | { |
72 | struct stat buf; | 72 | struct stat buf; |
73 | static char fullname[PATH_MAX+1]; | 73 | static char fullname[PATH_MAX+1]; |
74 | char *env, *name; | 74 | char *env, *name; |
75 | 75 | ||
76 | name = conf_expand_value(conf_defname); | 76 | name = conf_expand_value(conf_defname); |
77 | env = getenv(SRCTREE); | 77 | env = getenv(SRCTREE); |
78 | if (env) { | 78 | if (env) { |
79 | sprintf(fullname, "%s/%s", env, name); | 79 | sprintf(fullname, "%s/%s", env, name); |
80 | if (!stat(fullname, &buf)) | 80 | if (!stat(fullname, &buf)) |
81 | return fullname; | 81 | return fullname; |
82 | } | 82 | } |
83 | return name; | 83 | return name; |
84 | } | 84 | } |
85 | 85 | ||
86 | static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) | 86 | static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) |
87 | { | 87 | { |
88 | char *p2; | 88 | char *p2; |
89 | 89 | ||
90 | switch (sym->type) { | 90 | switch (sym->type) { |
91 | case S_TRISTATE: | 91 | case S_TRISTATE: |
92 | if (p[0] == 'm') { | 92 | if (p[0] == 'm') { |
93 | sym->def[def].tri = mod; | 93 | sym->def[def].tri = mod; |
94 | sym->flags |= def_flags; | 94 | sym->flags |= def_flags; |
95 | break; | 95 | break; |
96 | } | 96 | } |
97 | case S_BOOLEAN: | 97 | case S_BOOLEAN: |
98 | if (p[0] == 'y') { | 98 | if (p[0] == 'y') { |
99 | sym->def[def].tri = yes; | 99 | sym->def[def].tri = yes; |
100 | sym->flags |= def_flags; | 100 | sym->flags |= def_flags; |
101 | break; | 101 | break; |
102 | } | 102 | } |
103 | if (p[0] == 'n') { | 103 | if (p[0] == 'n') { |
104 | sym->def[def].tri = no; | 104 | sym->def[def].tri = no; |
105 | sym->flags |= def_flags; | 105 | sym->flags |= def_flags; |
106 | break; | 106 | break; |
107 | } | 107 | } |
108 | conf_warning("symbol value '%s' invalid for %s", p, sym->name); | 108 | conf_warning("symbol value '%s' invalid for %s", p, sym->name); |
109 | break; | 109 | break; |
110 | case S_OTHER: | 110 | case S_OTHER: |
111 | if (*p != '"') { | 111 | if (*p != '"') { |
112 | for (p2 = p; *p2 && !isspace(*p2); p2++) | 112 | for (p2 = p; *p2 && !isspace(*p2); p2++) |
113 | ; | 113 | ; |
114 | sym->type = S_STRING; | 114 | sym->type = S_STRING; |
115 | goto done; | 115 | goto done; |
116 | } | 116 | } |
117 | case S_STRING: | 117 | case S_STRING: |
118 | if (*p++ != '"') | 118 | if (*p++ != '"') |
119 | break; | 119 | break; |
120 | for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) { | 120 | for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) { |
121 | if (*p2 == '"') { | 121 | if (*p2 == '"') { |
122 | *p2 = 0; | 122 | *p2 = 0; |
123 | break; | 123 | break; |
124 | } | 124 | } |
125 | memmove(p2, p2 + 1, strlen(p2)); | 125 | memmove(p2, p2 + 1, strlen(p2)); |
126 | } | 126 | } |
127 | if (!p2) { | 127 | if (!p2) { |
128 | conf_warning("invalid string found"); | 128 | conf_warning("invalid string found"); |
129 | return 1; | 129 | return 1; |
130 | } | 130 | } |
131 | case S_INT: | 131 | case S_INT: |
132 | case S_HEX: | 132 | case S_HEX: |
133 | done: | 133 | done: |
134 | if (sym_string_valid(sym, p)) { | 134 | if (sym_string_valid(sym, p)) { |
135 | sym->def[def].val = strdup(p); | 135 | sym->def[def].val = strdup(p); |
136 | sym->flags |= def_flags; | 136 | sym->flags |= def_flags; |
137 | } else { | 137 | } else { |
138 | conf_warning("symbol value '%s' invalid for %s", p, sym->name); | 138 | conf_warning("symbol value '%s' invalid for %s", p, sym->name); |
139 | return 1; | 139 | return 1; |
140 | } | 140 | } |
141 | break; | 141 | break; |
142 | default: | 142 | default: |
143 | ; | 143 | ; |
144 | } | 144 | } |
145 | return 0; | 145 | return 0; |
146 | } | 146 | } |
147 | 147 | ||
148 | /* Read an environment variable and assign the value to the symbol */ | ||
149 | int conf_set_env_sym(const char *env, const char *symname, int def) | ||
150 | { | ||
151 | struct symbol *sym; | ||
152 | char *p; | ||
153 | int def_flags; | ||
154 | |||
155 | p = getenv(env); | ||
156 | if (p) { | ||
157 | char warning[200]; | ||
158 | sprintf(warning, "Environment variable (%s = \"%s\")", env, p); | ||
159 | conf_filename = warning; | ||
160 | def_flags = SYMBOL_DEF << def; | ||
161 | if (def == S_DEF_USER) { | ||
162 | sym = sym_find(symname); | ||
163 | if (!sym) | ||
164 | return 1; | ||
165 | } else { | ||
166 | sym = sym_lookup(symname, 0); | ||
167 | if (sym->type == S_UNKNOWN) | ||
168 | sym->type = S_OTHER; | ||
169 | } | ||
170 | conf_set_sym_val(sym, def, def_flags, p); | ||
171 | } | ||
172 | return 0; | ||
173 | } | ||
174 | |||
175 | int conf_read_simple(const char *name, int def) | 148 | int conf_read_simple(const char *name, int def) |
176 | { | 149 | { |
177 | FILE *in = NULL; | 150 | FILE *in = NULL; |
178 | char line[1024]; | 151 | char line[1024]; |
179 | char *p, *p2; | 152 | char *p, *p2; |
180 | struct symbol *sym; | 153 | struct symbol *sym; |
181 | int i, def_flags; | 154 | int i, def_flags; |
182 | 155 | ||
183 | if (name) { | 156 | if (name) { |
184 | in = zconf_fopen(name); | 157 | in = zconf_fopen(name); |
185 | } else { | 158 | } else { |
186 | struct property *prop; | 159 | struct property *prop; |
187 | 160 | ||
188 | name = conf_get_configname(); | 161 | name = conf_get_configname(); |
189 | in = zconf_fopen(name); | 162 | in = zconf_fopen(name); |
190 | if (in) | 163 | if (in) |
191 | goto load; | 164 | goto load; |
192 | sym_add_change_count(1); | 165 | sym_add_change_count(1); |
193 | if (!sym_defconfig_list) | 166 | if (!sym_defconfig_list) |
194 | return 1; | 167 | return 1; |
195 | 168 | ||
196 | for_all_defaults(sym_defconfig_list, prop) { | 169 | for_all_defaults(sym_defconfig_list, prop) { |
197 | if (expr_calc_value(prop->visible.expr) == no || | 170 | if (expr_calc_value(prop->visible.expr) == no || |
198 | prop->expr->type != E_SYMBOL) | 171 | prop->expr->type != E_SYMBOL) |
199 | continue; | 172 | continue; |
200 | name = conf_expand_value(prop->expr->left.sym->name); | 173 | name = conf_expand_value(prop->expr->left.sym->name); |
201 | in = zconf_fopen(name); | 174 | in = zconf_fopen(name); |
202 | if (in) { | 175 | if (in) { |
203 | printf(_("#\n" | 176 | printf(_("#\n" |
204 | "# using defaults found in %s\n" | 177 | "# using defaults found in %s\n" |
205 | "#\n"), name); | 178 | "#\n"), name); |
206 | goto load; | 179 | goto load; |
207 | } | 180 | } |
208 | } | 181 | } |
209 | } | 182 | } |
210 | if (!in) | 183 | if (!in) |
211 | return 1; | 184 | return 1; |
212 | 185 | ||
213 | load: | 186 | load: |
214 | conf_filename = name; | 187 | conf_filename = name; |
215 | conf_lineno = 0; | 188 | conf_lineno = 0; |
216 | conf_warnings = 0; | 189 | conf_warnings = 0; |
217 | conf_unsaved = 0; | 190 | conf_unsaved = 0; |
218 | 191 | ||
219 | def_flags = SYMBOL_DEF << def; | 192 | def_flags = SYMBOL_DEF << def; |
220 | for_all_symbols(i, sym) { | 193 | for_all_symbols(i, sym) { |
221 | sym->flags |= SYMBOL_CHANGED; | 194 | sym->flags |= SYMBOL_CHANGED; |
222 | sym->flags &= ~(def_flags|SYMBOL_VALID); | 195 | sym->flags &= ~(def_flags|SYMBOL_VALID); |
223 | if (sym_is_choice(sym)) | 196 | if (sym_is_choice(sym)) |
224 | sym->flags |= def_flags; | 197 | sym->flags |= def_flags; |
225 | switch (sym->type) { | 198 | switch (sym->type) { |
226 | case S_INT: | 199 | case S_INT: |
227 | case S_HEX: | 200 | case S_HEX: |
228 | case S_STRING: | 201 | case S_STRING: |
229 | if (sym->def[def].val) | 202 | if (sym->def[def].val) |
230 | free(sym->def[def].val); | 203 | free(sym->def[def].val); |
231 | default: | 204 | default: |
232 | sym->def[def].val = NULL; | 205 | sym->def[def].val = NULL; |
233 | sym->def[def].tri = no; | 206 | sym->def[def].tri = no; |
234 | } | 207 | } |
235 | } | 208 | } |
236 | 209 | ||
237 | while (fgets(line, sizeof(line), in)) { | 210 | while (fgets(line, sizeof(line), in)) { |
238 | conf_lineno++; | 211 | conf_lineno++; |
239 | sym = NULL; | 212 | sym = NULL; |
240 | switch (line[0]) { | 213 | switch (line[0]) { |
241 | case '#': | 214 | case '#': |
242 | if (memcmp(line + 2, "CONFIG_", 7)) | 215 | if (memcmp(line + 2, "CONFIG_", 7)) |
243 | continue; | 216 | continue; |
244 | p = strchr(line + 9, ' '); | 217 | p = strchr(line + 9, ' '); |
245 | if (!p) | 218 | if (!p) |
246 | continue; | 219 | continue; |
247 | *p++ = 0; | 220 | *p++ = 0; |
248 | if (strncmp(p, "is not set", 10)) | 221 | if (strncmp(p, "is not set", 10)) |
249 | continue; | 222 | continue; |
250 | if (def == S_DEF_USER) { | 223 | if (def == S_DEF_USER) { |
251 | sym = sym_find(line + 9); | 224 | sym = sym_find(line + 9); |
252 | if (!sym) { | 225 | if (!sym) { |
253 | conf_warning("trying to assign nonexistent symbol %s", line + 9); | 226 | conf_warning("trying to assign nonexistent symbol %s", line + 9); |
254 | break; | 227 | break; |
255 | } | 228 | } |
256 | } else { | 229 | } else { |
257 | sym = sym_lookup(line + 9, 0); | 230 | sym = sym_lookup(line + 9, 0); |
258 | if (sym->type == S_UNKNOWN) | 231 | if (sym->type == S_UNKNOWN) |
259 | sym->type = S_BOOLEAN; | 232 | sym->type = S_BOOLEAN; |
260 | } | 233 | } |
261 | if (sym->flags & def_flags) { | 234 | if (sym->flags & def_flags) { |
262 | conf_warning("trying to reassign symbol %s", sym->name); | 235 | conf_warning("trying to reassign symbol %s", sym->name); |
263 | break; | 236 | break; |
264 | } | 237 | } |
265 | switch (sym->type) { | 238 | switch (sym->type) { |
266 | case S_BOOLEAN: | 239 | case S_BOOLEAN: |
267 | case S_TRISTATE: | 240 | case S_TRISTATE: |
268 | sym->def[def].tri = no; | 241 | sym->def[def].tri = no; |
269 | sym->flags |= def_flags; | 242 | sym->flags |= def_flags; |
270 | break; | 243 | break; |
271 | default: | 244 | default: |
272 | ; | 245 | ; |
273 | } | 246 | } |
274 | break; | 247 | break; |
275 | case 'C': | 248 | case 'C': |
276 | if (memcmp(line, "CONFIG_", 7)) { | 249 | if (memcmp(line, "CONFIG_", 7)) { |
277 | conf_warning("unexpected data"); | 250 | conf_warning("unexpected data"); |
278 | continue; | 251 | continue; |
279 | } | 252 | } |
280 | p = strchr(line + 7, '='); | 253 | p = strchr(line + 7, '='); |
281 | if (!p) | 254 | if (!p) |
282 | continue; | 255 | continue; |
283 | *p++ = 0; | 256 | *p++ = 0; |
284 | p2 = strchr(p, '\n'); | 257 | p2 = strchr(p, '\n'); |
285 | if (p2) { | 258 | if (p2) { |
286 | *p2-- = 0; | 259 | *p2-- = 0; |
287 | if (*p2 == '\r') | 260 | if (*p2 == '\r') |
288 | *p2 = 0; | 261 | *p2 = 0; |
289 | } | 262 | } |
290 | if (def == S_DEF_USER) { | 263 | if (def == S_DEF_USER) { |
291 | sym = sym_find(line + 7); | 264 | sym = sym_find(line + 7); |
292 | if (!sym) { | 265 | if (!sym) { |
293 | conf_warning("trying to assign nonexistent symbol %s", line + 7); | 266 | conf_warning("trying to assign nonexistent symbol %s", line + 7); |
294 | break; | 267 | break; |
295 | } | 268 | } |
296 | } else { | 269 | } else { |
297 | sym = sym_lookup(line + 7, 0); | 270 | sym = sym_lookup(line + 7, 0); |
298 | if (sym->type == S_UNKNOWN) | 271 | if (sym->type == S_UNKNOWN) |
299 | sym->type = S_OTHER; | 272 | sym->type = S_OTHER; |
300 | } | 273 | } |
301 | if (sym->flags & def_flags) { | 274 | if (sym->flags & def_flags) { |
302 | conf_warning("trying to reassign symbol %s", sym->name); | 275 | conf_warning("trying to reassign symbol %s", sym->name); |
303 | break; | 276 | break; |
304 | } | 277 | } |
305 | if (conf_set_sym_val(sym, def, def_flags, p)) | 278 | if (conf_set_sym_val(sym, def, def_flags, p)) |
306 | continue; | 279 | continue; |
307 | break; | 280 | break; |
308 | case '\r': | 281 | case '\r': |
309 | case '\n': | 282 | case '\n': |
310 | break; | 283 | break; |
311 | default: | 284 | default: |
312 | conf_warning("unexpected data"); | 285 | conf_warning("unexpected data"); |
313 | continue; | 286 | continue; |
314 | } | 287 | } |
315 | if (sym && sym_is_choice_value(sym)) { | 288 | if (sym && sym_is_choice_value(sym)) { |
316 | struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym)); | 289 | struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym)); |
317 | switch (sym->def[def].tri) { | 290 | switch (sym->def[def].tri) { |
318 | case no: | 291 | case no: |
319 | break; | 292 | break; |
320 | case mod: | 293 | case mod: |
321 | if (cs->def[def].tri == yes) { | 294 | if (cs->def[def].tri == yes) { |
322 | conf_warning("%s creates inconsistent choice state", sym->name); | 295 | conf_warning("%s creates inconsistent choice state", sym->name); |
323 | cs->flags &= ~def_flags; | 296 | cs->flags &= ~def_flags; |
324 | } | 297 | } |
325 | break; | 298 | break; |
326 | case yes: | 299 | case yes: |
327 | if (cs->def[def].tri != no) { | 300 | if (cs->def[def].tri != no) { |
328 | conf_warning("%s creates inconsistent choice state", sym->name); | 301 | conf_warning("%s creates inconsistent choice state", sym->name); |
329 | cs->flags &= ~def_flags; | 302 | cs->flags &= ~def_flags; |
330 | } else | 303 | } else |
331 | cs->def[def].val = sym; | 304 | cs->def[def].val = sym; |
332 | break; | 305 | break; |
333 | } | 306 | } |
334 | cs->def[def].tri = E_OR(cs->def[def].tri, sym->def[def].tri); | 307 | cs->def[def].tri = E_OR(cs->def[def].tri, sym->def[def].tri); |
335 | } | 308 | } |
336 | } | 309 | } |
337 | fclose(in); | 310 | fclose(in); |
338 | 311 | ||
339 | if (modules_sym) | 312 | if (modules_sym) |
340 | sym_calc_value(modules_sym); | 313 | sym_calc_value(modules_sym); |
341 | return 0; | 314 | return 0; |
342 | } | 315 | } |
343 | 316 | ||
344 | int conf_read(const char *name) | 317 | int conf_read(const char *name) |
345 | { | 318 | { |
346 | struct symbol *sym; | 319 | struct symbol *sym; |
347 | struct property *prop; | 320 | struct property *prop; |
348 | struct expr *e; | 321 | struct expr *e; |
349 | int i, flags; | 322 | int i, flags; |
350 | 323 | ||
351 | sym_set_change_count(0); | 324 | sym_set_change_count(0); |
352 | 325 | ||
353 | if (conf_read_simple(name, S_DEF_USER)) | 326 | if (conf_read_simple(name, S_DEF_USER)) |
354 | return 1; | 327 | return 1; |
355 | 328 | ||
356 | for_all_symbols(i, sym) { | 329 | for_all_symbols(i, sym) { |
357 | sym_calc_value(sym); | 330 | sym_calc_value(sym); |
358 | if (sym_is_choice(sym) || (sym->flags & SYMBOL_AUTO)) | 331 | if (sym_is_choice(sym) || (sym->flags & SYMBOL_AUTO)) |
359 | goto sym_ok; | 332 | goto sym_ok; |
360 | if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) { | 333 | if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) { |
361 | /* check that calculated value agrees with saved value */ | 334 | /* check that calculated value agrees with saved value */ |
362 | switch (sym->type) { | 335 | switch (sym->type) { |
363 | case S_BOOLEAN: | 336 | case S_BOOLEAN: |
364 | case S_TRISTATE: | 337 | case S_TRISTATE: |
365 | if (sym->def[S_DEF_USER].tri != sym_get_tristate_value(sym)) | 338 | if (sym->def[S_DEF_USER].tri != sym_get_tristate_value(sym)) |
366 | break; | 339 | break; |
367 | if (!sym_is_choice(sym)) | 340 | if (!sym_is_choice(sym)) |
368 | goto sym_ok; | 341 | goto sym_ok; |
369 | default: | 342 | default: |
370 | if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val)) | 343 | if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val)) |
371 | goto sym_ok; | 344 | goto sym_ok; |
372 | break; | 345 | break; |
373 | } | 346 | } |
374 | } else if (!sym_has_value(sym) && !(sym->flags & SYMBOL_WRITE)) | 347 | } else if (!sym_has_value(sym) && !(sym->flags & SYMBOL_WRITE)) |
375 | /* no previous value and not saved */ | 348 | /* no previous value and not saved */ |
376 | goto sym_ok; | 349 | goto sym_ok; |
377 | conf_unsaved++; | 350 | conf_unsaved++; |
378 | /* maybe print value in verbose mode... */ | 351 | /* maybe print value in verbose mode... */ |
379 | sym_ok: | 352 | sym_ok: |
380 | if (!sym_is_choice(sym)) | 353 | if (!sym_is_choice(sym)) |
381 | continue; | 354 | continue; |
382 | /* The choice symbol only has a set value (and thus is not new) | 355 | /* The choice symbol only has a set value (and thus is not new) |
383 | * if all its visible childs have values. | 356 | * if all its visible childs have values. |
384 | */ | 357 | */ |
385 | prop = sym_get_choice_prop(sym); | 358 | prop = sym_get_choice_prop(sym); |
386 | flags = sym->flags; | 359 | flags = sym->flags; |
387 | for (e = prop->expr; e; e = e->left.expr) | 360 | for (e = prop->expr; e; e = e->left.expr) |
388 | if (e->right.sym->visible != no) | 361 | if (e->right.sym->visible != no) |
389 | flags &= e->right.sym->flags; | 362 | flags &= e->right.sym->flags; |
390 | sym->flags &= flags | ~SYMBOL_DEF_USER; | 363 | sym->flags &= flags | ~SYMBOL_DEF_USER; |
391 | } | 364 | } |
392 | 365 | ||
393 | for_all_symbols(i, sym) { | 366 | for_all_symbols(i, sym) { |
394 | if (sym_has_value(sym) && !sym_is_choice_value(sym)) { | 367 | if (sym_has_value(sym) && !sym_is_choice_value(sym)) { |
395 | /* Reset values of generates values, so they'll appear | 368 | /* Reset values of generates values, so they'll appear |
396 | * as new, if they should become visible, but that | 369 | * as new, if they should become visible, but that |
397 | * doesn't quite work if the Kconfig and the saved | 370 | * doesn't quite work if the Kconfig and the saved |
398 | * configuration disagree. | 371 | * configuration disagree. |
399 | */ | 372 | */ |
400 | if (sym->visible == no && !conf_unsaved) | 373 | if (sym->visible == no && !conf_unsaved) |
401 | sym->flags &= ~SYMBOL_DEF_USER; | 374 | sym->flags &= ~SYMBOL_DEF_USER; |
402 | switch (sym->type) { | 375 | switch (sym->type) { |
403 | case S_STRING: | 376 | case S_STRING: |
404 | case S_INT: | 377 | case S_INT: |
405 | case S_HEX: | 378 | case S_HEX: |
406 | /* Reset a string value if it's out of range */ | 379 | /* Reset a string value if it's out of range */ |
407 | if (sym_string_within_range(sym, sym->def[S_DEF_USER].val)) | 380 | if (sym_string_within_range(sym, sym->def[S_DEF_USER].val)) |
408 | break; | 381 | break; |
409 | sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER); | 382 | sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER); |
410 | conf_unsaved++; | 383 | conf_unsaved++; |
411 | break; | 384 | break; |
412 | default: | 385 | default: |
413 | break; | 386 | break; |
414 | } | 387 | } |
415 | } | 388 | } |
416 | } | 389 | } |
417 | 390 | ||
418 | sym_add_change_count(conf_warnings || conf_unsaved); | 391 | sym_add_change_count(conf_warnings || conf_unsaved); |
419 | 392 | ||
420 | return 0; | 393 | return 0; |
421 | } | 394 | } |
422 | 395 | ||
423 | int conf_write(const char *name) | 396 | int conf_write(const char *name) |
424 | { | 397 | { |
425 | FILE *out; | 398 | FILE *out; |
426 | struct symbol *sym; | 399 | struct symbol *sym; |
427 | struct menu *menu; | 400 | struct menu *menu; |
428 | const char *basename; | 401 | const char *basename; |
429 | char dirname[128], tmpname[128], newname[128]; | 402 | char dirname[128], tmpname[128], newname[128]; |
430 | int type, l; | 403 | int type, l; |
431 | const char *str; | 404 | const char *str; |
432 | time_t now; | 405 | time_t now; |
433 | int use_timestamp = 1; | 406 | int use_timestamp = 1; |
434 | char *env; | 407 | char *env; |
435 | 408 | ||
436 | dirname[0] = 0; | 409 | dirname[0] = 0; |
437 | if (name && name[0]) { | 410 | if (name && name[0]) { |
438 | struct stat st; | 411 | struct stat st; |
439 | char *slash; | 412 | char *slash; |
440 | 413 | ||
441 | if (!stat(name, &st) && S_ISDIR(st.st_mode)) { | 414 | if (!stat(name, &st) && S_ISDIR(st.st_mode)) { |
442 | strcpy(dirname, name); | 415 | strcpy(dirname, name); |
443 | strcat(dirname, "/"); | 416 | strcat(dirname, "/"); |
444 | basename = conf_get_configname(); | 417 | basename = conf_get_configname(); |
445 | } else if ((slash = strrchr(name, '/'))) { | 418 | } else if ((slash = strrchr(name, '/'))) { |
446 | int size = slash - name + 1; | 419 | int size = slash - name + 1; |
447 | memcpy(dirname, name, size); | 420 | memcpy(dirname, name, size); |
448 | dirname[size] = 0; | 421 | dirname[size] = 0; |
449 | if (slash[1]) | 422 | if (slash[1]) |
450 | basename = slash + 1; | 423 | basename = slash + 1; |
451 | else | 424 | else |
452 | basename = conf_get_configname(); | 425 | basename = conf_get_configname(); |
453 | } else | 426 | } else |
454 | basename = name; | 427 | basename = name; |
455 | } else | 428 | } else |
456 | basename = conf_get_configname(); | 429 | basename = conf_get_configname(); |
457 | 430 | ||
458 | sprintf(newname, "%s%s", dirname, basename); | 431 | sprintf(newname, "%s%s", dirname, basename); |
459 | env = getenv("KCONFIG_OVERWRITECONFIG"); | 432 | env = getenv("KCONFIG_OVERWRITECONFIG"); |
460 | if (!env || !*env) { | 433 | if (!env || !*env) { |
461 | sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid()); | 434 | sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid()); |
462 | out = fopen(tmpname, "w"); | 435 | out = fopen(tmpname, "w"); |
463 | } else { | 436 | } else { |
464 | *tmpname = 0; | 437 | *tmpname = 0; |
465 | out = fopen(newname, "w"); | 438 | out = fopen(newname, "w"); |
466 | } | 439 | } |
467 | if (!out) | 440 | if (!out) |
468 | return 1; | 441 | return 1; |
469 | 442 | ||
470 | sym = sym_lookup("KERNELVERSION", 0); | 443 | sym = sym_lookup("KERNELVERSION", 0); |
471 | sym_calc_value(sym); | 444 | sym_calc_value(sym); |
472 | time(&now); | 445 | time(&now); |
473 | env = getenv("KCONFIG_NOTIMESTAMP"); | 446 | env = getenv("KCONFIG_NOTIMESTAMP"); |
474 | if (env && *env) | 447 | if (env && *env) |
475 | use_timestamp = 0; | 448 | use_timestamp = 0; |
476 | 449 | ||
477 | fprintf(out, _("#\n" | 450 | fprintf(out, _("#\n" |
478 | "# Automatically generated make config: don't edit\n" | 451 | "# Automatically generated make config: don't edit\n" |
479 | "# Linux kernel version: %s\n" | 452 | "# Linux kernel version: %s\n" |
480 | "%s%s" | 453 | "%s%s" |
481 | "#\n"), | 454 | "#\n"), |
482 | sym_get_string_value(sym), | 455 | sym_get_string_value(sym), |
483 | use_timestamp ? "# " : "", | 456 | use_timestamp ? "# " : "", |
484 | use_timestamp ? ctime(&now) : ""); | 457 | use_timestamp ? ctime(&now) : ""); |
485 | 458 | ||
486 | if (!conf_get_changed()) | 459 | if (!conf_get_changed()) |
487 | sym_clear_all_valid(); | 460 | sym_clear_all_valid(); |
488 | 461 | ||
489 | menu = rootmenu.list; | 462 | menu = rootmenu.list; |
490 | while (menu) { | 463 | while (menu) { |
491 | sym = menu->sym; | 464 | sym = menu->sym; |
492 | if (!sym) { | 465 | if (!sym) { |
493 | if (!menu_is_visible(menu)) | 466 | if (!menu_is_visible(menu)) |
494 | goto next; | 467 | goto next; |
495 | str = menu_get_prompt(menu); | 468 | str = menu_get_prompt(menu); |
496 | fprintf(out, "\n" | 469 | fprintf(out, "\n" |
497 | "#\n" | 470 | "#\n" |
498 | "# %s\n" | 471 | "# %s\n" |
499 | "#\n", str); | 472 | "#\n", str); |
500 | } else if (!(sym->flags & SYMBOL_CHOICE)) { | 473 | } else if (!(sym->flags & SYMBOL_CHOICE)) { |
501 | sym_calc_value(sym); | 474 | sym_calc_value(sym); |
502 | if (!(sym->flags & SYMBOL_WRITE)) | 475 | if (!(sym->flags & SYMBOL_WRITE)) |
503 | goto next; | 476 | goto next; |
504 | sym->flags &= ~SYMBOL_WRITE; | 477 | sym->flags &= ~SYMBOL_WRITE; |
505 | type = sym->type; | 478 | type = sym->type; |
506 | if (type == S_TRISTATE) { | 479 | if (type == S_TRISTATE) { |
507 | sym_calc_value(modules_sym); | 480 | sym_calc_value(modules_sym); |
508 | if (modules_sym->curr.tri == no) | 481 | if (modules_sym->curr.tri == no) |
509 | type = S_BOOLEAN; | 482 | type = S_BOOLEAN; |
510 | } | 483 | } |
511 | switch (type) { | 484 | switch (type) { |
512 | case S_BOOLEAN: | 485 | case S_BOOLEAN: |
513 | case S_TRISTATE: | 486 | case S_TRISTATE: |
514 | switch (sym_get_tristate_value(sym)) { | 487 | switch (sym_get_tristate_value(sym)) { |
515 | case no: | 488 | case no: |
516 | fprintf(out, "# CONFIG_%s is not set\n", sym->name); | 489 | fprintf(out, "# CONFIG_%s is not set\n", sym->name); |
517 | break; | 490 | break; |
518 | case mod: | 491 | case mod: |
519 | fprintf(out, "CONFIG_%s=m\n", sym->name); | 492 | fprintf(out, "CONFIG_%s=m\n", sym->name); |
520 | break; | 493 | break; |
521 | case yes: | 494 | case yes: |
522 | fprintf(out, "CONFIG_%s=y\n", sym->name); | 495 | fprintf(out, "CONFIG_%s=y\n", sym->name); |
523 | break; | 496 | break; |
524 | } | 497 | } |
525 | break; | 498 | break; |
526 | case S_STRING: | 499 | case S_STRING: |
527 | str = sym_get_string_value(sym); | 500 | str = sym_get_string_value(sym); |
528 | fprintf(out, "CONFIG_%s=\"", sym->name); | 501 | fprintf(out, "CONFIG_%s=\"", sym->name); |
529 | while (1) { | 502 | while (1) { |
530 | l = strcspn(str, "\"\\"); | 503 | l = strcspn(str, "\"\\"); |
531 | if (l) { | 504 | if (l) { |
532 | fwrite(str, l, 1, out); | 505 | fwrite(str, l, 1, out); |
533 | str += l; | 506 | str += l; |
534 | } | 507 | } |
535 | if (!*str) | 508 | if (!*str) |
536 | break; | 509 | break; |
537 | fprintf(out, "\\%c", *str++); | 510 | fprintf(out, "\\%c", *str++); |
538 | } | 511 | } |
539 | fputs("\"\n", out); | 512 | fputs("\"\n", out); |
540 | break; | 513 | break; |
541 | case S_HEX: | 514 | case S_HEX: |
542 | str = sym_get_string_value(sym); | 515 | str = sym_get_string_value(sym); |
543 | if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { | 516 | if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { |
544 | fprintf(out, "CONFIG_%s=%s\n", sym->name, str); | 517 | fprintf(out, "CONFIG_%s=%s\n", sym->name, str); |
545 | break; | 518 | break; |
546 | } | 519 | } |
547 | case S_INT: | 520 | case S_INT: |
548 | str = sym_get_string_value(sym); | 521 | str = sym_get_string_value(sym); |
549 | fprintf(out, "CONFIG_%s=%s\n", sym->name, str); | 522 | fprintf(out, "CONFIG_%s=%s\n", sym->name, str); |
550 | break; | 523 | break; |
551 | } | 524 | } |
552 | } | 525 | } |
553 | 526 | ||
554 | next: | 527 | next: |
555 | if (menu->list) { | 528 | if (menu->list) { |
556 | menu = menu->list; | 529 | menu = menu->list; |
557 | continue; | 530 | continue; |
558 | } | 531 | } |
559 | if (menu->next) | 532 | if (menu->next) |
560 | menu = menu->next; | 533 | menu = menu->next; |
561 | else while ((menu = menu->parent)) { | 534 | else while ((menu = menu->parent)) { |
562 | if (menu->next) { | 535 | if (menu->next) { |
563 | menu = menu->next; | 536 | menu = menu->next; |
564 | break; | 537 | break; |
565 | } | 538 | } |
566 | } | 539 | } |
567 | } | 540 | } |
568 | fclose(out); | 541 | fclose(out); |
569 | 542 | ||
570 | if (*tmpname) { | 543 | if (*tmpname) { |
571 | strcat(dirname, basename); | 544 | strcat(dirname, basename); |
572 | strcat(dirname, ".old"); | 545 | strcat(dirname, ".old"); |
573 | rename(newname, dirname); | 546 | rename(newname, dirname); |
574 | if (rename(tmpname, newname)) | 547 | if (rename(tmpname, newname)) |
575 | return 1; | 548 | return 1; |
576 | } | 549 | } |
577 | 550 | ||
578 | printf(_("#\n" | 551 | printf(_("#\n" |
579 | "# configuration written to %s\n" | 552 | "# configuration written to %s\n" |
580 | "#\n"), newname); | 553 | "#\n"), newname); |
581 | 554 | ||
582 | sym_set_change_count(0); | 555 | sym_set_change_count(0); |
583 | 556 | ||
584 | return 0; | 557 | return 0; |
585 | } | 558 | } |
586 | 559 | ||
587 | int conf_split_config(void) | 560 | int conf_split_config(void) |
588 | { | 561 | { |
589 | char *name, path[128]; | 562 | char *name, path[128]; |
590 | char *s, *d, c; | 563 | char *s, *d, c; |
591 | struct symbol *sym; | 564 | struct symbol *sym; |
592 | struct stat sb; | 565 | struct stat sb; |
593 | int res, i, fd; | 566 | int res, i, fd; |
594 | 567 | ||
595 | name = getenv("KCONFIG_AUTOCONFIG"); | 568 | name = getenv("KCONFIG_AUTOCONFIG"); |
596 | if (!name) | 569 | if (!name) |
597 | name = "include/config/auto.conf"; | 570 | name = "include/config/auto.conf"; |
598 | conf_read_simple(name, S_DEF_AUTO); | 571 | conf_read_simple(name, S_DEF_AUTO); |
599 | 572 | ||
600 | if (chdir("include/config")) | 573 | if (chdir("include/config")) |
601 | return 1; | 574 | return 1; |
602 | 575 | ||
603 | res = 0; | 576 | res = 0; |
604 | for_all_symbols(i, sym) { | 577 | for_all_symbols(i, sym) { |
605 | sym_calc_value(sym); | 578 | sym_calc_value(sym); |
606 | if ((sym->flags & SYMBOL_AUTO) || !sym->name) | 579 | if ((sym->flags & SYMBOL_AUTO) || !sym->name) |
607 | continue; | 580 | continue; |
608 | if (sym->flags & SYMBOL_WRITE) { | 581 | if (sym->flags & SYMBOL_WRITE) { |
609 | if (sym->flags & SYMBOL_DEF_AUTO) { | 582 | if (sym->flags & SYMBOL_DEF_AUTO) { |
610 | /* | 583 | /* |
611 | * symbol has old and new value, | 584 | * symbol has old and new value, |
612 | * so compare them... | 585 | * so compare them... |
613 | */ | 586 | */ |
614 | switch (sym->type) { | 587 | switch (sym->type) { |
615 | case S_BOOLEAN: | 588 | case S_BOOLEAN: |
616 | case S_TRISTATE: | 589 | case S_TRISTATE: |
617 | if (sym_get_tristate_value(sym) == | 590 | if (sym_get_tristate_value(sym) == |
618 | sym->def[S_DEF_AUTO].tri) | 591 | sym->def[S_DEF_AUTO].tri) |
619 | continue; | 592 | continue; |
620 | break; | 593 | break; |
621 | case S_STRING: | 594 | case S_STRING: |
622 | case S_HEX: | 595 | case S_HEX: |
623 | case S_INT: | 596 | case S_INT: |
624 | if (!strcmp(sym_get_string_value(sym), | 597 | if (!strcmp(sym_get_string_value(sym), |
625 | sym->def[S_DEF_AUTO].val)) | 598 | sym->def[S_DEF_AUTO].val)) |
626 | continue; | 599 | continue; |
627 | break; | 600 | break; |
628 | default: | 601 | default: |
629 | break; | 602 | break; |
630 | } | 603 | } |
631 | } else { | 604 | } else { |
632 | /* | 605 | /* |
633 | * If there is no old value, only 'no' (unset) | 606 | * If there is no old value, only 'no' (unset) |
634 | * is allowed as new value. | 607 | * is allowed as new value. |
635 | */ | 608 | */ |
636 | switch (sym->type) { | 609 | switch (sym->type) { |
637 | case S_BOOLEAN: | 610 | case S_BOOLEAN: |
638 | case S_TRISTATE: | 611 | case S_TRISTATE: |
639 | if (sym_get_tristate_value(sym) == no) | 612 | if (sym_get_tristate_value(sym) == no) |
640 | continue; | 613 | continue; |
641 | break; | 614 | break; |
642 | default: | 615 | default: |
643 | break; | 616 | break; |
644 | } | 617 | } |
645 | } | 618 | } |
646 | } else if (!(sym->flags & SYMBOL_DEF_AUTO)) | 619 | } else if (!(sym->flags & SYMBOL_DEF_AUTO)) |
647 | /* There is neither an old nor a new value. */ | 620 | /* There is neither an old nor a new value. */ |
648 | continue; | 621 | continue; |
649 | /* else | 622 | /* else |
650 | * There is an old value, but no new value ('no' (unset) | 623 | * There is an old value, but no new value ('no' (unset) |
651 | * isn't saved in auto.conf, so the old value is always | 624 | * isn't saved in auto.conf, so the old value is always |
652 | * different from 'no'). | 625 | * different from 'no'). |
653 | */ | 626 | */ |
654 | 627 | ||
655 | /* Replace all '_' and append ".h" */ | 628 | /* Replace all '_' and append ".h" */ |
656 | s = sym->name; | 629 | s = sym->name; |
657 | d = path; | 630 | d = path; |
658 | while ((c = *s++)) { | 631 | while ((c = *s++)) { |
659 | c = tolower(c); | 632 | c = tolower(c); |
660 | *d++ = (c == '_') ? '/' : c; | 633 | *d++ = (c == '_') ? '/' : c; |
661 | } | 634 | } |
662 | strcpy(d, ".h"); | 635 | strcpy(d, ".h"); |
663 | 636 | ||
664 | /* Assume directory path already exists. */ | 637 | /* Assume directory path already exists. */ |
665 | fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); | 638 | fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); |
666 | if (fd == -1) { | 639 | if (fd == -1) { |
667 | if (errno != ENOENT) { | 640 | if (errno != ENOENT) { |
668 | res = 1; | 641 | res = 1; |
669 | break; | 642 | break; |
670 | } | 643 | } |
671 | /* | 644 | /* |
672 | * Create directory components, | 645 | * Create directory components, |
673 | * unless they exist already. | 646 | * unless they exist already. |
674 | */ | 647 | */ |
675 | d = path; | 648 | d = path; |
676 | while ((d = strchr(d, '/'))) { | 649 | while ((d = strchr(d, '/'))) { |
677 | *d = 0; | 650 | *d = 0; |
678 | if (stat(path, &sb) && mkdir(path, 0755)) { | 651 | if (stat(path, &sb) && mkdir(path, 0755)) { |
679 | res = 1; | 652 | res = 1; |
680 | goto out; | 653 | goto out; |
681 | } | 654 | } |
682 | *d++ = '/'; | 655 | *d++ = '/'; |
683 | } | 656 | } |
684 | /* Try it again. */ | 657 | /* Try it again. */ |
685 | fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); | 658 | fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); |
686 | if (fd == -1) { | 659 | if (fd == -1) { |
687 | res = 1; | 660 | res = 1; |
688 | break; | 661 | break; |
689 | } | 662 | } |
690 | } | 663 | } |
691 | close(fd); | 664 | close(fd); |
692 | } | 665 | } |
693 | out: | 666 | out: |
694 | if (chdir("../..")) | 667 | if (chdir("../..")) |
695 | return 1; | 668 | return 1; |
696 | 669 | ||
697 | return res; | 670 | return res; |
698 | } | 671 | } |
699 | 672 | ||
700 | int conf_write_autoconf(void) | 673 | int conf_write_autoconf(void) |
701 | { | 674 | { |
702 | struct symbol *sym; | 675 | struct symbol *sym; |
703 | const char *str; | 676 | const char *str; |
704 | char *name; | 677 | char *name; |
705 | FILE *out, *out_h; | 678 | FILE *out, *out_h; |
706 | time_t now; | 679 | time_t now; |
707 | int i, l; | 680 | int i, l; |
708 | 681 | ||
709 | sym_clear_all_valid(); | 682 | sym_clear_all_valid(); |
710 | 683 | ||
711 | file_write_dep("include/config/auto.conf.cmd"); | 684 | file_write_dep("include/config/auto.conf.cmd"); |
712 | 685 | ||
713 | if (conf_split_config()) | 686 | if (conf_split_config()) |
714 | return 1; | 687 | return 1; |
715 | 688 | ||
716 | out = fopen(".tmpconfig", "w"); | 689 | out = fopen(".tmpconfig", "w"); |
717 | if (!out) | 690 | if (!out) |
718 | return 1; | 691 | return 1; |
719 | 692 | ||
720 | out_h = fopen(".tmpconfig.h", "w"); | 693 | out_h = fopen(".tmpconfig.h", "w"); |
721 | if (!out_h) { | 694 | if (!out_h) { |
722 | fclose(out); | 695 | fclose(out); |
723 | return 1; | 696 | return 1; |
724 | } | 697 | } |
725 | 698 | ||
726 | sym = sym_lookup("KERNELVERSION", 0); | 699 | sym = sym_lookup("KERNELVERSION", 0); |
727 | sym_calc_value(sym); | 700 | sym_calc_value(sym); |
728 | time(&now); | 701 | time(&now); |
729 | fprintf(out, "#\n" | 702 | fprintf(out, "#\n" |
730 | "# Automatically generated make config: don't edit\n" | 703 | "# Automatically generated make config: don't edit\n" |
731 | "# Linux kernel version: %s\n" | 704 | "# Linux kernel version: %s\n" |
732 | "# %s" | 705 | "# %s" |
733 | "#\n", | 706 | "#\n", |
734 | sym_get_string_value(sym), ctime(&now)); | 707 | sym_get_string_value(sym), ctime(&now)); |
735 | fprintf(out_h, "/*\n" | 708 | fprintf(out_h, "/*\n" |
736 | " * Automatically generated C config: don't edit\n" | 709 | " * Automatically generated C config: don't edit\n" |
737 | " * Linux kernel version: %s\n" | 710 | " * Linux kernel version: %s\n" |
738 | " * %s" | 711 | " * %s" |
739 | " */\n" | 712 | " */\n" |
740 | "#define AUTOCONF_INCLUDED\n", | 713 | "#define AUTOCONF_INCLUDED\n", |
741 | sym_get_string_value(sym), ctime(&now)); | 714 | sym_get_string_value(sym), ctime(&now)); |
742 | 715 | ||
743 | for_all_symbols(i, sym) { | 716 | for_all_symbols(i, sym) { |
744 | sym_calc_value(sym); | 717 | sym_calc_value(sym); |
745 | if (!(sym->flags & SYMBOL_WRITE) || !sym->name) | 718 | if (!(sym->flags & SYMBOL_WRITE) || !sym->name) |
746 | continue; | 719 | continue; |
747 | switch (sym->type) { | 720 | switch (sym->type) { |
748 | case S_BOOLEAN: | 721 | case S_BOOLEAN: |
749 | case S_TRISTATE: | 722 | case S_TRISTATE: |
750 | switch (sym_get_tristate_value(sym)) { | 723 | switch (sym_get_tristate_value(sym)) { |
751 | case no: | 724 | case no: |
752 | break; | 725 | break; |
753 | case mod: | 726 | case mod: |
754 | fprintf(out, "CONFIG_%s=m\n", sym->name); | 727 | fprintf(out, "CONFIG_%s=m\n", sym->name); |
755 | fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name); | 728 | fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name); |
756 | break; | 729 | break; |
757 | case yes: | 730 | case yes: |
758 | fprintf(out, "CONFIG_%s=y\n", sym->name); | 731 | fprintf(out, "CONFIG_%s=y\n", sym->name); |
759 | fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); | 732 | fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); |
760 | break; | 733 | break; |
761 | } | 734 | } |
762 | break; | 735 | break; |
763 | case S_STRING: | 736 | case S_STRING: |
764 | str = sym_get_string_value(sym); | 737 | str = sym_get_string_value(sym); |
765 | fprintf(out, "CONFIG_%s=\"", sym->name); | 738 | fprintf(out, "CONFIG_%s=\"", sym->name); |
766 | fprintf(out_h, "#define CONFIG_%s \"", sym->name); | 739 | fprintf(out_h, "#define CONFIG_%s \"", sym->name); |
767 | while (1) { | 740 | while (1) { |
768 | l = strcspn(str, "\"\\"); | 741 | l = strcspn(str, "\"\\"); |
769 | if (l) { | 742 | if (l) { |
770 | fwrite(str, l, 1, out); | 743 | fwrite(str, l, 1, out); |
771 | fwrite(str, l, 1, out_h); | 744 | fwrite(str, l, 1, out_h); |
772 | str += l; | 745 | str += l; |
773 | } | 746 | } |
774 | if (!*str) | 747 | if (!*str) |
775 | break; | 748 | break; |
776 | fprintf(out, "\\%c", *str); | 749 | fprintf(out, "\\%c", *str); |
777 | fprintf(out_h, "\\%c", *str); | 750 | fprintf(out_h, "\\%c", *str); |
778 | str++; | 751 | str++; |
779 | } | 752 | } |
780 | fputs("\"\n", out); | 753 | fputs("\"\n", out); |
781 | fputs("\"\n", out_h); | 754 | fputs("\"\n", out_h); |
782 | break; | 755 | break; |
783 | case S_HEX: | 756 | case S_HEX: |
784 | str = sym_get_string_value(sym); | 757 | str = sym_get_string_value(sym); |
785 | if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { | 758 | if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { |
786 | fprintf(out, "CONFIG_%s=%s\n", sym->name, str); | 759 | fprintf(out, "CONFIG_%s=%s\n", sym->name, str); |
787 | fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str); | 760 | fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str); |
788 | break; | 761 | break; |
789 | } | 762 | } |
790 | case S_INT: | 763 | case S_INT: |
791 | str = sym_get_string_value(sym); | 764 | str = sym_get_string_value(sym); |
792 | fprintf(out, "CONFIG_%s=%s\n", sym->name, str); | 765 | fprintf(out, "CONFIG_%s=%s\n", sym->name, str); |
793 | fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str); | 766 | fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str); |
794 | break; | 767 | break; |
795 | default: | 768 | default: |
796 | break; | 769 | break; |
797 | } | 770 | } |
798 | } | 771 | } |
799 | fclose(out); | 772 | fclose(out); |
800 | fclose(out_h); | 773 | fclose(out_h); |
801 | 774 | ||
802 | name = getenv("KCONFIG_AUTOHEADER"); | 775 | name = getenv("KCONFIG_AUTOHEADER"); |
803 | if (!name) | 776 | if (!name) |
804 | name = "include/linux/autoconf.h"; | 777 | name = "include/linux/autoconf.h"; |
805 | if (rename(".tmpconfig.h", name)) | 778 | if (rename(".tmpconfig.h", name)) |
806 | return 1; | 779 | return 1; |
807 | name = getenv("KCONFIG_AUTOCONFIG"); | 780 | name = getenv("KCONFIG_AUTOCONFIG"); |
808 | if (!name) | 781 | if (!name) |
809 | name = "include/config/auto.conf"; | 782 | name = "include/config/auto.conf"; |
810 | /* | 783 | /* |
811 | * This must be the last step, kbuild has a dependency on auto.conf | 784 | * This must be the last step, kbuild has a dependency on auto.conf |
812 | * and this marks the successful completion of the previous steps. | 785 | * and this marks the successful completion of the previous steps. |
813 | */ | 786 | */ |
814 | if (rename(".tmpconfig", name)) | 787 | if (rename(".tmpconfig", name)) |
815 | return 1; | 788 | return 1; |
816 | 789 | ||
817 | return 0; | 790 | return 0; |
818 | } | 791 | } |
819 | 792 | ||
820 | static int sym_change_count; | 793 | static int sym_change_count; |
821 | static void (*conf_changed_callback)(void); | 794 | static void (*conf_changed_callback)(void); |
822 | 795 | ||
823 | void sym_set_change_count(int count) | 796 | void sym_set_change_count(int count) |
824 | { | 797 | { |
825 | int _sym_change_count = sym_change_count; | 798 | int _sym_change_count = sym_change_count; |
826 | sym_change_count = count; | 799 | sym_change_count = count; |
827 | if (conf_changed_callback && | 800 | if (conf_changed_callback && |
828 | (bool)_sym_change_count != (bool)count) | 801 | (bool)_sym_change_count != (bool)count) |
829 | conf_changed_callback(); | 802 | conf_changed_callback(); |
830 | } | 803 | } |
831 | 804 | ||
832 | void sym_add_change_count(int count) | 805 | void sym_add_change_count(int count) |
833 | { | 806 | { |
834 | sym_set_change_count(count + sym_change_count); | 807 | sym_set_change_count(count + sym_change_count); |
835 | } | 808 | } |
836 | 809 | ||
837 | bool conf_get_changed(void) | 810 | bool conf_get_changed(void) |
838 | { | 811 | { |
839 | return sym_change_count; | 812 | return sym_change_count; |
840 | } | 813 | } |
841 | 814 | ||
842 | void conf_set_changed_callback(void (*fn)(void)) | 815 | void conf_set_changed_callback(void (*fn)(void)) |
843 | { | 816 | { |
844 | conf_changed_callback = fn; | 817 | conf_changed_callback = fn; |
845 | } | 818 | } |
846 | 819 |
scripts/kconfig/lkc_proto.h
1 | 1 | ||
2 | /* confdata.c */ | 2 | /* confdata.c */ |
3 | P(conf_parse,void,(const char *name)); | 3 | P(conf_parse,void,(const char *name)); |
4 | P(conf_set_env_sym,int,(const char *envname, const char *symname, int def)); | ||
5 | P(conf_read,int,(const char *name)); | 4 | P(conf_read,int,(const char *name)); |
6 | P(conf_read_simple,int,(const char *name, int)); | 5 | P(conf_read_simple,int,(const char *name, int)); |
7 | P(conf_write,int,(const char *name)); | 6 | P(conf_write,int,(const char *name)); |
8 | P(conf_write_autoconf,int,(void)); | 7 | P(conf_write_autoconf,int,(void)); |
9 | P(conf_get_changed,bool,(void)); | 8 | P(conf_get_changed,bool,(void)); |
10 | P(conf_set_changed_callback, void,(void (*fn)(void))); | 9 | P(conf_set_changed_callback, void,(void (*fn)(void))); |
11 | 10 | ||
12 | /* menu.c */ | 11 | /* menu.c */ |
13 | P(rootmenu,struct menu,); | 12 | P(rootmenu,struct menu,); |
14 | 13 | ||
15 | P(menu_is_visible,bool,(struct menu *menu)); | 14 | P(menu_is_visible,bool,(struct menu *menu)); |
16 | P(menu_get_prompt,const char *,(struct menu *menu)); | 15 | P(menu_get_prompt,const char *,(struct menu *menu)); |
17 | P(menu_get_root_menu,struct menu *,(struct menu *menu)); | 16 | P(menu_get_root_menu,struct menu *,(struct menu *menu)); |
18 | P(menu_get_parent_menu,struct menu *,(struct menu *menu)); | 17 | P(menu_get_parent_menu,struct menu *,(struct menu *menu)); |
19 | P(menu_has_help,bool,(struct menu *menu)); | 18 | P(menu_has_help,bool,(struct menu *menu)); |
20 | P(menu_get_help,const char *,(struct menu *menu)); | 19 | P(menu_get_help,const char *,(struct menu *menu)); |
21 | 20 | ||
22 | /* symbol.c */ | 21 | /* symbol.c */ |
23 | P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); | 22 | P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); |
24 | 23 | ||
25 | P(sym_lookup,struct symbol *,(const char *name, int isconst)); | 24 | P(sym_lookup,struct symbol *,(const char *name, int isconst)); |
26 | P(sym_find,struct symbol *,(const char *name)); | 25 | P(sym_find,struct symbol *,(const char *name)); |
27 | P(sym_re_search,struct symbol **,(const char *pattern)); | 26 | P(sym_re_search,struct symbol **,(const char *pattern)); |
28 | P(sym_type_name,const char *,(enum symbol_type type)); | 27 | P(sym_type_name,const char *,(enum symbol_type type)); |
29 | P(sym_calc_value,void,(struct symbol *sym)); | 28 | P(sym_calc_value,void,(struct symbol *sym)); |
30 | P(sym_get_type,enum symbol_type,(struct symbol *sym)); | 29 | P(sym_get_type,enum symbol_type,(struct symbol *sym)); |
31 | P(sym_tristate_within_range,bool,(struct symbol *sym,tristate tri)); | 30 | P(sym_tristate_within_range,bool,(struct symbol *sym,tristate tri)); |
32 | P(sym_set_tristate_value,bool,(struct symbol *sym,tristate tri)); | 31 | P(sym_set_tristate_value,bool,(struct symbol *sym,tristate tri)); |
33 | P(sym_toggle_tristate_value,tristate,(struct symbol *sym)); | 32 | P(sym_toggle_tristate_value,tristate,(struct symbol *sym)); |
34 | P(sym_string_valid,bool,(struct symbol *sym, const char *newval)); | 33 | P(sym_string_valid,bool,(struct symbol *sym, const char *newval)); |
35 | P(sym_string_within_range,bool,(struct symbol *sym, const char *str)); | 34 | P(sym_string_within_range,bool,(struct symbol *sym, const char *str)); |
36 | P(sym_set_string_value,bool,(struct symbol *sym, const char *newval)); | 35 | P(sym_set_string_value,bool,(struct symbol *sym, const char *newval)); |
37 | P(sym_is_changable,bool,(struct symbol *sym)); | 36 | P(sym_is_changable,bool,(struct symbol *sym)); |
38 | P(sym_get_choice_prop,struct property *,(struct symbol *sym)); | 37 | P(sym_get_choice_prop,struct property *,(struct symbol *sym)); |
39 | P(sym_get_default_prop,struct property *,(struct symbol *sym)); | 38 | P(sym_get_default_prop,struct property *,(struct symbol *sym)); |
40 | P(sym_get_string_value,const char *,(struct symbol *sym)); | 39 | P(sym_get_string_value,const char *,(struct symbol *sym)); |
41 | 40 | ||
42 | P(prop_get_type_name,const char *,(enum prop_type type)); | 41 | P(prop_get_type_name,const char *,(enum prop_type type)); |
43 | 42 | ||
44 | /* expr.c */ | 43 | /* expr.c */ |
45 | P(expr_compare_type,int,(enum expr_type t1, enum expr_type t2)); | 44 | P(expr_compare_type,int,(enum expr_type t1, enum expr_type t2)); |
46 | P(expr_print,void,(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken)); | 45 | P(expr_print,void,(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken)); |
47 | 46 |