diff options
34 files changed, 872 insertions, 442 deletions
diff --git a/.gitignore b/.gitignore index caa8395f635..cecb3b040cc 100644 --- a/.gitignore +++ b/.gitignore | |||
@@ -25,6 +25,8 @@ | |||
25 | *.elf | 25 | *.elf |
26 | *.bin | 26 | *.bin |
27 | *.gz | 27 | *.gz |
28 | *.lzma | ||
29 | *.patch | ||
28 | 30 | ||
29 | # | 31 | # |
30 | # Top-level generic files | 32 | # Top-level generic files |
@@ -62,6 +64,12 @@ series | |||
62 | cscope.* | 64 | cscope.* |
63 | ncscope.* | 65 | ncscope.* |
64 | 66 | ||
67 | # gnu global files | ||
68 | GPATH | ||
69 | GRTAGS | ||
70 | GSYMS | ||
71 | GTAGS | ||
72 | |||
65 | *.orig | 73 | *.orig |
66 | *~ | 74 | *~ |
67 | \#*# | 75 | \#*# |
diff --git a/Documentation/Changes b/Documentation/Changes index d21b3b5aa54..664392481c8 100644 --- a/Documentation/Changes +++ b/Documentation/Changes | |||
@@ -29,7 +29,7 @@ hardware, for example, you probably needn't concern yourself with | |||
29 | isdn4k-utils. | 29 | isdn4k-utils. |
30 | 30 | ||
31 | o Gnu C 3.2 # gcc --version | 31 | o Gnu C 3.2 # gcc --version |
32 | o Gnu make 3.79.1 # make --version | 32 | o Gnu make 3.80 # make --version |
33 | o binutils 2.12 # ld -v | 33 | o binutils 2.12 # ld -v |
34 | o util-linux 2.10o # fdformat --version | 34 | o util-linux 2.10o # fdformat --version |
35 | o module-init-tools 0.9.10 # depmod -V | 35 | o module-init-tools 0.9.10 # depmod -V |
@@ -62,7 +62,7 @@ computer. | |||
62 | Make | 62 | Make |
63 | ---- | 63 | ---- |
64 | 64 | ||
65 | You will need Gnu make 3.79.1 or later to build the kernel. | 65 | You will need Gnu make 3.80 or later to build the kernel. |
66 | 66 | ||
67 | Binutils | 67 | Binutils |
68 | -------- | 68 | -------- |
diff --git a/Documentation/kbuild/kconfig.txt b/Documentation/kbuild/kconfig.txt index 26a7c0a9319..849b5e56d06 100644 --- a/Documentation/kbuild/kconfig.txt +++ b/Documentation/kbuild/kconfig.txt | |||
@@ -35,48 +35,26 @@ new .config files to see the differences: | |||
35 | 35 | ||
36 | (Yes, we need something better here.) | 36 | (Yes, we need something better here.) |
37 | 37 | ||
38 | |||
39 | ====================================================================== | ||
40 | menuconfig | ||
41 | -------------------------------------------------- | ||
42 | |||
43 | SEARCHING for CONFIG symbols | ||
44 | |||
45 | Searching in menuconfig: | ||
46 | |||
47 | The Search function searches for kernel configuration symbol | ||
48 | names, so you have to know something close to what you are | ||
49 | looking for. | ||
50 | |||
51 | Example: | ||
52 | /hotplug | ||
53 | This lists all config symbols that contain "hotplug", | ||
54 | e.g., HOTPLUG, HOTPLUG_CPU, MEMORY_HOTPLUG. | ||
55 | |||
56 | For search help, enter / followed TAB-TAB-TAB (to highlight | ||
57 | <Help>) and Enter. This will tell you that you can also use | ||
58 | regular expressions (regexes) in the search string, so if you | ||
59 | are not interested in MEMORY_HOTPLUG, you could try | ||
60 | |||
61 | /^hotplug | ||
62 | |||
63 | |||
64 | ______________________________________________________________________ | 38 | ______________________________________________________________________ |
65 | Color Themes for 'menuconfig' | 39 | Environment variables for '*config' |
66 | 40 | ||
67 | It is possible to select different color themes using the variable | 41 | KCONFIG_CONFIG |
68 | MENUCONFIG_COLOR. To select a theme use: | 42 | -------------------------------------------------- |
43 | This environment variable can be used to specify a default kernel config | ||
44 | file name to override the default name of ".config". | ||
69 | 45 | ||
70 | make MENUCONFIG_COLOR=<theme> menuconfig | 46 | KCONFIG_OVERWRITECONFIG |
47 | -------------------------------------------------- | ||
48 | If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not | ||
49 | break symlinks when .config is a symlink to somewhere else. | ||
71 | 50 | ||
72 | Available themes are: | 51 | KCONFIG_NOTIMESTAMP |
73 | mono => selects colors suitable for monochrome displays | 52 | -------------------------------------------------- |
74 | blackbg => selects a color scheme with black background | 53 | If this environment variable exists and is non-null, the timestamp line |
75 | classic => theme with blue background. The classic look | 54 | in generated .config files is omitted. |
76 | bluetitle => a LCD friendly version of classic. (default) | ||
77 | 55 | ||
78 | ______________________________________________________________________ | 56 | ______________________________________________________________________ |
79 | Environment variables in 'menuconfig' | 57 | Environment variables for '{allyes/allmod/allno/rand}config' |
80 | 58 | ||
81 | KCONFIG_ALLCONFIG | 59 | KCONFIG_ALLCONFIG |
82 | -------------------------------------------------- | 60 | -------------------------------------------------- |
@@ -95,8 +73,7 @@ values. | |||
95 | This enables you to create "miniature" config (miniconfig) or custom | 73 | This enables you to create "miniature" config (miniconfig) or custom |
96 | config files containing just the config symbols that you are interested | 74 | config files containing just the config symbols that you are interested |
97 | in. Then the kernel config system generates the full .config file, | 75 | in. Then the kernel config system generates the full .config file, |
98 | including dependencies of your miniconfig file, based on the miniconfig | 76 | including symbols of your miniconfig file. |
99 | file. | ||
100 | 77 | ||
101 | This 'KCONFIG_ALLCONFIG' file is a config file which contains | 78 | This 'KCONFIG_ALLCONFIG' file is a config file which contains |
102 | (usually a subset of all) preset config symbols. These variable | 79 | (usually a subset of all) preset config symbols. These variable |
@@ -113,26 +90,14 @@ These examples will disable most options (allnoconfig) but enable or | |||
113 | disable the options that are explicitly listed in the specified | 90 | disable the options that are explicitly listed in the specified |
114 | mini-config files. | 91 | mini-config files. |
115 | 92 | ||
93 | ______________________________________________________________________ | ||
94 | Environment variables for 'silentoldconfig' | ||
95 | |||
116 | KCONFIG_NOSILENTUPDATE | 96 | KCONFIG_NOSILENTUPDATE |
117 | -------------------------------------------------- | 97 | -------------------------------------------------- |
118 | If this variable has a non-blank value, it prevents silent kernel | 98 | If this variable has a non-blank value, it prevents silent kernel |
119 | config udpates (requires explicit updates). | 99 | config udpates (requires explicit updates). |
120 | 100 | ||
121 | KCONFIG_CONFIG | ||
122 | -------------------------------------------------- | ||
123 | This environment variable can be used to specify a default kernel config | ||
124 | file name to override the default name of ".config". | ||
125 | |||
126 | KCONFIG_OVERWRITECONFIG | ||
127 | -------------------------------------------------- | ||
128 | If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not | ||
129 | break symlinks when .config is a symlink to somewhere else. | ||
130 | |||
131 | KCONFIG_NOTIMESTAMP | ||
132 | -------------------------------------------------- | ||
133 | If this environment variable exists and is non-null, the timestamp line | ||
134 | in generated .config files is omitted. | ||
135 | |||
136 | KCONFIG_AUTOCONFIG | 101 | KCONFIG_AUTOCONFIG |
137 | -------------------------------------------------- | 102 | -------------------------------------------------- |
138 | This environment variable can be set to specify the path & name of the | 103 | This environment variable can be set to specify the path & name of the |
@@ -143,15 +108,54 @@ KCONFIG_AUTOHEADER | |||
143 | This environment variable can be set to specify the path & name of the | 108 | This environment variable can be set to specify the path & name of the |
144 | "autoconf.h" (header) file. Its default value is "include/linux/autoconf.h". | 109 | "autoconf.h" (header) file. Its default value is "include/linux/autoconf.h". |
145 | 110 | ||
111 | |||
112 | ====================================================================== | ||
113 | menuconfig | ||
114 | -------------------------------------------------- | ||
115 | |||
116 | SEARCHING for CONFIG symbols | ||
117 | |||
118 | Searching in menuconfig: | ||
119 | |||
120 | The Search function searches for kernel configuration symbol | ||
121 | names, so you have to know something close to what you are | ||
122 | looking for. | ||
123 | |||
124 | Example: | ||
125 | /hotplug | ||
126 | This lists all config symbols that contain "hotplug", | ||
127 | e.g., HOTPLUG, HOTPLUG_CPU, MEMORY_HOTPLUG. | ||
128 | |||
129 | For search help, enter / followed TAB-TAB-TAB (to highlight | ||
130 | <Help>) and Enter. This will tell you that you can also use | ||
131 | regular expressions (regexes) in the search string, so if you | ||
132 | are not interested in MEMORY_HOTPLUG, you could try | ||
133 | |||
134 | /^hotplug | ||
135 | |||
146 | ______________________________________________________________________ | 136 | ______________________________________________________________________ |
147 | menuconfig User Interface Options | 137 | User interface options for 'menuconfig' |
148 | ---------------------------------------------------------------------- | 138 | |
139 | MENUCONFIG_COLOR | ||
140 | -------------------------------------------------- | ||
141 | It is possible to select different color themes using the variable | ||
142 | MENUCONFIG_COLOR. To select a theme use: | ||
143 | |||
144 | make MENUCONFIG_COLOR=<theme> menuconfig | ||
145 | |||
146 | Available themes are: | ||
147 | mono => selects colors suitable for monochrome displays | ||
148 | blackbg => selects a color scheme with black background | ||
149 | classic => theme with blue background. The classic look | ||
150 | bluetitle => a LCD friendly version of classic. (default) | ||
151 | |||
149 | MENUCONFIG_MODE | 152 | MENUCONFIG_MODE |
150 | -------------------------------------------------- | 153 | -------------------------------------------------- |
151 | This mode shows all sub-menus in one large tree. | 154 | This mode shows all sub-menus in one large tree. |
152 | 155 | ||
153 | Example: | 156 | Example: |
154 | MENUCONFIG_MODE=single_menu make menuconfig | 157 | make MENUCONFIG_MODE=single_menu menuconfig |
158 | |||
155 | 159 | ||
156 | ====================================================================== | 160 | ====================================================================== |
157 | xconfig | 161 | xconfig |
diff --git a/Documentation/kbuild/modules.txt b/Documentation/kbuild/modules.txt index b1096da953c..0767cf69c69 100644 --- a/Documentation/kbuild/modules.txt +++ b/Documentation/kbuild/modules.txt | |||
@@ -275,7 +275,7 @@ following files: | |||
275 | 275 | ||
276 | KERNELDIR := /lib/modules/`uname -r`/build | 276 | KERNELDIR := /lib/modules/`uname -r`/build |
277 | all:: | 277 | all:: |
278 | $(MAKE) -C $KERNELDIR M=`pwd` $@ | 278 | $(MAKE) -C $(KERNELDIR) M=`pwd` $@ |
279 | 279 | ||
280 | # Module specific targets | 280 | # Module specific targets |
281 | genbin: | 281 | genbin: |
@@ -35,10 +35,8 @@ MAKEFLAGS += -rR --no-print-directory | |||
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 | ifeq ("$(origin V)", "command line") |
39 | ifeq ("$(origin V)", "command line") | 39 | KBUILD_VERBOSE = $(V) |
40 | KBUILD_VERBOSE = $(V) | ||
41 | endif | ||
42 | endif | 40 | endif |
43 | ifndef KBUILD_VERBOSE | 41 | ifndef KBUILD_VERBOSE |
44 | KBUILD_VERBOSE = 0 | 42 | KBUILD_VERBOSE = 0 |
@@ -54,10 +52,8 @@ endif | |||
54 | # See the file "Documentation/sparse.txt" for more details, including | 52 | # See the file "Documentation/sparse.txt" for more details, including |
55 | # where to get the "sparse" utility. | 53 | # where to get the "sparse" utility. |
56 | 54 | ||
57 | ifdef C | 55 | ifeq ("$(origin C)", "command line") |
58 | ifeq ("$(origin C)", "command line") | 56 | KBUILD_CHECKSRC = $(C) |
59 | KBUILD_CHECKSRC = $(C) | ||
60 | endif | ||
61 | endif | 57 | endif |
62 | ifndef KBUILD_CHECKSRC | 58 | ifndef KBUILD_CHECKSRC |
63 | KBUILD_CHECKSRC = 0 | 59 | KBUILD_CHECKSRC = 0 |
@@ -69,12 +65,10 @@ endif | |||
69 | ifdef SUBDIRS | 65 | ifdef SUBDIRS |
70 | KBUILD_EXTMOD ?= $(SUBDIRS) | 66 | KBUILD_EXTMOD ?= $(SUBDIRS) |
71 | endif | 67 | endif |
72 | ifdef M | ||
73 | ifeq ("$(origin M)", "command line") | ||
74 | KBUILD_EXTMOD := $(M) | ||
75 | endif | ||
76 | endif | ||
77 | 68 | ||
69 | ifeq ("$(origin M)", "command line") | ||
70 | KBUILD_EXTMOD := $(M) | ||
71 | endif | ||
78 | 72 | ||
79 | # kbuild supports saving output files in a separate directory. | 73 | # kbuild supports saving output files in a separate directory. |
80 | # To locate output files in a separate directory two syntaxes are supported. | 74 | # To locate output files in a separate directory two syntaxes are supported. |
@@ -98,10 +92,8 @@ ifeq ($(KBUILD_SRC),) | |||
98 | 92 | ||
99 | # OK, Make called in directory where kernel src resides | 93 | # OK, Make called in directory where kernel src resides |
100 | # Do we want to locate output files in a separate directory? | 94 | # Do we want to locate output files in a separate directory? |
101 | ifdef O | 95 | ifeq ("$(origin O)", "command line") |
102 | ifeq ("$(origin O)", "command line") | 96 | KBUILD_OUTPUT := $(O) |
103 | KBUILD_OUTPUT := $(O) | ||
104 | endif | ||
105 | endif | 97 | endif |
106 | 98 | ||
107 | # That's our default target when none is given on the command line | 99 | # That's our default target when none is given on the command line |
@@ -174,8 +174,17 @@ CONFIGURING the kernel: | |||
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 | Additionally updates the dependencies. | ||
177 | "make defconfig" Create a ./.config file by using the default | 178 | "make defconfig" Create a ./.config file by using the default |
178 | symbol values from arch/$ARCH/defconfig. | 179 | symbol values from either arch/$ARCH/defconfig |
180 | or arch/$ARCH/configs/${PLATFORM}_defconfig, | ||
181 | depending on the architecture. | ||
182 | "make ${PLATFORM}_defconfig" | ||
183 | Create a ./.config file by using the default | ||
184 | symbol values from | ||
185 | arch/$ARCH/configs/${PLATFORM}_defconfig. | ||
186 | Use "make help" to get a list of all available | ||
187 | platforms of your architecture. | ||
179 | "make allyesconfig" | 188 | "make allyesconfig" |
180 | Create a ./.config file by setting symbol | 189 | Create a ./.config file by setting symbol |
181 | values to 'y' as much as possible. | 190 | values to 'y' as much as possible. |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index f1736ca7922..6bdba10fef4 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -1,4 +1,57 @@ | |||
1 | #include <linux/section-names.h> | 1 | /* |
2 | * Helper macros to support writing architecture specific | ||
3 | * linker scripts. | ||
4 | * | ||
5 | * A minimal linker scripts has following content: | ||
6 | * [This is a sample, architectures may have special requiriements] | ||
7 | * | ||
8 | * OUTPUT_FORMAT(...) | ||
9 | * OUTPUT_ARCH(...) | ||
10 | * ENTRY(...) | ||
11 | * SECTIONS | ||
12 | * { | ||
13 | * . = START; | ||
14 | * __init_begin = .; | ||
15 | * HEAD_TEXT_SECTION | ||
16 | * INIT_TEXT_SECTION(PAGE_SIZE) | ||
17 | * INIT_DATA_SECTION(...) | ||
18 | * PERCPU(PAGE_SIZE) | ||
19 | * __init_end = .; | ||
20 | * | ||
21 | * _stext = .; | ||
22 | * TEXT_SECTION = 0 | ||
23 | * _etext = .; | ||
24 | * | ||
25 | * _sdata = .; | ||
26 | * RO_DATA_SECTION(PAGE_SIZE) | ||
27 | * RW_DATA_SECTION(...) | ||
28 | * _edata = .; | ||
29 | * | ||
30 | * EXCEPTION_TABLE(...) | ||
31 | * NOTES | ||
32 | * | ||
33 | * __bss_start = .; | ||
34 | * BSS_SECTION(0, 0) | ||
35 | * __bss_stop = .; | ||
36 | * _end = .; | ||
37 | * | ||
38 | * /DISCARD/ : { | ||
39 | * EXIT_TEXT | ||
40 | * EXIT_DATA | ||
41 | * EXIT_CALL | ||
42 | * } | ||
43 | * STABS_DEBUG | ||
44 | * DWARF_DEBUG | ||
45 | * } | ||
46 | * | ||
47 | * [__init_begin, __init_end] is the init section that may be freed after init | ||
48 | * [_stext, _etext] is the text section | ||
49 | * [_sdata, _edata] is the data section | ||
50 | * | ||
51 | * Some of the included output section have their own set of constants. | ||
52 | * Examples are: [__initramfs_start, __initramfs_end] for initramfs and | ||
53 | * [__nosave_begin, __nosave_end] for the nosave data | ||
54 | */ | ||
2 | 55 | ||
3 | #ifndef LOAD_OFFSET | 56 | #ifndef LOAD_OFFSET |
4 | #define LOAD_OFFSET 0 | 57 | #define LOAD_OFFSET 0 |
@@ -116,7 +169,36 @@ | |||
116 | FTRACE_EVENTS() \ | 169 | FTRACE_EVENTS() \ |
117 | TRACE_SYSCALLS() | 170 | TRACE_SYSCALLS() |
118 | 171 | ||
119 | #define RO_DATA(align) \ | 172 | /* |
173 | * Data section helpers | ||
174 | */ | ||
175 | #define NOSAVE_DATA \ | ||
176 | . = ALIGN(PAGE_SIZE); \ | ||
177 | VMLINUX_SYMBOL(__nosave_begin) = .; \ | ||
178 | *(.data.nosave) \ | ||
179 | . = ALIGN(PAGE_SIZE); \ | ||
180 | VMLINUX_SYMBOL(__nosave_end) = .; | ||
181 | |||
182 | #define PAGE_ALIGNED_DATA(page_align) \ | ||
183 | . = ALIGN(page_align); \ | ||
184 | *(.data.page_aligned) | ||
185 | |||
186 | #define READ_MOSTLY_DATA(align) \ | ||
187 | . = ALIGN(align); \ | ||
188 | *(.data.read_mostly) | ||
189 | |||
190 | #define CACHELINE_ALIGNED_DATA(align) \ | ||
191 | . = ALIGN(align); \ | ||
192 | *(.data.cacheline_aligned) | ||
193 | |||
194 | #define INIT_TASK(align) \ | ||
195 | . = ALIGN(align); \ | ||
196 | *(.data.init_task) | ||
197 | |||
198 | /* | ||
199 | * Read only Data | ||
200 | */ | ||
201 | #define RO_DATA_SECTION(align) \ | ||
120 | . = ALIGN((align)); \ | 202 | . = ALIGN((align)); \ |
121 | .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ | 203 | .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ |
122 | VMLINUX_SYMBOL(__start_rodata) = .; \ | 204 | VMLINUX_SYMBOL(__start_rodata) = .; \ |
@@ -270,9 +352,10 @@ | |||
270 | } \ | 352 | } \ |
271 | . = ALIGN((align)); | 353 | . = ALIGN((align)); |
272 | 354 | ||
273 | /* RODATA provided for backward compatibility. | 355 | /* RODATA & RO_DATA provided for backward compatibility. |
274 | * All archs are supposed to use RO_DATA() */ | 356 | * All archs are supposed to use RO_DATA() */ |
275 | #define RODATA RO_DATA(4096) | 357 | #define RODATA RO_DATA_SECTION(4096) |
358 | #define RO_DATA(align) RO_DATA_SECTION(align) | ||
276 | 359 | ||
277 | #define SECURITY_INIT \ | 360 | #define SECURITY_INIT \ |
278 | .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \ | 361 | .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \ |
@@ -330,16 +413,42 @@ | |||
330 | #endif | 413 | #endif |
331 | 414 | ||
332 | /* Section used for early init (in .S files) */ | 415 | /* Section used for early init (in .S files) */ |
333 | #define HEAD_TEXT *(HEAD_TEXT_SECTION) | 416 | #define HEAD_TEXT *(.head.text) |
417 | |||
418 | #define HEAD_TEXT_SECTION \ | ||
419 | .head.text : AT(ADDR(.head.text) - LOAD_OFFSET) { \ | ||
420 | HEAD_TEXT \ | ||
421 | } | ||
422 | |||
423 | /* | ||
424 | * Exception table | ||
425 | */ | ||
426 | #define EXCEPTION_TABLE(align) \ | ||
427 | . = ALIGN(align); \ | ||
428 | __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { \ | ||
429 | VMLINUX_SYMBOL(__start___ex_table) = .; \ | ||
430 | *(__ex_table) \ | ||
431 | VMLINUX_SYMBOL(__stop___ex_table) = .; \ | ||
432 | } | ||
433 | |||
434 | /* | ||
435 | * Init task | ||
436 | */ | ||
437 | #define INIT_TASK_DATA(align) \ | ||
438 | . = ALIGN(align); \ | ||
439 | .data.init_task : { \ | ||
440 | INIT_TASK \ | ||
441 | } | ||
334 | 442 | ||
335 | /* init and exit section handling */ | 443 | /* init and exit section handling */ |
336 | #define INIT_DATA \ | 444 | #define INIT_DATA \ |
337 | *(.init.data) \ | 445 | *(.init.data) \ |
338 | DEV_DISCARD(init.data) \ | 446 | DEV_DISCARD(init.data) \ |
339 | DEV_DISCARD(init.rodata) \ | ||
340 | CPU_DISCARD(init.data) \ | 447 | CPU_DISCARD(init.data) \ |
341 | CPU_DISCARD(init.rodata) \ | ||
342 | MEM_DISCARD(init.data) \ | 448 | MEM_DISCARD(init.data) \ |
449 | *(.init.rodata) \ | ||
450 | DEV_DISCARD(init.rodata) \ | ||
451 | CPU_DISCARD(init.rodata) \ | ||
343 | MEM_DISCARD(init.rodata) | 452 | MEM_DISCARD(init.rodata) |
344 | 453 | ||
345 | #define INIT_TEXT \ | 454 | #define INIT_TEXT \ |
@@ -363,9 +472,35 @@ | |||
363 | CPU_DISCARD(exit.text) \ | 472 | CPU_DISCARD(exit.text) \ |
364 | MEM_DISCARD(exit.text) | 473 | MEM_DISCARD(exit.text) |
365 | 474 | ||
366 | /* DWARF debug sections. | 475 | #define EXIT_CALL \ |
367 | Symbols in the DWARF debugging sections are relative to | 476 | *(.exitcall.exit) |
368 | the beginning of the section so we begin them at 0. */ | 477 | |
478 | /* | ||
479 | * bss (Block Started by Symbol) - uninitialized data | ||
480 | * zeroed during startup | ||
481 | */ | ||
482 | #define SBSS \ | ||
483 | .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \ | ||
484 | *(.sbss) \ | ||
485 | *(.scommon) \ | ||
486 | } | ||
487 | |||
488 | #define BSS(bss_align) \ | ||
489 | . = ALIGN(bss_align); \ | ||
490 | .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \ | ||
491 | VMLINUX_SYMBOL(__bss_start) = .; \ | ||
492 | *(.bss.page_aligned) \ | ||
493 | *(.dynbss) \ | ||
494 | *(.bss) \ | ||
495 | *(COMMON) \ | ||
496 | VMLINUX_SYMBOL(__bss_stop) = .; \ | ||
497 | } | ||
498 | |||
499 | /* | ||
500 | * DWARF debug sections. | ||
501 | * Symbols in the DWARF debugging sections are relative to | ||
502 | * the beginning of the section so we begin them at 0. | ||
503 | */ | ||
369 | #define DWARF_DEBUG \ | 504 | #define DWARF_DEBUG \ |
370 | /* DWARF 1 */ \ | 505 | /* DWARF 1 */ \ |
371 | .debug 0 : { *(.debug) } \ | 506 | .debug 0 : { *(.debug) } \ |
@@ -432,6 +567,12 @@ | |||
432 | VMLINUX_SYMBOL(__stop_notes) = .; \ | 567 | VMLINUX_SYMBOL(__stop_notes) = .; \ |
433 | } | 568 | } |
434 | 569 | ||
570 | #define INIT_SETUP(initsetup_align) \ | ||
571 | . = ALIGN(initsetup_align); \ | ||
572 | VMLINUX_SYMBOL(__setup_start) = .; \ | ||
573 | *(.init.setup) \ | ||
574 | VMLINUX_SYMBOL(__setup_end) = .; | ||
575 | |||
435 | #define INITCALLS \ | 576 | #define INITCALLS \ |
436 | *(.initcallearly.init) \ | 577 | *(.initcallearly.init) \ |
437 | VMLINUX_SYMBOL(__early_initcall_end) = .; \ | 578 | VMLINUX_SYMBOL(__early_initcall_end) = .; \ |
@@ -453,6 +594,31 @@ | |||
453 | *(.initcall7.init) \ | 594 | *(.initcall7.init) \ |
454 | *(.initcall7s.init) | 595 | *(.initcall7s.init) |
455 | 596 | ||
597 | #define INIT_CALLS \ | ||
598 | VMLINUX_SYMBOL(__initcall_start) = .; \ | ||
599 | INITCALLS \ | ||
600 | VMLINUX_SYMBOL(__initcall_end) = .; | ||
601 | |||
602 | #define CON_INITCALL \ | ||
603 | VMLINUX_SYMBOL(__con_initcall_start) = .; \ | ||
604 | *(.con_initcall.init) \ | ||
605 | VMLINUX_SYMBOL(__con_initcall_end) = .; | ||
606 | |||
607 | #define SECURITY_INITCALL \ | ||
608 | VMLINUX_SYMBOL(__security_initcall_start) = .; \ | ||
609 | *(.security_initcall.init) \ | ||
610 | VMLINUX_SYMBOL(__security_initcall_end) = .; | ||
611 | |||
612 | #ifdef CONFIG_BLK_DEV_INITRD | ||
613 | #define INIT_RAM_FS \ | ||
614 | . = ALIGN(PAGE_SIZE); \ | ||
615 | VMLINUX_SYMBOL(__initramfs_start) = .; \ | ||
616 | *(.init.ramfs) \ | ||
617 | VMLINUX_SYMBOL(__initramfs_end) = .; | ||
618 | #else | ||
619 | #define INITRAMFS | ||
620 | #endif | ||
621 | |||
456 | /** | 622 | /** |
457 | * PERCPU_VADDR - define output section for percpu area | 623 | * PERCPU_VADDR - define output section for percpu area |
458 | * @vaddr: explicit base address (optional) | 624 | * @vaddr: explicit base address (optional) |
@@ -509,3 +675,58 @@ | |||
509 | *(.data.percpu.shared_aligned) \ | 675 | *(.data.percpu.shared_aligned) \ |
510 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ | 676 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ |
511 | } | 677 | } |
678 | |||
679 | |||
680 | /* | ||
681 | * Definition of the high level *_SECTION macros | ||
682 | * They will fit only a subset of the architectures | ||
683 | */ | ||
684 | |||
685 | |||
686 | /* | ||
687 | * Writeable data. | ||
688 | * All sections are combined in a single .data section. | ||
689 | * The sections following CONSTRUCTORS are arranged so their | ||
690 | * typical alignment matches. | ||
691 | * A cacheline is typical/always less than a PAGE_SIZE so | ||
692 | * the sections that has this restriction (or similar) | ||
693 | * is located before the ones requiring PAGE_SIZE alignment. | ||
694 | * NOSAVE_DATA starts and ends with a PAGE_SIZE alignment which | ||
695 | * matches the requirment of PAGE_ALIGNED_DATA. | ||
696 | * | ||
697 | * use 0 as page_align if page_aligned data is not used */ | ||
698 | #define RW_DATA_SECTION(cacheline, nosave, pagealigned, inittask) \ | ||
699 | . = ALIGN(PAGE_SIZE); \ | ||
700 | .data : AT(ADDR(.data) - LOAD_OFFSET) { \ | ||
701 | INIT_TASK(inittask) \ | ||
702 | CACHELINE_ALIGNED_DATA(cacheline) \ | ||
703 | READ_MOSTLY_DATA(cacheline) \ | ||
704 | DATA_DATA \ | ||
705 | CONSTRUCTORS \ | ||
706 | NOSAVE_DATA(nosave) \ | ||
707 | PAGE_ALIGNED_DATA(pagealigned) \ | ||
708 | } | ||
709 | |||
710 | #define INIT_TEXT_SECTION(inittext_align) \ | ||
711 | . = ALIGN(inittext_align); \ | ||
712 | .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) { \ | ||
713 | VMLINUX_SYMBOL(_sinittext) = .; \ | ||
714 | INIT_TEXT \ | ||
715 | VMLINUX_SYMBOL(_einittext) = .; \ | ||
716 | } | ||
717 | |||
718 | #define INIT_DATA_SECTION(initsetup_align) \ | ||
719 | .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { \ | ||
720 | INIT_DATA \ | ||
721 | INIT_SETUP(initsetup_align) \ | ||
722 | INIT_CALLS \ | ||
723 | CON_INITCALL \ | ||
724 | SECURITY_INITCALL \ | ||
725 | INIT_RAM_FS \ | ||
726 | } | ||
727 | |||
728 | #define BSS_SECTION(sbss_align, bss_align) \ | ||
729 | SBSS \ | ||
730 | BSS(bss_align) \ | ||
731 | . = ALIGN(4); | ||
732 | |||
diff --git a/include/linux/init.h b/include/linux/init.h index 0e06c176f18..b2189803f19 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -2,8 +2,6 @@ | |||
2 | #define _LINUX_INIT_H | 2 | #define _LINUX_INIT_H |
3 | 3 | ||
4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
5 | #include <linux/section-names.h> | ||
6 | #include <linux/stringify.h> | ||
7 | 5 | ||
8 | /* These macros are used to mark some functions or | 6 | /* These macros are used to mark some functions or |
9 | * initialized data (doesn't apply to uninitialized data) | 7 | * initialized data (doesn't apply to uninitialized data) |
@@ -101,7 +99,7 @@ | |||
101 | #define __memexitconst __section(.memexit.rodata) | 99 | #define __memexitconst __section(.memexit.rodata) |
102 | 100 | ||
103 | /* For assembly routines */ | 101 | /* For assembly routines */ |
104 | #define __HEAD .section __stringify(HEAD_TEXT_SECTION),"ax" | 102 | #define __HEAD .section ".head.text","ax" |
105 | #define __INIT .section ".init.text","ax" | 103 | #define __INIT .section ".init.text","ax" |
106 | #define __FINIT .previous | 104 | #define __FINIT .previous |
107 | 105 | ||
@@ -225,7 +223,8 @@ struct obs_kernel_param { | |||
225 | * obs_kernel_param "array" too far apart in .init.setup. | 223 | * obs_kernel_param "array" too far apart in .init.setup. |
226 | */ | 224 | */ |
227 | #define __setup_param(str, unique_id, fn, early) \ | 225 | #define __setup_param(str, unique_id, fn, early) \ |
228 | static char __setup_str_##unique_id[] __initdata __aligned(1) = str; \ | 226 | static const char __setup_str_##unique_id[] __initconst \ |
227 | __aligned(1) = str; \ | ||
229 | static struct obs_kernel_param __setup_##unique_id \ | 228 | static struct obs_kernel_param __setup_##unique_id \ |
230 | __used __section(.init.setup) \ | 229 | __used __section(.init.setup) \ |
231 | __attribute__((aligned((sizeof(long))))) \ | 230 | __attribute__((aligned((sizeof(long))))) \ |
diff --git a/include/linux/section-names.h b/include/linux/section-names.h deleted file mode 100644 index c956f4eb2ad..00000000000 --- a/include/linux/section-names.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __LINUX_SECTION_NAMES_H | ||
2 | #define __LINUX_SECTION_NAMES_H | ||
3 | |||
4 | #define HEAD_TEXT_SECTION .head.text | ||
5 | |||
6 | #endif /* !__LINUX_SECTION_NAMES_H */ | ||
diff --git a/init/Kconfig b/init/Kconfig index d3a50967c33..fed6dc31b0d 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -809,14 +809,6 @@ config KALLSYMS_EXTRA_PASS | |||
809 | you wait for kallsyms to be fixed. | 809 | you wait for kallsyms to be fixed. |
810 | 810 | ||
811 | 811 | ||
812 | config STRIP_ASM_SYMS | ||
813 | bool "Strip assembler-generated symbols during link" | ||
814 | default n | ||
815 | help | ||
816 | Strip internal assembler-generated symbols during a link (symbols | ||
817 | that look like '.Lxxx') so they don't pollute the output of | ||
818 | get_wchan() and suchlike. | ||
819 | |||
820 | config HOTPLUG | 812 | config HOTPLUG |
821 | bool "Support for hot-pluggable devices" if EMBEDDED | 813 | bool "Support for hot-pluggable devices" if EMBEDDED |
822 | default y | 814 | default y |
@@ -998,6 +990,14 @@ config SLUB_DEBUG | |||
998 | SLUB sysfs support. /sys/slab will not exist and there will be | 990 | SLUB sysfs support. /sys/slab will not exist and there will be |
999 | no support for cache validation etc. | 991 | no support for cache validation etc. |
1000 | 992 | ||
993 | config STRIP_ASM_SYMS | ||
994 | bool "Strip assembler-generated symbols during link" | ||
995 | default n | ||
996 | help | ||
997 | Strip internal assembler-generated symbols during a link (symbols | ||
998 | that look like '.Lxxx') so they don't pollute the output of | ||
999 | get_wchan() and suchlike. | ||
1000 | |||
1001 | config COMPAT_BRK | 1001 | config COMPAT_BRK |
1002 | bool "Disable heap randomization" | 1002 | bool "Disable heap randomization" |
1003 | default y | 1003 | default y |
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index 374faf9bfdc..3a29dbe7898 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c | |||
@@ -30,12 +30,16 @@ | |||
30 | #define all_var 0 | 30 | #define all_var 0 |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | /* These will be re-linked against their real values during the second link stage */ | 33 | /* |
34 | * These will be re-linked against their real values | ||
35 | * during the second link stage. | ||
36 | */ | ||
34 | extern const unsigned long kallsyms_addresses[] __attribute__((weak)); | 37 | extern const unsigned long kallsyms_addresses[] __attribute__((weak)); |
35 | extern const u8 kallsyms_names[] __attribute__((weak)); | 38 | extern const u8 kallsyms_names[] __attribute__((weak)); |
36 | 39 | ||
37 | /* tell the compiler that the count isn't in the small data section if the arch | 40 | /* |
38 | * has one (eg: FRV) | 41 | * Tell the compiler that the count isn't in the small data section if the arch |
42 | * has one (eg: FRV). | ||
39 | */ | 43 | */ |
40 | extern const unsigned long kallsyms_num_syms | 44 | extern const unsigned long kallsyms_num_syms |
41 | __attribute__((weak, section(".rodata"))); | 45 | __attribute__((weak, section(".rodata"))); |
@@ -75,31 +79,37 @@ static int is_ksym_addr(unsigned long addr) | |||
75 | return is_kernel_text(addr) || is_kernel_inittext(addr); | 79 | return is_kernel_text(addr) || is_kernel_inittext(addr); |
76 | } | 80 | } |
77 | 81 | ||
78 | /* expand a compressed symbol data into the resulting uncompressed string, | 82 | /* |
79 | given the offset to where the symbol is in the compressed stream */ | 83 | * Expand a compressed symbol data into the resulting uncompressed string, |
84 | * given the offset to where the symbol is in the compressed stream. | ||
85 | */ | ||
80 | static unsigned int kallsyms_expand_symbol(unsigned int off, char *result) | 86 | static unsigned int kallsyms_expand_symbol(unsigned int off, char *result) |
81 | { | 87 | { |
82 | int len, skipped_first = 0; | 88 | int len, skipped_first = 0; |
83 | const u8 *tptr, *data; | 89 | const u8 *tptr, *data; |
84 | 90 | ||
85 | /* get the compressed symbol length from the first symbol byte */ | 91 | /* Get the compressed symbol length from the first symbol byte. */ |
86 | data = &kallsyms_names[off]; | 92 | data = &kallsyms_names[off]; |
87 | len = *data; | 93 | len = *data; |
88 | data++; | 94 | data++; |
89 | 95 | ||
90 | /* update the offset to return the offset for the next symbol on | 96 | /* |
91 | * the compressed stream */ | 97 | * Update the offset to return the offset for the next symbol on |
98 | * the compressed stream. | ||
99 | */ | ||
92 | off += len + 1; | 100 | off += len + 1; |
93 | 101 | ||
94 | /* for every byte on the compressed symbol data, copy the table | 102 | /* |
95 | entry for that byte */ | 103 | * For every byte on the compressed symbol data, copy the table |
96 | while(len) { | 104 | * entry for that byte. |
97 | tptr = &kallsyms_token_table[ kallsyms_token_index[*data] ]; | 105 | */ |
106 | while (len) { | ||
107 | tptr = &kallsyms_token_table[kallsyms_token_index[*data]]; | ||
98 | data++; | 108 | data++; |
99 | len--; | 109 | len--; |
100 | 110 | ||
101 | while (*tptr) { | 111 | while (*tptr) { |
102 | if(skipped_first) { | 112 | if (skipped_first) { |
103 | *result = *tptr; | 113 | *result = *tptr; |
104 | result++; | 114 | result++; |
105 | } else | 115 | } else |
@@ -110,36 +120,46 @@ static unsigned int kallsyms_expand_symbol(unsigned int off, char *result) | |||
110 | 120 | ||
111 | *result = '\0'; | 121 | *result = '\0'; |
112 | 122 | ||
113 | /* return to offset to the next symbol */ | 123 | /* Return to offset to the next symbol. */ |
114 | return off; | 124 | return off; |
115 | } | 125 | } |
116 | 126 | ||
117 | /* get symbol type information. This is encoded as a single char at the | 127 | /* |
118 | * begining of the symbol name */ | 128 | * Get symbol type information. This is encoded as a single char at the |
129 | * beginning of the symbol name. | ||
130 | */ | ||
119 | static char kallsyms_get_symbol_type(unsigned int off) | 131 | static char kallsyms_get_symbol_type(unsigned int off) |
120 | { | 132 | { |
121 | /* get just the first code, look it up in the token table, and return the | 133 | /* |
122 | * first char from this token */ | 134 | * Get just the first code, look it up in the token table, |
123 | return kallsyms_token_table[ kallsyms_token_index[ kallsyms_names[off+1] ] ]; | 135 | * and return the first char from this token. |
136 | */ | ||
137 | return kallsyms_token_table[kallsyms_token_index[kallsyms_names[off + 1]]]; | ||
124 | } | 138 | } |
125 | 139 | ||
126 | 140 | ||
127 | /* find the offset on the compressed stream given and index in the | 141 | /* |
128 | * kallsyms array */ | 142 | * Find the offset on the compressed stream given and index in the |
143 | * kallsyms array. | ||
144 | */ | ||
129 | static unsigned int get_symbol_offset(unsigned long pos) | 145 | static unsigned int get_symbol_offset(unsigned long pos) |
130 | { | 146 | { |
131 | const u8 *name; | 147 | const u8 *name; |
132 | int i; | 148 | int i; |
133 | 149 | ||
134 | /* use the closest marker we have. We have markers every 256 positions, | 150 | /* |
135 | * so that should be close enough */ | 151 | * Use the closest marker we have. We have markers every 256 positions, |
136 | name = &kallsyms_names[ kallsyms_markers[pos>>8] ]; | 152 | * so that should be close enough. |
153 | */ | ||
154 | name = &kallsyms_names[kallsyms_markers[pos >> 8]]; | ||
137 | 155 | ||
138 | /* sequentially scan all the symbols up to the point we're searching for. | 156 | /* |
139 | * Every symbol is stored in a [<len>][<len> bytes of data] format, so we | 157 | * Sequentially scan all the symbols up to the point we're searching |
140 | * just need to add the len to the current pointer for every symbol we | 158 | * for. Every symbol is stored in a [<len>][<len> bytes of data] format, |
141 | * wish to skip */ | 159 | * so we just need to add the len to the current pointer for every |
142 | for(i = 0; i < (pos&0xFF); i++) | 160 | * symbol we wish to skip. |
161 | */ | ||
162 | for (i = 0; i < (pos & 0xFF); i++) | ||
143 | name = name + (*name) + 1; | 163 | name = name + (*name) + 1; |
144 | 164 | ||
145 | return name - kallsyms_names; | 165 | return name - kallsyms_names; |
@@ -190,7 +210,7 @@ static unsigned long get_symbol_pos(unsigned long addr, | |||
190 | /* This kernel should never had been booted. */ | 210 | /* This kernel should never had been booted. */ |
191 | BUG_ON(!kallsyms_addresses); | 211 | BUG_ON(!kallsyms_addresses); |
192 | 212 | ||
193 | /* do a binary search on the sorted kallsyms_addresses array */ | 213 | /* Do a binary search on the sorted kallsyms_addresses array. */ |
194 | low = 0; | 214 | low = 0; |
195 | high = kallsyms_num_syms; | 215 | high = kallsyms_num_syms; |
196 | 216 | ||
@@ -203,15 +223,15 @@ static unsigned long get_symbol_pos(unsigned long addr, | |||
203 | } | 223 | } |
204 | 224 | ||
205 | /* | 225 | /* |
206 | * search for the first aliased symbol. Aliased | 226 | * Search for the first aliased symbol. Aliased |
207 | * symbols are symbols with the same address | 227 | * symbols are symbols with the same address. |
208 | */ | 228 | */ |
209 | while (low && kallsyms_addresses[low-1] == kallsyms_addresses[low]) | 229 | while (low && kallsyms_addresses[low-1] == kallsyms_addresses[low]) |
210 | --low; | 230 | --low; |
211 | 231 | ||
212 | symbol_start = kallsyms_addresses[low]; | 232 | symbol_start = kallsyms_addresses[low]; |
213 | 233 | ||
214 | /* Search for next non-aliased symbol */ | 234 | /* Search for next non-aliased symbol. */ |
215 | for (i = low + 1; i < kallsyms_num_syms; i++) { | 235 | for (i = low + 1; i < kallsyms_num_syms; i++) { |
216 | if (kallsyms_addresses[i] > symbol_start) { | 236 | if (kallsyms_addresses[i] > symbol_start) { |
217 | symbol_end = kallsyms_addresses[i]; | 237 | symbol_end = kallsyms_addresses[i]; |
@@ -219,7 +239,7 @@ static unsigned long get_symbol_pos(unsigned long addr, | |||
219 | } | 239 | } |
220 | } | 240 | } |
221 | 241 | ||
222 | /* if we found no next symbol, we use the end of the section */ | 242 | /* If we found no next symbol, we use the end of the section. */ |
223 | if (!symbol_end) { | 243 | if (!symbol_end) { |
224 | if (is_kernel_inittext(addr)) | 244 | if (is_kernel_inittext(addr)) |
225 | symbol_end = (unsigned long)_einittext; | 245 | symbol_end = (unsigned long)_einittext; |
@@ -252,10 +272,10 @@ int kallsyms_lookup_size_offset(unsigned long addr, unsigned long *symbolsize, | |||
252 | 272 | ||
253 | /* | 273 | /* |
254 | * Lookup an address | 274 | * Lookup an address |
255 | * - modname is set to NULL if it's in the kernel | 275 | * - modname is set to NULL if it's in the kernel. |
256 | * - we guarantee that the returned name is valid until we reschedule even if | 276 | * - We guarantee that the returned name is valid until we reschedule even if. |
257 | * it resides in a module | 277 | * It resides in a module. |
258 | * - we also guarantee that modname will be valid until rescheduled | 278 | * - We also guarantee that modname will be valid until rescheduled. |
259 | */ | 279 | */ |
260 | const char *kallsyms_lookup(unsigned long addr, | 280 | const char *kallsyms_lookup(unsigned long addr, |
261 | unsigned long *symbolsize, | 281 | unsigned long *symbolsize, |
@@ -276,7 +296,7 @@ const char *kallsyms_lookup(unsigned long addr, | |||
276 | return namebuf; | 296 | return namebuf; |
277 | } | 297 | } |
278 | 298 | ||
279 | /* see if it's in a module */ | 299 | /* See if it's in a module. */ |
280 | return module_address_lookup(addr, symbolsize, offset, modname, | 300 | return module_address_lookup(addr, symbolsize, offset, modname, |
281 | namebuf); | 301 | namebuf); |
282 | } | 302 | } |
@@ -294,7 +314,7 @@ int lookup_symbol_name(unsigned long addr, char *symname) | |||
294 | kallsyms_expand_symbol(get_symbol_offset(pos), symname); | 314 | kallsyms_expand_symbol(get_symbol_offset(pos), symname); |
295 | return 0; | 315 | return 0; |
296 | } | 316 | } |
297 | /* see if it's in a module */ | 317 | /* See if it's in a module. */ |
298 | return lookup_module_symbol_name(addr, symname); | 318 | return lookup_module_symbol_name(addr, symname); |
299 | } | 319 | } |
300 | 320 | ||
@@ -313,7 +333,7 @@ int lookup_symbol_attrs(unsigned long addr, unsigned long *size, | |||
313 | modname[0] = '\0'; | 333 | modname[0] = '\0'; |
314 | return 0; | 334 | return 0; |
315 | } | 335 | } |
316 | /* see if it's in a module */ | 336 | /* See if it's in a module. */ |
317 | return lookup_module_symbol_attrs(addr, size, offset, modname, name); | 337 | return lookup_module_symbol_attrs(addr, size, offset, modname, name); |
318 | } | 338 | } |
319 | 339 | ||
@@ -342,6 +362,7 @@ int sprint_symbol(char *buffer, unsigned long address) | |||
342 | 362 | ||
343 | return len; | 363 | return len; |
344 | } | 364 | } |
365 | EXPORT_SYMBOL_GPL(sprint_symbol); | ||
345 | 366 | ||
346 | /* Look up a kernel symbol and print it to the kernel messages. */ | 367 | /* Look up a kernel symbol and print it to the kernel messages. */ |
347 | void __print_symbol(const char *fmt, unsigned long address) | 368 | void __print_symbol(const char *fmt, unsigned long address) |
@@ -352,13 +373,13 @@ void __print_symbol(const char *fmt, unsigned long address) | |||
352 | 373 | ||
353 | printk(fmt, buffer); | 374 | printk(fmt, buffer); |
354 | } | 375 | } |
376 | EXPORT_SYMBOL(__print_symbol); | ||
355 | 377 | ||
356 | /* To avoid using get_symbol_offset for every symbol, we carry prefix along. */ | 378 | /* To avoid using get_symbol_offset for every symbol, we carry prefix along. */ |
357 | struct kallsym_iter | 379 | struct kallsym_iter { |
358 | { | ||
359 | loff_t pos; | 380 | loff_t pos; |
360 | unsigned long value; | 381 | unsigned long value; |
361 | unsigned int nameoff; /* If iterating in core kernel symbols */ | 382 | unsigned int nameoff; /* If iterating in core kernel symbols. */ |
362 | char type; | 383 | char type; |
363 | char name[KSYM_NAME_LEN]; | 384 | char name[KSYM_NAME_LEN]; |
364 | char module_name[MODULE_NAME_LEN]; | 385 | char module_name[MODULE_NAME_LEN]; |
@@ -404,7 +425,7 @@ static int update_iter(struct kallsym_iter *iter, loff_t pos) | |||
404 | iter->pos = pos; | 425 | iter->pos = pos; |
405 | return get_ksymbol_mod(iter); | 426 | return get_ksymbol_mod(iter); |
406 | } | 427 | } |
407 | 428 | ||
408 | /* If we're not on the desired position, reset to new position. */ | 429 | /* If we're not on the desired position, reset to new position. */ |
409 | if (pos != iter->pos) | 430 | if (pos != iter->pos) |
410 | reset_iter(iter, pos); | 431 | reset_iter(iter, pos); |
@@ -439,23 +460,25 @@ static int s_show(struct seq_file *m, void *p) | |||
439 | { | 460 | { |
440 | struct kallsym_iter *iter = m->private; | 461 | struct kallsym_iter *iter = m->private; |
441 | 462 | ||
442 | /* Some debugging symbols have no name. Ignore them. */ | 463 | /* Some debugging symbols have no name. Ignore them. */ |
443 | if (!iter->name[0]) | 464 | if (!iter->name[0]) |
444 | return 0; | 465 | return 0; |
445 | 466 | ||
446 | if (iter->module_name[0]) { | 467 | if (iter->module_name[0]) { |
447 | char type; | 468 | char type; |
448 | 469 | ||
449 | /* Label it "global" if it is exported, | 470 | /* |
450 | * "local" if not exported. */ | 471 | * Label it "global" if it is exported, |
472 | * "local" if not exported. | ||
473 | */ | ||
451 | type = iter->exported ? toupper(iter->type) : | 474 | type = iter->exported ? toupper(iter->type) : |
452 | tolower(iter->type); | 475 | tolower(iter->type); |
453 | seq_printf(m, "%0*lx %c %s\t[%s]\n", | 476 | seq_printf(m, "%0*lx %c %s\t[%s]\n", |
454 | (int)(2*sizeof(void*)), | 477 | (int)(2 * sizeof(void *)), |
455 | iter->value, type, iter->name, iter->module_name); | 478 | iter->value, type, iter->name, iter->module_name); |
456 | } else | 479 | } else |
457 | seq_printf(m, "%0*lx %c %s\n", | 480 | seq_printf(m, "%0*lx %c %s\n", |
458 | (int)(2*sizeof(void*)), | 481 | (int)(2 * sizeof(void *)), |
459 | iter->value, iter->type, iter->name); | 482 | iter->value, iter->type, iter->name); |
460 | return 0; | 483 | return 0; |
461 | } | 484 | } |
@@ -469,9 +492,11 @@ static const struct seq_operations kallsyms_op = { | |||
469 | 492 | ||
470 | static int kallsyms_open(struct inode *inode, struct file *file) | 493 | static int kallsyms_open(struct inode *inode, struct file *file) |
471 | { | 494 | { |
472 | /* We keep iterator in m->private, since normal case is to | 495 | /* |
496 | * We keep iterator in m->private, since normal case is to | ||
473 | * s_start from where we left off, so we avoid doing | 497 | * s_start from where we left off, so we avoid doing |
474 | * using get_symbol_offset for every symbol */ | 498 | * using get_symbol_offset for every symbol. |
499 | */ | ||
475 | struct kallsym_iter *iter; | 500 | struct kallsym_iter *iter; |
476 | int ret; | 501 | int ret; |
477 | 502 | ||
@@ -500,7 +525,4 @@ static int __init kallsyms_init(void) | |||
500 | proc_create("kallsyms", 0444, NULL, &kallsyms_operations); | 525 | proc_create("kallsyms", 0444, NULL, &kallsyms_operations); |
501 | return 0; | 526 | return 0; |
502 | } | 527 | } |
503 | __initcall(kallsyms_init); | 528 | device_initcall(kallsyms_init); |
504 | |||
505 | EXPORT_SYMBOL(__print_symbol); | ||
506 | EXPORT_SYMBOL_GPL(sprint_symbol); | ||
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst index 095cfc8b9db..0fcd8383877 100644 --- a/scripts/Makefile.headersinst +++ b/scripts/Makefile.headersinst | |||
@@ -54,8 +54,12 @@ quiet_cmd_remove = REMOVE $(unwanted) | |||
54 | cmd_remove = rm -f $(unwanted-file) | 54 | cmd_remove = rm -f $(unwanted-file) |
55 | 55 | ||
56 | quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files) | 56 | quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files) |
57 | cmd_check = $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH) \ | 57 | # Headers list can be pretty long, xargs helps to avoid |
58 | $(addprefix $(install)/, $(all-files)); \ | 58 | # the "Argument list too long" error. |
59 | cmd_check = for f in $(all-files); do \ | ||
60 | echo "$(install)/$${f}"; done \ | ||
61 | | xargs \ | ||
62 | $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH); \ | ||
59 | touch $@ | 63 | touch $@ |
60 | 64 | ||
61 | PHONY += __headersinst __headerscheck | 65 | PHONY += __headersinst __headerscheck |
diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c index 35bdc68b6e6..4c9523ef9c0 100644 --- a/scripts/basic/docproc.c +++ b/scripts/basic/docproc.c | |||
@@ -69,7 +69,7 @@ FILELINE * docsection; | |||
69 | #define NOFUNCTION "-nofunction" | 69 | #define NOFUNCTION "-nofunction" |
70 | #define NODOCSECTIONS "-no-doc-sections" | 70 | #define NODOCSECTIONS "-no-doc-sections" |
71 | 71 | ||
72 | char *srctree; | 72 | static char *srctree, *kernsrctree; |
73 | 73 | ||
74 | void usage (void) | 74 | void usage (void) |
75 | { | 75 | { |
@@ -77,7 +77,8 @@ void usage (void) | |||
77 | fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n"); | 77 | fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n"); |
78 | fprintf(stderr, "doc: frontend when generating kernel documentation\n"); | 78 | fprintf(stderr, "doc: frontend when generating kernel documentation\n"); |
79 | fprintf(stderr, "depend: generate list of files referenced within file\n"); | 79 | fprintf(stderr, "depend: generate list of files referenced within file\n"); |
80 | fprintf(stderr, "Environment variable SRCTREE: absolute path to kernel source tree.\n"); | 80 | fprintf(stderr, "Environment variable SRCTREE: absolute path to sources.\n"); |
81 | fprintf(stderr, " KBUILD_SRC: absolute path to kernel source tree.\n"); | ||
81 | } | 82 | } |
82 | 83 | ||
83 | /* | 84 | /* |
@@ -96,8 +97,8 @@ void exec_kernel_doc(char **svec) | |||
96 | exit(1); | 97 | exit(1); |
97 | case 0: | 98 | case 0: |
98 | memset(real_filename, 0, sizeof(real_filename)); | 99 | memset(real_filename, 0, sizeof(real_filename)); |
99 | strncat(real_filename, srctree, PATH_MAX); | 100 | strncat(real_filename, kernsrctree, PATH_MAX); |
100 | strncat(real_filename, KERNELDOCPATH KERNELDOC, | 101 | strncat(real_filename, "/" KERNELDOCPATH KERNELDOC, |
101 | PATH_MAX - strlen(real_filename)); | 102 | PATH_MAX - strlen(real_filename)); |
102 | execvp(real_filename, svec); | 103 | execvp(real_filename, svec); |
103 | fprintf(stderr, "exec "); | 104 | fprintf(stderr, "exec "); |
@@ -178,6 +179,7 @@ void find_export_symbols(char * filename) | |||
178 | char real_filename[PATH_MAX + 1]; | 179 | char real_filename[PATH_MAX + 1]; |
179 | memset(real_filename, 0, sizeof(real_filename)); | 180 | memset(real_filename, 0, sizeof(real_filename)); |
180 | strncat(real_filename, srctree, PATH_MAX); | 181 | strncat(real_filename, srctree, PATH_MAX); |
182 | strncat(real_filename, "/", PATH_MAX - strlen(real_filename)); | ||
181 | strncat(real_filename, filename, | 183 | strncat(real_filename, filename, |
182 | PATH_MAX - strlen(real_filename)); | 184 | PATH_MAX - strlen(real_filename)); |
183 | sym = add_new_file(filename); | 185 | sym = add_new_file(filename); |
@@ -382,6 +384,9 @@ int main(int argc, char *argv[]) | |||
382 | srctree = getenv("SRCTREE"); | 384 | srctree = getenv("SRCTREE"); |
383 | if (!srctree) | 385 | if (!srctree) |
384 | srctree = getcwd(NULL, 0); | 386 | srctree = getcwd(NULL, 0); |
387 | kernsrctree = getenv("KBUILD_SRC"); | ||
388 | if (!kernsrctree) | ||
389 | kernsrctree = srctree; | ||
385 | if (argc != 3) { | 390 | if (argc != 3) { |
386 | usage(); | 391 | usage(); |
387 | exit(1); | 392 | exit(1); |
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 8912c0f5460..72c15205bb2 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c | |||
@@ -373,10 +373,11 @@ void print_deps(void) | |||
373 | void traps(void) | 373 | void traps(void) |
374 | { | 374 | { |
375 | static char test[] __attribute__((aligned(sizeof(int)))) = "CONF"; | 375 | static char test[] __attribute__((aligned(sizeof(int)))) = "CONF"; |
376 | int *p = (int *)test; | ||
376 | 377 | ||
377 | if (*(int *)test != INT_CONF) { | 378 | if (*p != INT_CONF) { |
378 | fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", | 379 | fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", |
379 | *(int *)test); | 380 | *p); |
380 | exit(2); | 381 | exit(2); |
381 | } | 382 | } |
382 | } | 383 | } |
diff --git a/scripts/config b/scripts/config index db6084b78a1..608d7fdb13e 100755 --- a/scripts/config +++ b/scripts/config | |||
@@ -9,8 +9,10 @@ config options command ... | |||
9 | commands: | 9 | commands: |
10 | --enable|-e option Enable option | 10 | --enable|-e option Enable option |
11 | --disable|-d option Disable option | 11 | --disable|-d option Disable option |
12 | --module|-m option Turn option into a module | 12 | --module|-m option Turn option into a module |
13 | --state|-s option Print state of option (n,y,m,undef) | 13 | --set-str option value |
14 | Set option to "value" | ||
15 | --state|-s option Print state of option (n,y,m,undef) | ||
14 | 16 | ||
15 | --enable-after|-E beforeopt option | 17 | --enable-after|-E beforeopt option |
16 | Enable option directly after other option | 18 | Enable option directly after other option |
@@ -26,8 +28,6 @@ options: | |||
26 | 28 | ||
27 | config doesn't check the validity of the .config file. This is done at next | 29 | config doesn't check the validity of the .config file. This is done at next |
28 | make time. | 30 | make time. |
29 | The options need to be already in the file before they can be changed, | ||
30 | but sometimes you can cheat with the --*-after options. | ||
31 | EOL | 31 | EOL |
32 | exit 1 | 32 | exit 1 |
33 | } | 33 | } |
@@ -45,8 +45,18 @@ checkarg() { | |||
45 | ARG="`echo $ARG | tr a-z A-Z`" | 45 | ARG="`echo $ARG | tr a-z A-Z`" |
46 | } | 46 | } |
47 | 47 | ||
48 | replace() { | 48 | set_var() { |
49 | sed -i -e "$@" $FN | 49 | local name=$1 new=$2 before=$3 |
50 | |||
51 | name_re="^($name=|# $name is not set)" | ||
52 | before_re="^($before=|# $before is not set)" | ||
53 | if test -n "$before" && grep -Eq "$before_re" "$FN"; then | ||
54 | sed -ri "/$before_re/a $new" "$FN" | ||
55 | elif grep -Eq "$name_re" "$FN"; then | ||
56 | sed -ri "s:$name_re.*:$new:" "$FN" | ||
57 | else | ||
58 | echo "$new" >>"$FN" | ||
59 | fi | ||
50 | } | 60 | } |
51 | 61 | ||
52 | if [ "$1" = "--file" ]; then | 62 | if [ "$1" = "--file" ]; then |
@@ -54,8 +64,7 @@ if [ "$1" = "--file" ]; then | |||
54 | if [ "$FN" = "" ] ; then | 64 | if [ "$FN" = "" ] ; then |
55 | usage | 65 | usage |
56 | fi | 66 | fi |
57 | shift | 67 | shift 2 |
58 | shift | ||
59 | else | 68 | else |
60 | FN=.config | 69 | FN=.config |
61 | fi | 70 | fi |
@@ -68,27 +77,39 @@ while [ "$1" != "" ] ; do | |||
68 | CMD="$1" | 77 | CMD="$1" |
69 | shift | 78 | shift |
70 | case "$CMD" in | 79 | case "$CMD" in |
71 | --enable|-e) | 80 | --refresh) |
81 | ;; | ||
82 | --*-after) | ||
83 | checkarg "$1" | ||
84 | A=$ARG | ||
85 | checkarg "$2" | ||
86 | B=$ARG | ||
87 | shift 2 | ||
88 | ;; | ||
89 | --*) | ||
72 | checkarg "$1" | 90 | checkarg "$1" |
73 | replace "s/# CONFIG_$ARG is not set/CONFIG_$ARG=y/" | ||
74 | shift | 91 | shift |
75 | ;; | 92 | ;; |
93 | esac | ||
94 | case "$CMD" in | ||
95 | --enable|-e) | ||
96 | set_var "CONFIG_$ARG" "CONFIG_$ARG=y" | ||
97 | ;; | ||
76 | 98 | ||
77 | --disable|-d) | 99 | --disable|-d) |
78 | checkarg "$1" | 100 | set_var "CONFIG_$ARG" "# CONFIG_$ARG is not set" |
79 | replace "s/CONFIG_$ARG=[my]/# CONFIG_$ARG is not set/" | ||
80 | shift | ||
81 | ;; | 101 | ;; |
82 | 102 | ||
83 | --module|-m) | 103 | --module|-m) |
84 | checkarg "$1" | 104 | set_var "CONFIG_$ARG" "CONFIG_$ARG=m" |
85 | replace "s/CONFIG_$ARG=y/CONFIG_$ARG=m/" \ | 105 | ;; |
86 | -e "s/# CONFIG_$ARG is not set/CONFIG_$ARG=m/" | 106 | |
107 | --set-str) | ||
108 | set_var "CONFIG_$ARG" "CONFIG_$ARG=\"$1\"" | ||
87 | shift | 109 | shift |
88 | ;; | 110 | ;; |
89 | 111 | ||
90 | --state|-s) | 112 | --state|-s) |
91 | checkarg "$1" | ||
92 | if grep -q "# CONFIG_$ARG is not set" $FN ; then | 113 | if grep -q "# CONFIG_$ARG is not set" $FN ; then |
93 | echo n | 114 | echo n |
94 | else | 115 | else |
@@ -101,44 +122,18 @@ while [ "$1" != "" ] ; do | |||
101 | echo "$V" | 122 | echo "$V" |
102 | fi | 123 | fi |
103 | fi | 124 | fi |
104 | shift | ||
105 | ;; | 125 | ;; |
106 | 126 | ||
107 | --enable-after|-E) | 127 | --enable-after|-E) |
108 | checkarg "$1" | 128 | set_var "CONFIG_$B" "CONFIG_$B=y" "CONFIG_$A" |
109 | A=$ARG | ||
110 | checkarg "$2" | ||
111 | B=$ARG | ||
112 | replace "/CONFIG_$A=[my]/aCONFIG_$B=y" \ | ||
113 | -e "/# CONFIG_$ARG is not set/a/CONFIG_$ARG=y" \ | ||
114 | -e "s/# CONFIG_$ARG is not set/CONFIG_$ARG=y/" | ||
115 | shift | ||
116 | shift | ||
117 | ;; | 129 | ;; |
118 | 130 | ||
119 | --disable-after|-D) | 131 | --disable-after|-D) |
120 | checkarg "$1" | 132 | set_var "CONFIG_$B" "# CONFIG_$B is not set" "CONFIG_$A" |
121 | A=$ARG | ||
122 | checkarg "$2" | ||
123 | B=$ARG | ||
124 | replace "/CONFIG_$A=[my]/a# CONFIG_$B is not set" \ | ||
125 | -e "/# CONFIG_$ARG is not set/a/# CONFIG_$ARG is not set" \ | ||
126 | -e "s/CONFIG_$ARG=[my]/# CONFIG_$ARG is not set/" | ||
127 | shift | ||
128 | shift | ||
129 | ;; | 133 | ;; |
130 | 134 | ||
131 | --module-after|-M) | 135 | --module-after|-M) |
132 | checkarg "$1" | 136 | set_var "CONFIG_$B" "CONFIG_$B=m" "CONFIG_$A" |
133 | A=$ARG | ||
134 | checkarg "$2" | ||
135 | B=$ARG | ||
136 | replace "/CONFIG_$A=[my]/aCONFIG_$B=m" \ | ||
137 | -e "/# CONFIG_$ARG is not set/a/CONFIG_$ARG=m" \ | ||
138 | -e "s/CONFIG_$ARG=y/CONFIG_$ARG=m/" \ | ||
139 | -e "s/# CONFIG_$ARG is not set/CONFIG_$ARG=m/" | ||
140 | shift | ||
141 | shift | ||
142 | ;; | 137 | ;; |
143 | 138 | ||
144 | # undocumented because it ignores --file (fixme) | 139 | # undocumented because it ignores --file (fixme) |
diff --git a/scripts/gcc-version.sh b/scripts/gcc-version.sh index cc767b388ba..debecb5561c 100644 --- a/scripts/gcc-version.sh +++ b/scripts/gcc-version.sh | |||
@@ -18,7 +18,7 @@ compiler="$*" | |||
18 | 18 | ||
19 | if [ ${#compiler} -eq 0 ]; then | 19 | if [ ${#compiler} -eq 0 ]; then |
20 | echo "Error: No compiler specified." | 20 | echo "Error: No compiler specified." |
21 | echo -e "Usage:\n\t$0 <gcc-command>" | 21 | printf "Usage:\n\t$0 <gcc-command>\n" |
22 | exit 1 | 22 | exit 1 |
23 | fi | 23 | fi |
24 | 24 | ||
diff --git a/scripts/headers.sh b/scripts/headers.sh index d33426f866d..0308ecc10d5 100755 --- a/scripts/headers.sh +++ b/scripts/headers.sh | |||
@@ -15,19 +15,12 @@ do_command() | |||
15 | fi | 15 | fi |
16 | } | 16 | } |
17 | 17 | ||
18 | # Do not try this architecture | ||
19 | drop="generic um ppc sparc64 cris" | ||
20 | |||
21 | archs=$(ls ${srctree}/arch) | 18 | archs=$(ls ${srctree}/arch) |
22 | 19 | ||
23 | for arch in ${archs}; do | 20 | for arch in ${archs}; do |
24 | case ${arch} in | 21 | case ${arch} in |
25 | um) # no userspace export | 22 | um) # no userspace export |
26 | ;; | 23 | ;; |
27 | ppc) # headers exported by powerpc | ||
28 | ;; | ||
29 | sparc64) # headers exported by sparc | ||
30 | ;; | ||
31 | cris) # headers export are known broken | 24 | cris) # headers export are known broken |
32 | ;; | 25 | ;; |
33 | *) | 26 | *) |
diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl index 56f90a48089..db1dd7a549f 100644 --- a/scripts/headers_check.pl +++ b/scripts/headers_check.pl | |||
@@ -2,7 +2,7 @@ | |||
2 | # | 2 | # |
3 | # headers_check.pl execute a number of trivial consistency checks | 3 | # headers_check.pl execute a number of trivial consistency checks |
4 | # | 4 | # |
5 | # Usage: headers_check.pl dir [files...] | 5 | # Usage: headers_check.pl dir arch [files...] |
6 | # dir: dir to look for included files | 6 | # dir: dir to look for included files |
7 | # arch: architecture | 7 | # arch: architecture |
8 | # files: list of files to check | 8 | # files: list of files to check |
@@ -37,7 +37,7 @@ foreach my $file (@files) { | |||
37 | &check_include(); | 37 | &check_include(); |
38 | &check_asm_types(); | 38 | &check_asm_types(); |
39 | &check_sizetypes(); | 39 | &check_sizetypes(); |
40 | &check_prototypes(); | 40 | &check_declarations(); |
41 | # Dropped for now. Too much noise &check_config(); | 41 | # Dropped for now. Too much noise &check_config(); |
42 | } | 42 | } |
43 | close FH; | 43 | close FH; |
@@ -61,16 +61,18 @@ sub check_include | |||
61 | } | 61 | } |
62 | } | 62 | } |
63 | 63 | ||
64 | sub check_prototypes | 64 | sub check_declarations |
65 | { | 65 | { |
66 | if ($line =~ m/^\s*extern\b/) { | 66 | if ($line =~m/^\s*extern\b/) { |
67 | printf STDERR "$filename:$lineno: extern's make no sense in userspace\n"; | 67 | printf STDERR "$filename:$lineno: " . |
68 | "userspace cannot call function or variable " . | ||
69 | "defined in the kernel\n"; | ||
68 | } | 70 | } |
69 | } | 71 | } |
70 | 72 | ||
71 | sub check_config | 73 | sub check_config |
72 | { | 74 | { |
73 | if ($line =~ m/[^a-zA-Z0-9_]+CONFIG_([a-zA-Z0-9]+)[^a-zA-Z0-9]/) { | 75 | if ($line =~ m/[^a-zA-Z0-9_]+CONFIG_([a-zA-Z0-9_]+)[^a-zA-Z0-9_]/) { |
74 | printf STDERR "$filename:$lineno: leaks CONFIG_$1 to userspace where it is not valid\n"; | 76 | printf STDERR "$filename:$lineno: leaks CONFIG_$1 to userspace where it is not valid\n"; |
75 | } | 77 | } |
76 | } | 78 | } |
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 6654cbed965..3cb57895c9e 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c | |||
@@ -23,6 +23,10 @@ | |||
23 | #include <string.h> | 23 | #include <string.h> |
24 | #include <ctype.h> | 24 | #include <ctype.h> |
25 | 25 | ||
26 | #ifndef ARRAY_SIZE | ||
27 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) | ||
28 | #endif | ||
29 | |||
26 | #define KSYM_NAME_LEN 128 | 30 | #define KSYM_NAME_LEN 128 |
27 | 31 | ||
28 | struct sym_entry { | 32 | struct sym_entry { |
@@ -32,9 +36,23 @@ struct sym_entry { | |||
32 | unsigned char *sym; | 36 | unsigned char *sym; |
33 | }; | 37 | }; |
34 | 38 | ||
39 | struct text_range { | ||
40 | const char *stext, *etext; | ||
41 | unsigned long long start, end; | ||
42 | }; | ||
43 | |||
44 | static unsigned long long _text; | ||
45 | static struct text_range text_ranges[] = { | ||
46 | { "_stext", "_etext" }, | ||
47 | { "_sinittext", "_einittext" }, | ||
48 | { "_stext_l1", "_etext_l1" }, /* Blackfin on-chip L1 inst SRAM */ | ||
49 | { "_stext_l2", "_etext_l2" }, /* Blackfin on-chip L2 SRAM */ | ||
50 | }; | ||
51 | #define text_range_text (&text_ranges[0]) | ||
52 | #define text_range_inittext (&text_ranges[1]) | ||
53 | |||
35 | static struct sym_entry *table; | 54 | static struct sym_entry *table; |
36 | static unsigned int table_size, table_cnt; | 55 | static unsigned int table_size, table_cnt; |
37 | static unsigned long long _text, _stext, _etext, _sinittext, _einittext; | ||
38 | static int all_symbols = 0; | 56 | static int all_symbols = 0; |
39 | static char symbol_prefix_char = '\0'; | 57 | static char symbol_prefix_char = '\0'; |
40 | 58 | ||
@@ -61,6 +79,26 @@ static inline int is_arm_mapping_symbol(const char *str) | |||
61 | && (str[2] == '\0' || str[2] == '.'); | 79 | && (str[2] == '\0' || str[2] == '.'); |
62 | } | 80 | } |
63 | 81 | ||
82 | static int read_symbol_tr(const char *sym, unsigned long long addr) | ||
83 | { | ||
84 | size_t i; | ||
85 | struct text_range *tr; | ||
86 | |||
87 | for (i = 0; i < ARRAY_SIZE(text_ranges); ++i) { | ||
88 | tr = &text_ranges[i]; | ||
89 | |||
90 | if (strcmp(sym, tr->stext) == 0) { | ||
91 | tr->start = addr; | ||
92 | return 0; | ||
93 | } else if (strcmp(sym, tr->etext) == 0) { | ||
94 | tr->end = addr; | ||
95 | return 0; | ||
96 | } | ||
97 | } | ||
98 | |||
99 | return 1; | ||
100 | } | ||
101 | |||
64 | static int read_symbol(FILE *in, struct sym_entry *s) | 102 | static int read_symbol(FILE *in, struct sym_entry *s) |
65 | { | 103 | { |
66 | char str[500]; | 104 | char str[500]; |
@@ -84,14 +122,8 @@ static int read_symbol(FILE *in, struct sym_entry *s) | |||
84 | /* Ignore most absolute/undefined (?) symbols. */ | 122 | /* Ignore most absolute/undefined (?) symbols. */ |
85 | if (strcmp(sym, "_text") == 0) | 123 | if (strcmp(sym, "_text") == 0) |
86 | _text = s->addr; | 124 | _text = s->addr; |
87 | else if (strcmp(sym, "_stext") == 0) | 125 | else if (read_symbol_tr(sym, s->addr) == 0) |
88 | _stext = s->addr; | 126 | /* nothing to do */; |
89 | else if (strcmp(sym, "_etext") == 0) | ||
90 | _etext = s->addr; | ||
91 | else if (strcmp(sym, "_sinittext") == 0) | ||
92 | _sinittext = s->addr; | ||
93 | else if (strcmp(sym, "_einittext") == 0) | ||
94 | _einittext = s->addr; | ||
95 | else if (toupper(stype) == 'A') | 127 | else if (toupper(stype) == 'A') |
96 | { | 128 | { |
97 | /* Keep these useful absolute symbols */ | 129 | /* Keep these useful absolute symbols */ |
@@ -127,6 +159,21 @@ static int read_symbol(FILE *in, struct sym_entry *s) | |||
127 | return 0; | 159 | return 0; |
128 | } | 160 | } |
129 | 161 | ||
162 | static int symbol_valid_tr(struct sym_entry *s) | ||
163 | { | ||
164 | size_t i; | ||
165 | struct text_range *tr; | ||
166 | |||
167 | for (i = 0; i < ARRAY_SIZE(text_ranges); ++i) { | ||
168 | tr = &text_ranges[i]; | ||
169 | |||
170 | if (s->addr >= tr->start && s->addr < tr->end) | ||
171 | return 0; | ||
172 | } | ||
173 | |||
174 | return 1; | ||
175 | } | ||
176 | |||
130 | static int symbol_valid(struct sym_entry *s) | 177 | static int symbol_valid(struct sym_entry *s) |
131 | { | 178 | { |
132 | /* Symbols which vary between passes. Passes 1 and 2 must have | 179 | /* Symbols which vary between passes. Passes 1 and 2 must have |
@@ -156,8 +203,7 @@ static int symbol_valid(struct sym_entry *s) | |||
156 | /* if --all-symbols is not specified, then symbols outside the text | 203 | /* if --all-symbols is not specified, then symbols outside the text |
157 | * and inittext sections are discarded */ | 204 | * and inittext sections are discarded */ |
158 | if (!all_symbols) { | 205 | if (!all_symbols) { |
159 | if ((s->addr < _stext || s->addr > _etext) | 206 | if (symbol_valid_tr(s) == 0) |
160 | && (s->addr < _sinittext || s->addr > _einittext)) | ||
161 | return 0; | 207 | return 0; |
162 | /* Corner case. Discard any symbols with the same value as | 208 | /* Corner case. Discard any symbols with the same value as |
163 | * _etext _einittext; they can move between pass 1 and 2 when | 209 | * _etext _einittext; they can move between pass 1 and 2 when |
@@ -165,10 +211,10 @@ static int symbol_valid(struct sym_entry *s) | |||
165 | * they may get dropped in pass 2, which breaks the kallsyms | 211 | * they may get dropped in pass 2, which breaks the kallsyms |
166 | * rules. | 212 | * rules. |
167 | */ | 213 | */ |
168 | if ((s->addr == _etext && | 214 | if ((s->addr == text_range_text->end && |
169 | strcmp((char *)s->sym + offset, "_etext")) || | 215 | strcmp((char *)s->sym + offset, text_range_text->etext)) || |
170 | (s->addr == _einittext && | 216 | (s->addr == text_range_inittext->end && |
171 | strcmp((char *)s->sym + offset, "_einittext"))) | 217 | strcmp((char *)s->sym + offset, text_range_inittext->etext))) |
172 | return 0; | 218 | return 0; |
173 | } | 219 | } |
174 | 220 | ||
diff --git a/scripts/kconfig/.gitignore b/scripts/kconfig/.gitignore index b49584c932c..6a36a76e660 100644 --- a/scripts/kconfig/.gitignore +++ b/scripts/kconfig/.gitignore | |||
@@ -8,6 +8,9 @@ lex.*.c | |||
8 | zconf.hash.c | 8 | zconf.hash.c |
9 | *.moc | 9 | *.moc |
10 | lkc_defs.h | 10 | lkc_defs.h |
11 | gconf.glade.h | ||
12 | *.pot | ||
13 | *.mo | ||
11 | 14 | ||
12 | # | 15 | # |
13 | # configuration programs | 16 | # configuration programs |
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index fa8c2dd9c98..5ddf8becd7a 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
@@ -83,7 +83,7 @@ help: | |||
83 | @echo ' xconfig - Update current config utilising a QT based front-end' | 83 | @echo ' xconfig - Update current config utilising a QT based front-end' |
84 | @echo ' gconfig - Update current config utilising a GTK based front-end' | 84 | @echo ' gconfig - Update current config utilising a GTK based front-end' |
85 | @echo ' oldconfig - Update current config utilising a provided .config as base' | 85 | @echo ' oldconfig - Update current config utilising a provided .config as base' |
86 | @echo ' silentoldconfig - Same as oldconfig, but quietly' | 86 | @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps' |
87 | @echo ' randconfig - New config with random answer to all options' | 87 | @echo ' randconfig - New config with random answer to all options' |
88 | @echo ' defconfig - New config with default answer to all options' | 88 | @echo ' defconfig - New config with default answer to all options' |
89 | @echo ' allmodconfig - New config selecting modules when possible' | 89 | @echo ' allmodconfig - New config selecting modules when possible' |
@@ -104,7 +104,7 @@ HOST_EXTRACFLAGS += -DLOCALE | |||
104 | # =========================================================================== | 104 | # =========================================================================== |
105 | # Shared Makefile for the various kconfig executables: | 105 | # Shared Makefile for the various kconfig executables: |
106 | # conf: Used for defconfig, oldconfig and related targets | 106 | # conf: Used for defconfig, oldconfig and related targets |
107 | # mconf: Used for the mconfig target. | 107 | # mconf: Used for the menuconfig target |
108 | # Utilizes the lxdialog package | 108 | # Utilizes the lxdialog package |
109 | # qconf: Used for the xconfig target | 109 | # qconf: Used for the xconfig target |
110 | # Based on QT which needs to be installed to compile it | 110 | # Based on QT which needs to be installed to compile it |
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index d190092c3b6..3baaaecd6b1 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
@@ -498,14 +498,15 @@ int main(int ac, char **av) | |||
498 | conf_parse(name); | 498 | conf_parse(name); |
499 | //zconfdump(stdout); | 499 | //zconfdump(stdout); |
500 | if (sync_kconfig) { | 500 | if (sync_kconfig) { |
501 | if (stat(".config", &tmpstat)) { | 501 | name = conf_get_configname(); |
502 | if (stat(name, &tmpstat)) { | ||
502 | fprintf(stderr, _("***\n" | 503 | fprintf(stderr, _("***\n" |
503 | "*** You have not yet configured your kernel!\n" | 504 | "*** You have not yet configured your kernel!\n" |
504 | "*** (missing kernel .config file)\n" | 505 | "*** (missing kernel config file \"%s\")\n" |
505 | "***\n" | 506 | "***\n" |
506 | "*** Please run some configurator (e.g. \"make oldconfig\" or\n" | 507 | "*** Please run some configurator (e.g. \"make oldconfig\" or\n" |
507 | "*** \"make menuconfig\" or \"make xconfig\").\n" | 508 | "*** \"make menuconfig\" or \"make xconfig\").\n" |
508 | "***\n")); | 509 | "***\n"), name); |
509 | exit(1); | 510 | exit(1); |
510 | } | 511 | } |
511 | } | 512 | } |
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 273d73888f9..a04da3459f0 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -41,6 +41,13 @@ const char *conf_get_configname(void) | |||
41 | return name ? name : ".config"; | 41 | return name ? name : ".config"; |
42 | } | 42 | } |
43 | 43 | ||
44 | const char *conf_get_autoconfig_name(void) | ||
45 | { | ||
46 | char *name = getenv("KCONFIG_AUTOCONFIG"); | ||
47 | |||
48 | return name ? name : "include/config/auto.conf"; | ||
49 | } | ||
50 | |||
44 | static char *conf_expand_value(const char *in) | 51 | static char *conf_expand_value(const char *in) |
45 | { | 52 | { |
46 | struct symbol *sym; | 53 | struct symbol *sym; |
@@ -555,15 +562,14 @@ int conf_write(const char *name) | |||
555 | 562 | ||
556 | int conf_split_config(void) | 563 | int conf_split_config(void) |
557 | { | 564 | { |
558 | char *name, path[128]; | 565 | const char *name; |
566 | char path[128]; | ||
559 | char *s, *d, c; | 567 | char *s, *d, c; |
560 | struct symbol *sym; | 568 | struct symbol *sym; |
561 | struct stat sb; | 569 | struct stat sb; |
562 | int res, i, fd; | 570 | int res, i, fd; |
563 | 571 | ||
564 | name = getenv("KCONFIG_AUTOCONFIG"); | 572 | name = conf_get_autoconfig_name(); |
565 | if (!name) | ||
566 | name = "include/config/auto.conf"; | ||
567 | conf_read_simple(name, S_DEF_AUTO); | 573 | conf_read_simple(name, S_DEF_AUTO); |
568 | 574 | ||
569 | if (chdir("include/config")) | 575 | if (chdir("include/config")) |
@@ -670,7 +676,7 @@ int conf_write_autoconf(void) | |||
670 | { | 676 | { |
671 | struct symbol *sym; | 677 | struct symbol *sym; |
672 | const char *str; | 678 | const char *str; |
673 | char *name; | 679 | const char *name; |
674 | FILE *out, *out_h; | 680 | FILE *out, *out_h; |
675 | time_t now; | 681 | time_t now; |
676 | int i, l; | 682 | int i, l; |
@@ -773,9 +779,7 @@ int conf_write_autoconf(void) | |||
773 | name = "include/linux/autoconf.h"; | 779 | name = "include/linux/autoconf.h"; |
774 | if (rename(".tmpconfig.h", name)) | 780 | if (rename(".tmpconfig.h", name)) |
775 | return 1; | 781 | return 1; |
776 | name = getenv("KCONFIG_AUTOCONFIG"); | 782 | name = conf_get_autoconfig_name(); |
777 | if (!name) | ||
778 | name = "include/config/auto.conf"; | ||
779 | /* | 783 | /* |
780 | * 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 |
781 | * and this marks the successful completion of the previous steps. | 785 | * and this marks the successful completion of the previous steps. |
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 4a9af6f7886..f379b0bf8c9 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h | |||
@@ -74,6 +74,7 @@ char *zconf_curname(void); | |||
74 | 74 | ||
75 | /* confdata.c */ | 75 | /* confdata.c */ |
76 | const char *conf_get_configname(void); | 76 | const char *conf_get_configname(void); |
77 | const char *conf_get_autoconfig_name(void); | ||
77 | char *conf_get_default_confname(void); | 78 | char *conf_get_default_confname(void); |
78 | void sym_set_change_count(int count); | 79 | void sym_set_change_count(int count); |
79 | void sym_add_change_count(int count); | 80 | void sym_add_change_count(int count); |
diff --git a/scripts/kconfig/lxdialog/checklist.c b/scripts/kconfig/lxdialog/checklist.c index b2a878c936d..bcc6f19c3a3 100644 --- a/scripts/kconfig/lxdialog/checklist.c +++ b/scripts/kconfig/lxdialog/checklist.c | |||
@@ -41,7 +41,8 @@ static void print_item(WINDOW * win, int choice, int selected) | |||
41 | wmove(win, choice, check_x); | 41 | wmove(win, choice, check_x); |
42 | wattrset(win, selected ? dlg.check_selected.atr | 42 | wattrset(win, selected ? dlg.check_selected.atr |
43 | : dlg.check.atr); | 43 | : dlg.check.atr); |
44 | wprintw(win, "(%c)", item_is_tag('X') ? 'X' : ' '); | 44 | if (!item_is_tag(':')) |
45 | wprintw(win, "(%c)", item_is_tag('X') ? 'X' : ' '); | ||
45 | 46 | ||
46 | wattrset(win, selected ? dlg.tag_selected.atr : dlg.tag.atr); | 47 | wattrset(win, selected ? dlg.tag_selected.atr : dlg.tag.atr); |
47 | mvwaddch(win, choice, item_x, item_str()[0]); | 48 | mvwaddch(win, choice, item_x, item_str()[0]); |
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 6841e95c098..3bcacb4bfd3 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
@@ -732,7 +732,12 @@ static void conf_choice(struct menu *menu) | |||
732 | for (child = menu->list; child; child = child->next) { | 732 | for (child = menu->list; child; child = child->next) { |
733 | if (!menu_is_visible(child)) | 733 | if (!menu_is_visible(child)) |
734 | continue; | 734 | continue; |
735 | item_make("%s", _(menu_get_prompt(child))); | 735 | if (child->sym) |
736 | item_make("%s", _(menu_get_prompt(child))); | ||
737 | else { | ||
738 | item_make("*** %s ***", _(menu_get_prompt(child))); | ||
739 | item_set_tag(':'); | ||
740 | } | ||
736 | item_set_data(child); | 741 | item_set_data(child); |
737 | if (child->sym == active) | 742 | if (child->sym == active) |
738 | item_set_selected(1); | 743 | item_set_selected(1); |
@@ -748,6 +753,9 @@ static void conf_choice(struct menu *menu) | |||
748 | case 0: | 753 | case 0: |
749 | if (selected) { | 754 | if (selected) { |
750 | child = item_data(); | 755 | child = item_data(); |
756 | if (!child->sym) | ||
757 | break; | ||
758 | |||
751 | sym_set_tristate_value(child->sym, yes); | 759 | sym_set_tristate_value(child->sym, yes); |
752 | } | 760 | } |
753 | return; | 761 | return; |
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 5d0fd38b089..ce7d508c752 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc | |||
@@ -5,6 +5,7 @@ | |||
5 | 5 | ||
6 | #include <qapplication.h> | 6 | #include <qapplication.h> |
7 | #include <qmainwindow.h> | 7 | #include <qmainwindow.h> |
8 | #include <qdesktopwidget.h> | ||
8 | #include <qtoolbar.h> | 9 | #include <qtoolbar.h> |
9 | #include <qlayout.h> | 10 | #include <qlayout.h> |
10 | #include <qvbox.h> | 11 | #include <qvbox.h> |
@@ -297,10 +298,10 @@ void ConfigLineEdit::show(ConfigItem* i) | |||
297 | void ConfigLineEdit::keyPressEvent(QKeyEvent* e) | 298 | void ConfigLineEdit::keyPressEvent(QKeyEvent* e) |
298 | { | 299 | { |
299 | switch (e->key()) { | 300 | switch (e->key()) { |
300 | case Key_Escape: | 301 | case Qt::Key_Escape: |
301 | break; | 302 | break; |
302 | case Key_Return: | 303 | case Qt::Key_Return: |
303 | case Key_Enter: | 304 | case Qt::Key_Enter: |
304 | sym_set_string_value(item->menu->sym, text().latin1()); | 305 | sym_set_string_value(item->menu->sym, text().latin1()); |
305 | parent()->updateList(item); | 306 | parent()->updateList(item); |
306 | break; | 307 | break; |
@@ -639,7 +640,7 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) | |||
639 | struct menu *menu; | 640 | struct menu *menu; |
640 | enum prop_type type; | 641 | enum prop_type type; |
641 | 642 | ||
642 | if (ev->key() == Key_Escape && mode != fullMode && mode != listMode) { | 643 | if (ev->key() == Qt::Key_Escape && mode != fullMode && mode != listMode) { |
643 | emit parentSelected(); | 644 | emit parentSelected(); |
644 | ev->accept(); | 645 | ev->accept(); |
645 | return; | 646 | return; |
@@ -652,8 +653,8 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) | |||
652 | item = (ConfigItem*)i; | 653 | item = (ConfigItem*)i; |
653 | 654 | ||
654 | switch (ev->key()) { | 655 | switch (ev->key()) { |
655 | case Key_Return: | 656 | case Qt::Key_Return: |
656 | case Key_Enter: | 657 | case Qt::Key_Enter: |
657 | if (item->goParent) { | 658 | if (item->goParent) { |
658 | emit parentSelected(); | 659 | emit parentSelected(); |
659 | break; | 660 | break; |
@@ -667,16 +668,16 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) | |||
667 | emit menuSelected(menu); | 668 | emit menuSelected(menu); |
668 | break; | 669 | break; |
669 | } | 670 | } |
670 | case Key_Space: | 671 | case Qt::Key_Space: |
671 | changeValue(item); | 672 | changeValue(item); |
672 | break; | 673 | break; |
673 | case Key_N: | 674 | case Qt::Key_N: |
674 | setValue(item, no); | 675 | setValue(item, no); |
675 | break; | 676 | break; |
676 | case Key_M: | 677 | case Qt::Key_M: |
677 | setValue(item, mod); | 678 | setValue(item, mod); |
678 | break; | 679 | break; |
679 | case Key_Y: | 680 | case Qt::Key_Y: |
680 | setValue(item, yes); | 681 | setValue(item, yes); |
681 | break; | 682 | break; |
682 | default: | 683 | default: |
@@ -920,7 +921,7 @@ void ConfigView::updateListAll(void) | |||
920 | } | 921 | } |
921 | 922 | ||
922 | ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) | 923 | ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) |
923 | : Parent(parent, name), menu(0), sym(0) | 924 | : Parent(parent, name), sym(0), menu(0) |
924 | { | 925 | { |
925 | if (name) { | 926 | if (name) { |
926 | configSettings->beginGroup(name); | 927 | configSettings->beginGroup(name); |
@@ -1199,7 +1200,7 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam | |||
1199 | layout1->addLayout(layout2); | 1200 | layout1->addLayout(layout2); |
1200 | 1201 | ||
1201 | split = new QSplitter(this); | 1202 | split = new QSplitter(this); |
1202 | split->setOrientation(QSplitter::Vertical); | 1203 | split->setOrientation(Qt::Vertical); |
1203 | list = new ConfigView(split, name); | 1204 | list = new ConfigView(split, name); |
1204 | list->list->mode = listMode; | 1205 | list->list->mode = listMode; |
1205 | info = new ConfigInfoView(split, name); | 1206 | info = new ConfigInfoView(split, name); |
@@ -1275,7 +1276,7 @@ ConfigMainWindow::ConfigMainWindow(void) | |||
1275 | int x, y, width, height; | 1276 | int x, y, width, height; |
1276 | char title[256]; | 1277 | char title[256]; |
1277 | 1278 | ||
1278 | QWidget *d = configApp->desktop(); | 1279 | QDesktopWidget *d = configApp->desktop(); |
1279 | snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration"), | 1280 | snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration"), |
1280 | getenv("KERNELVERSION")); | 1281 | getenv("KERNELVERSION")); |
1281 | setCaption(title); | 1282 | setCaption(title); |
@@ -1290,14 +1291,14 @@ ConfigMainWindow::ConfigMainWindow(void) | |||
1290 | move(x, y); | 1291 | move(x, y); |
1291 | 1292 | ||
1292 | split1 = new QSplitter(this); | 1293 | split1 = new QSplitter(this); |
1293 | split1->setOrientation(QSplitter::Horizontal); | 1294 | split1->setOrientation(Qt::Horizontal); |
1294 | setCentralWidget(split1); | 1295 | setCentralWidget(split1); |
1295 | 1296 | ||
1296 | menuView = new ConfigView(split1, "menu"); | 1297 | menuView = new ConfigView(split1, "menu"); |
1297 | menuList = menuView->list; | 1298 | menuList = menuView->list; |
1298 | 1299 | ||
1299 | split2 = new QSplitter(split1); | 1300 | split2 = new QSplitter(split1); |
1300 | split2->setOrientation(QSplitter::Vertical); | 1301 | split2->setOrientation(Qt::Vertical); |
1301 | 1302 | ||
1302 | // create config tree | 1303 | // create config tree |
1303 | configView = new ConfigView(split2, "config"); | 1304 | configView = new ConfigView(split2, "config"); |
@@ -1315,18 +1316,18 @@ ConfigMainWindow::ConfigMainWindow(void) | |||
1315 | backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this); | 1316 | backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this); |
1316 | connect(backAction, SIGNAL(activated()), SLOT(goBack())); | 1317 | connect(backAction, SIGNAL(activated()), SLOT(goBack())); |
1317 | backAction->setEnabled(FALSE); | 1318 | backAction->setEnabled(FALSE); |
1318 | QAction *quitAction = new QAction("Quit", _("&Quit"), CTRL+Key_Q, this); | 1319 | QAction *quitAction = new QAction("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this); |
1319 | connect(quitAction, SIGNAL(activated()), SLOT(close())); | 1320 | connect(quitAction, SIGNAL(activated()), SLOT(close())); |
1320 | QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), CTRL+Key_L, this); | 1321 | QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this); |
1321 | connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); | 1322 | connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); |
1322 | saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), CTRL+Key_S, this); | 1323 | saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this); |
1323 | connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); | 1324 | connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); |
1324 | conf_set_changed_callback(conf_changed); | 1325 | conf_set_changed_callback(conf_changed); |
1325 | // Set saveAction's initial state | 1326 | // Set saveAction's initial state |
1326 | conf_changed(); | 1327 | conf_changed(); |
1327 | QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this); | 1328 | QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this); |
1328 | connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); | 1329 | connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); |
1329 | QAction *searchAction = new QAction("Find", _("&Find"), CTRL+Key_F, this); | 1330 | QAction *searchAction = new QAction("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this); |
1330 | connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); | 1331 | connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); |
1331 | QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this); | 1332 | QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this); |
1332 | connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView())); | 1333 | connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView())); |
@@ -1447,7 +1448,7 @@ ConfigMainWindow::ConfigMainWindow(void) | |||
1447 | 1448 | ||
1448 | void ConfigMainWindow::loadConfig(void) | 1449 | void ConfigMainWindow::loadConfig(void) |
1449 | { | 1450 | { |
1450 | QString s = QFileDialog::getOpenFileName(".config", NULL, this); | 1451 | QString s = QFileDialog::getOpenFileName(conf_get_configname(), NULL, this); |
1451 | if (s.isNull()) | 1452 | if (s.isNull()) |
1452 | return; | 1453 | return; |
1453 | if (conf_read(QFile::encodeName(s))) | 1454 | if (conf_read(QFile::encodeName(s))) |
@@ -1463,7 +1464,7 @@ void ConfigMainWindow::saveConfig(void) | |||
1463 | 1464 | ||
1464 | void ConfigMainWindow::saveConfigAs(void) | 1465 | void ConfigMainWindow::saveConfigAs(void) |
1465 | { | 1466 | { |
1466 | QString s = QFileDialog::getSaveFileName(".config", NULL, this); | 1467 | QString s = QFileDialog::getSaveFileName(conf_get_configname(), NULL, this); |
1467 | if (s.isNull()) | 1468 | if (s.isNull()) |
1468 | return; | 1469 | return; |
1469 | if (conf_write(QFile::encodeName(s))) | 1470 | if (conf_write(QFile::encodeName(s))) |
@@ -1524,6 +1525,8 @@ void ConfigMainWindow::setMenuLink(struct menu *menu) | |||
1524 | case fullMode: | 1525 | case fullMode: |
1525 | list = configList; | 1526 | list = configList; |
1526 | break; | 1527 | break; |
1528 | default: | ||
1529 | break; | ||
1527 | } | 1530 | } |
1528 | 1531 | ||
1529 | if (list) { | 1532 | if (list) { |
@@ -1673,6 +1676,9 @@ void ConfigMainWindow::saveSettings(void) | |||
1673 | case fullMode : | 1676 | case fullMode : |
1674 | entry = "full"; | 1677 | entry = "full"; |
1675 | break; | 1678 | break; |
1679 | |||
1680 | default: | ||
1681 | break; | ||
1676 | } | 1682 | } |
1677 | configSettings->writeEntry("/listMode", entry); | 1683 | configSettings->writeEntry("/listMode", entry); |
1678 | 1684 | ||
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c index 3cc9f936903..b6b2a46af14 100644 --- a/scripts/kconfig/util.c +++ b/scripts/kconfig/util.c | |||
@@ -46,8 +46,8 @@ int file_write_dep(const char *name) | |||
46 | else | 46 | else |
47 | fprintf(out, "\t%s\n", file->name); | 47 | fprintf(out, "\t%s\n", file->name); |
48 | } | 48 | } |
49 | fprintf(out, "\ninclude/config/auto.conf: \\\n" | 49 | fprintf(out, "\n%s: \\\n" |
50 | "\t$(deps_config)\n\n"); | 50 | "\t$(deps_config)\n\n", conf_get_autoconfig_name()); |
51 | 51 | ||
52 | expr_list_for_each_sym(sym_env_list, e, sym) { | 52 | expr_list_for_each_sym(sym_env_list, e, sym) { |
53 | struct property *prop; | 53 | struct property *prop; |
@@ -61,7 +61,7 @@ int file_write_dep(const char *name) | |||
61 | if (!value) | 61 | if (!value) |
62 | value = ""; | 62 | value = ""; |
63 | fprintf(out, "ifneq \"$(%s)\" \"%s\"\n", env_sym->name, value); | 63 | fprintf(out, "ifneq \"$(%s)\" \"%s\"\n", env_sym->name, value); |
64 | fprintf(out, "include/config/auto.conf: FORCE\n"); | 64 | fprintf(out, "%s: FORCE\n", conf_get_autoconfig_name()); |
65 | fprintf(out, "endif\n"); | 65 | fprintf(out, "endif\n"); |
66 | } | 66 | } |
67 | 67 | ||
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index acd8c4a8e3e..a193fa3f527 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -5,7 +5,7 @@ use strict; | |||
5 | ## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## | 5 | ## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## |
6 | ## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ## | 6 | ## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ## |
7 | ## Copyright (C) 2001 Simon Huggins ## | 7 | ## Copyright (C) 2001 Simon Huggins ## |
8 | ## Copyright (C) 2005-2008 Randy Dunlap ## | 8 | ## Copyright (C) 2005-2009 Randy Dunlap ## |
9 | ## ## | 9 | ## ## |
10 | ## #define enhancements by Armin Kuster <akuster@mvista.com> ## | 10 | ## #define enhancements by Armin Kuster <akuster@mvista.com> ## |
11 | ## Copyright (c) 2000 MontaVista Software, Inc. ## | 11 | ## Copyright (c) 2000 MontaVista Software, Inc. ## |
@@ -85,7 +85,7 @@ use strict; | |||
85 | # | 85 | # |
86 | # /** | 86 | # /** |
87 | # * my_function | 87 | # * my_function |
88 | # **/ | 88 | # */ |
89 | # | 89 | # |
90 | # If the Description: header tag is omitted, then there must be a blank line | 90 | # If the Description: header tag is omitted, then there must be a blank line |
91 | # after the last parameter specification. | 91 | # after the last parameter specification. |
@@ -105,7 +105,7 @@ use strict; | |||
105 | # */ | 105 | # */ |
106 | # etc. | 106 | # etc. |
107 | # | 107 | # |
108 | # Beside functions you can also write documentation for structs, unions, | 108 | # Besides functions you can also write documentation for structs, unions, |
109 | # enums and typedefs. Instead of the function name you must write the name | 109 | # enums and typedefs. Instead of the function name you must write the name |
110 | # of the declaration; the struct/union/enum/typedef must always precede | 110 | # of the declaration; the struct/union/enum/typedef must always precede |
111 | # the name. Nesting of declarations is not supported. | 111 | # the name. Nesting of declarations is not supported. |
@@ -223,7 +223,7 @@ sub usage { | |||
223 | } | 223 | } |
224 | 224 | ||
225 | # read arguments | 225 | # read arguments |
226 | if ($#ARGV==-1) { | 226 | if ($#ARGV == -1) { |
227 | usage(); | 227 | usage(); |
228 | } | 228 | } |
229 | 229 | ||
@@ -240,12 +240,12 @@ my $man_date = ('January', 'February', 'March', 'April', 'May', 'June', | |||
240 | " " . ((localtime)[5]+1900); | 240 | " " . ((localtime)[5]+1900); |
241 | 241 | ||
242 | # Essentially these are globals | 242 | # Essentially these are globals |
243 | # They probably want to be tidied up made more localised or summat. | 243 | # They probably want to be tidied up, made more localised or something. |
244 | # CAVEAT EMPTOR! Some of the others I localised may not want to be which | 244 | # CAVEAT EMPTOR! Some of the others I localised may not want to be, which |
245 | # could cause "use of undefined value" or other bugs. | 245 | # could cause "use of undefined value" or other bugs. |
246 | my ($function, %function_table,%parametertypes,$declaration_purpose); | 246 | my ($function, %function_table, %parametertypes, $declaration_purpose); |
247 | my ($type,$declaration_name,$return_type); | 247 | my ($type, $declaration_name, $return_type); |
248 | my ($newsection,$newcontents,$prototype,$filelist, $brcount, %source_map); | 248 | my ($newsection, $newcontents, $prototype, $filelist, $brcount, %source_map); |
249 | 249 | ||
250 | if (defined($ENV{'KBUILD_VERBOSE'})) { | 250 | if (defined($ENV{'KBUILD_VERBOSE'})) { |
251 | $verbose = "$ENV{'KBUILD_VERBOSE'}"; | 251 | $verbose = "$ENV{'KBUILD_VERBOSE'}"; |
@@ -279,10 +279,10 @@ my $doc_special = "\@\%\$\&"; | |||
279 | my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start. | 279 | my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start. |
280 | my $doc_end = '\*/'; | 280 | my $doc_end = '\*/'; |
281 | my $doc_com = '\s*\*\s*'; | 281 | my $doc_com = '\s*\*\s*'; |
282 | my $doc_decl = $doc_com.'(\w+)'; | 282 | my $doc_decl = $doc_com . '(\w+)'; |
283 | my $doc_sect = $doc_com.'(['.$doc_special.']?[\w\s]+):(.*)'; | 283 | my $doc_sect = $doc_com . '([' . $doc_special . ']?[\w\s]+):(.*)'; |
284 | my $doc_content = $doc_com.'(.*)'; | 284 | my $doc_content = $doc_com . '(.*)'; |
285 | my $doc_block = $doc_com.'DOC:\s*(.*)?'; | 285 | my $doc_block = $doc_com . 'DOC:\s*(.*)?'; |
286 | 286 | ||
287 | my %constants; | 287 | my %constants; |
288 | my %parameterdescs; | 288 | my %parameterdescs; |
@@ -485,12 +485,12 @@ sub output_enum_html(%) { | |||
485 | my %args = %{$_[0]}; | 485 | my %args = %{$_[0]}; |
486 | my ($parameter); | 486 | my ($parameter); |
487 | my $count; | 487 | my $count; |
488 | print "<h2>enum ".$args{'enum'}."</h2>\n"; | 488 | print "<h2>enum " . $args{'enum'} . "</h2>\n"; |
489 | 489 | ||
490 | print "<b>enum ".$args{'enum'}."</b> {<br>\n"; | 490 | print "<b>enum " . $args{'enum'} . "</b> {<br>\n"; |
491 | $count = 0; | 491 | $count = 0; |
492 | foreach $parameter (@{$args{'parameterlist'}}) { | 492 | foreach $parameter (@{$args{'parameterlist'}}) { |
493 | print " <b>".$parameter."</b>"; | 493 | print " <b>" . $parameter . "</b>"; |
494 | if ($count != $#{$args{'parameterlist'}}) { | 494 | if ($count != $#{$args{'parameterlist'}}) { |
495 | $count++; | 495 | $count++; |
496 | print ",\n"; | 496 | print ",\n"; |
@@ -502,7 +502,7 @@ sub output_enum_html(%) { | |||
502 | print "<h3>Constants</h3>\n"; | 502 | print "<h3>Constants</h3>\n"; |
503 | print "<dl>\n"; | 503 | print "<dl>\n"; |
504 | foreach $parameter (@{$args{'parameterlist'}}) { | 504 | foreach $parameter (@{$args{'parameterlist'}}) { |
505 | print "<dt><b>".$parameter."</b>\n"; | 505 | print "<dt><b>" . $parameter . "</b>\n"; |
506 | print "<dd>"; | 506 | print "<dd>"; |
507 | output_highlight($args{'parameterdescs'}{$parameter}); | 507 | output_highlight($args{'parameterdescs'}{$parameter}); |
508 | } | 508 | } |
@@ -516,9 +516,9 @@ sub output_typedef_html(%) { | |||
516 | my %args = %{$_[0]}; | 516 | my %args = %{$_[0]}; |
517 | my ($parameter); | 517 | my ($parameter); |
518 | my $count; | 518 | my $count; |
519 | print "<h2>typedef ".$args{'typedef'}."</h2>\n"; | 519 | print "<h2>typedef " . $args{'typedef'} . "</h2>\n"; |
520 | 520 | ||
521 | print "<b>typedef ".$args{'typedef'}."</b>\n"; | 521 | print "<b>typedef " . $args{'typedef'} . "</b>\n"; |
522 | output_section_html(@_); | 522 | output_section_html(@_); |
523 | print "<hr>\n"; | 523 | print "<hr>\n"; |
524 | } | 524 | } |
@@ -528,8 +528,8 @@ sub output_struct_html(%) { | |||
528 | my %args = %{$_[0]}; | 528 | my %args = %{$_[0]}; |
529 | my ($parameter); | 529 | my ($parameter); |
530 | 530 | ||
531 | print "<h2>".$args{'type'}." ".$args{'struct'}. " - " .$args{'purpose'}."</h2>\n"; | 531 | print "<h2>" . $args{'type'} . " " . $args{'struct'} . " - " . $args{'purpose'} . "</h2>\n"; |
532 | print "<b>".$args{'type'}." ".$args{'struct'}."</b> {<br>\n"; | 532 | print "<b>" . $args{'type'} . " " . $args{'struct'} . "</b> {<br>\n"; |
533 | foreach $parameter (@{$args{'parameterlist'}}) { | 533 | foreach $parameter (@{$args{'parameterlist'}}) { |
534 | if ($parameter =~ /^#/) { | 534 | if ($parameter =~ /^#/) { |
535 | print "$parameter<br>\n"; | 535 | print "$parameter<br>\n"; |
@@ -561,7 +561,7 @@ sub output_struct_html(%) { | |||
561 | $parameter_name =~ s/\[.*//; | 561 | $parameter_name =~ s/\[.*//; |
562 | 562 | ||
563 | ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; | 563 | ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; |
564 | print "<dt><b>".$parameter."</b>\n"; | 564 | print "<dt><b>" . $parameter . "</b>\n"; |
565 | print "<dd>"; | 565 | print "<dd>"; |
566 | output_highlight($args{'parameterdescs'}{$parameter_name}); | 566 | output_highlight($args{'parameterdescs'}{$parameter_name}); |
567 | } | 567 | } |
@@ -576,9 +576,9 @@ sub output_function_html(%) { | |||
576 | my ($parameter, $section); | 576 | my ($parameter, $section); |
577 | my $count; | 577 | my $count; |
578 | 578 | ||
579 | print "<h2>" .$args{'function'}." - ".$args{'purpose'}."</h2>\n"; | 579 | print "<h2>" . $args{'function'} . " - " . $args{'purpose'} . "</h2>\n"; |
580 | print "<i>".$args{'functiontype'}."</i>\n"; | 580 | print "<i>" . $args{'functiontype'} . "</i>\n"; |
581 | print "<b>".$args{'function'}."</b>\n"; | 581 | print "<b>" . $args{'function'} . "</b>\n"; |
582 | print "("; | 582 | print "("; |
583 | $count = 0; | 583 | $count = 0; |
584 | foreach $parameter (@{$args{'parameterlist'}}) { | 584 | foreach $parameter (@{$args{'parameterlist'}}) { |
@@ -587,7 +587,7 @@ sub output_function_html(%) { | |||
587 | # pointer-to-function | 587 | # pointer-to-function |
588 | print "<i>$1</i><b>$parameter</b>) <i>($2)</i>"; | 588 | print "<i>$1</i><b>$parameter</b>) <i>($2)</i>"; |
589 | } else { | 589 | } else { |
590 | print "<i>".$type."</i> <b>".$parameter."</b>"; | 590 | print "<i>" . $type . "</i> <b>" . $parameter . "</b>"; |
591 | } | 591 | } |
592 | if ($count != $#{$args{'parameterlist'}}) { | 592 | if ($count != $#{$args{'parameterlist'}}) { |
593 | $count++; | 593 | $count++; |
@@ -603,7 +603,7 @@ sub output_function_html(%) { | |||
603 | $parameter_name =~ s/\[.*//; | 603 | $parameter_name =~ s/\[.*//; |
604 | 604 | ||
605 | ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; | 605 | ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; |
606 | print "<dt><b>".$parameter."</b>\n"; | 606 | print "<dt><b>" . $parameter . "</b>\n"; |
607 | print "<dd>"; | 607 | print "<dd>"; |
608 | output_highlight($args{'parameterdescs'}{$parameter_name}); | 608 | output_highlight($args{'parameterdescs'}{$parameter_name}); |
609 | } | 609 | } |
@@ -657,7 +657,7 @@ sub output_function_xml(%) { | |||
657 | my $count; | 657 | my $count; |
658 | my $id; | 658 | my $id; |
659 | 659 | ||
660 | $id = "API-".$args{'function'}; | 660 | $id = "API-" . $args{'function'}; |
661 | $id =~ s/[^A-Za-z0-9]/-/g; | 661 | $id =~ s/[^A-Za-z0-9]/-/g; |
662 | 662 | ||
663 | print "<refentry id=\"$id\">\n"; | 663 | print "<refentry id=\"$id\">\n"; |
@@ -667,12 +667,12 @@ sub output_function_xml(%) { | |||
667 | print " <date>$man_date</date>\n"; | 667 | print " <date>$man_date</date>\n"; |
668 | print "</refentryinfo>\n"; | 668 | print "</refentryinfo>\n"; |
669 | print "<refmeta>\n"; | 669 | print "<refmeta>\n"; |
670 | print " <refentrytitle><phrase>".$args{'function'}."</phrase></refentrytitle>\n"; | 670 | print " <refentrytitle><phrase>" . $args{'function'} . "</phrase></refentrytitle>\n"; |
671 | print " <manvolnum>9</manvolnum>\n"; | 671 | print " <manvolnum>9</manvolnum>\n"; |
672 | print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; | 672 | print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; |
673 | print "</refmeta>\n"; | 673 | print "</refmeta>\n"; |
674 | print "<refnamediv>\n"; | 674 | print "<refnamediv>\n"; |
675 | print " <refname>".$args{'function'}."</refname>\n"; | 675 | print " <refname>" . $args{'function'} . "</refname>\n"; |
676 | print " <refpurpose>\n"; | 676 | print " <refpurpose>\n"; |
677 | print " "; | 677 | print " "; |
678 | output_highlight ($args{'purpose'}); | 678 | output_highlight ($args{'purpose'}); |
@@ -682,8 +682,8 @@ sub output_function_xml(%) { | |||
682 | print "<refsynopsisdiv>\n"; | 682 | print "<refsynopsisdiv>\n"; |
683 | print " <title>Synopsis</title>\n"; | 683 | print " <title>Synopsis</title>\n"; |
684 | print " <funcsynopsis><funcprototype>\n"; | 684 | print " <funcsynopsis><funcprototype>\n"; |
685 | print " <funcdef>".$args{'functiontype'}." "; | 685 | print " <funcdef>" . $args{'functiontype'} . " "; |
686 | print "<function>".$args{'function'}." </function></funcdef>\n"; | 686 | print "<function>" . $args{'function'} . " </function></funcdef>\n"; |
687 | 687 | ||
688 | $count = 0; | 688 | $count = 0; |
689 | if ($#{$args{'parameterlist'}} >= 0) { | 689 | if ($#{$args{'parameterlist'}} >= 0) { |
@@ -694,7 +694,7 @@ sub output_function_xml(%) { | |||
694 | print " <paramdef>$1<parameter>$parameter</parameter>)\n"; | 694 | print " <paramdef>$1<parameter>$parameter</parameter>)\n"; |
695 | print " <funcparams>$2</funcparams></paramdef>\n"; | 695 | print " <funcparams>$2</funcparams></paramdef>\n"; |
696 | } else { | 696 | } else { |
697 | print " <paramdef>".$type; | 697 | print " <paramdef>" . $type; |
698 | print " <parameter>$parameter</parameter></paramdef>\n"; | 698 | print " <parameter>$parameter</parameter></paramdef>\n"; |
699 | } | 699 | } |
700 | } | 700 | } |
@@ -734,7 +734,7 @@ sub output_struct_xml(%) { | |||
734 | my ($parameter, $section); | 734 | my ($parameter, $section); |
735 | my $id; | 735 | my $id; |
736 | 736 | ||
737 | $id = "API-struct-".$args{'struct'}; | 737 | $id = "API-struct-" . $args{'struct'}; |
738 | $id =~ s/[^A-Za-z0-9]/-/g; | 738 | $id =~ s/[^A-Za-z0-9]/-/g; |
739 | 739 | ||
740 | print "<refentry id=\"$id\">\n"; | 740 | print "<refentry id=\"$id\">\n"; |
@@ -744,12 +744,12 @@ sub output_struct_xml(%) { | |||
744 | print " <date>$man_date</date>\n"; | 744 | print " <date>$man_date</date>\n"; |
745 | print "</refentryinfo>\n"; | 745 | print "</refentryinfo>\n"; |
746 | print "<refmeta>\n"; | 746 | print "<refmeta>\n"; |
747 | print " <refentrytitle><phrase>".$args{'type'}." ".$args{'struct'}."</phrase></refentrytitle>\n"; | 747 | print " <refentrytitle><phrase>" . $args{'type'} . " " . $args{'struct'} . "</phrase></refentrytitle>\n"; |
748 | print " <manvolnum>9</manvolnum>\n"; | 748 | print " <manvolnum>9</manvolnum>\n"; |
749 | print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; | 749 | print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; |
750 | print "</refmeta>\n"; | 750 | print "</refmeta>\n"; |
751 | print "<refnamediv>\n"; | 751 | print "<refnamediv>\n"; |
752 | print " <refname>".$args{'type'}." ".$args{'struct'}."</refname>\n"; | 752 | print " <refname>" . $args{'type'} . " " . $args{'struct'} . "</refname>\n"; |
753 | print " <refpurpose>\n"; | 753 | print " <refpurpose>\n"; |
754 | print " "; | 754 | print " "; |
755 | output_highlight ($args{'purpose'}); | 755 | output_highlight ($args{'purpose'}); |
@@ -759,7 +759,7 @@ sub output_struct_xml(%) { | |||
759 | print "<refsynopsisdiv>\n"; | 759 | print "<refsynopsisdiv>\n"; |
760 | print " <title>Synopsis</title>\n"; | 760 | print " <title>Synopsis</title>\n"; |
761 | print " <programlisting>\n"; | 761 | print " <programlisting>\n"; |
762 | print $args{'type'}." ".$args{'struct'}." {\n"; | 762 | print $args{'type'} . " " . $args{'struct'} . " {\n"; |
763 | foreach $parameter (@{$args{'parameterlist'}}) { | 763 | foreach $parameter (@{$args{'parameterlist'}}) { |
764 | if ($parameter =~ /^#/) { | 764 | if ($parameter =~ /^#/) { |
765 | print "$parameter\n"; | 765 | print "$parameter\n"; |
@@ -779,7 +779,7 @@ sub output_struct_xml(%) { | |||
779 | # bitfield | 779 | # bitfield |
780 | print " $1 $parameter$2;\n"; | 780 | print " $1 $parameter$2;\n"; |
781 | } else { | 781 | } else { |
782 | print " ".$type." ".$parameter.";\n"; | 782 | print " " . $type . " " . $parameter . ";\n"; |
783 | } | 783 | } |
784 | } | 784 | } |
785 | print "};"; | 785 | print "};"; |
@@ -824,7 +824,7 @@ sub output_enum_xml(%) { | |||
824 | my $count; | 824 | my $count; |
825 | my $id; | 825 | my $id; |
826 | 826 | ||
827 | $id = "API-enum-".$args{'enum'}; | 827 | $id = "API-enum-" . $args{'enum'}; |
828 | $id =~ s/[^A-Za-z0-9]/-/g; | 828 | $id =~ s/[^A-Za-z0-9]/-/g; |
829 | 829 | ||
830 | print "<refentry id=\"$id\">\n"; | 830 | print "<refentry id=\"$id\">\n"; |
@@ -834,12 +834,12 @@ sub output_enum_xml(%) { | |||
834 | print " <date>$man_date</date>\n"; | 834 | print " <date>$man_date</date>\n"; |
835 | print "</refentryinfo>\n"; | 835 | print "</refentryinfo>\n"; |
836 | print "<refmeta>\n"; | 836 | print "<refmeta>\n"; |
837 | print " <refentrytitle><phrase>enum ".$args{'enum'}."</phrase></refentrytitle>\n"; | 837 | print " <refentrytitle><phrase>enum " . $args{'enum'} . "</phrase></refentrytitle>\n"; |
838 | print " <manvolnum>9</manvolnum>\n"; | 838 | print " <manvolnum>9</manvolnum>\n"; |
839 | print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; | 839 | print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; |
840 | print "</refmeta>\n"; | 840 | print "</refmeta>\n"; |
841 | print "<refnamediv>\n"; | 841 | print "<refnamediv>\n"; |
842 | print " <refname>enum ".$args{'enum'}."</refname>\n"; | 842 | print " <refname>enum " . $args{'enum'} . "</refname>\n"; |
843 | print " <refpurpose>\n"; | 843 | print " <refpurpose>\n"; |
844 | print " "; | 844 | print " "; |
845 | output_highlight ($args{'purpose'}); | 845 | output_highlight ($args{'purpose'}); |
@@ -849,7 +849,7 @@ sub output_enum_xml(%) { | |||
849 | print "<refsynopsisdiv>\n"; | 849 | print "<refsynopsisdiv>\n"; |
850 | print " <title>Synopsis</title>\n"; | 850 | print " <title>Synopsis</title>\n"; |
851 | print " <programlisting>\n"; | 851 | print " <programlisting>\n"; |
852 | print "enum ".$args{'enum'}." {\n"; | 852 | print "enum " . $args{'enum'} . " {\n"; |
853 | $count = 0; | 853 | $count = 0; |
854 | foreach $parameter (@{$args{'parameterlist'}}) { | 854 | foreach $parameter (@{$args{'parameterlist'}}) { |
855 | print " $parameter"; | 855 | print " $parameter"; |
@@ -891,7 +891,7 @@ sub output_typedef_xml(%) { | |||
891 | my ($parameter, $section); | 891 | my ($parameter, $section); |
892 | my $id; | 892 | my $id; |
893 | 893 | ||
894 | $id = "API-typedef-".$args{'typedef'}; | 894 | $id = "API-typedef-" . $args{'typedef'}; |
895 | $id =~ s/[^A-Za-z0-9]/-/g; | 895 | $id =~ s/[^A-Za-z0-9]/-/g; |
896 | 896 | ||
897 | print "<refentry id=\"$id\">\n"; | 897 | print "<refentry id=\"$id\">\n"; |
@@ -901,11 +901,11 @@ sub output_typedef_xml(%) { | |||
901 | print " <date>$man_date</date>\n"; | 901 | print " <date>$man_date</date>\n"; |
902 | print "</refentryinfo>\n"; | 902 | print "</refentryinfo>\n"; |
903 | print "<refmeta>\n"; | 903 | print "<refmeta>\n"; |
904 | print " <refentrytitle><phrase>typedef ".$args{'typedef'}."</phrase></refentrytitle>\n"; | 904 | print " <refentrytitle><phrase>typedef " . $args{'typedef'} . "</phrase></refentrytitle>\n"; |
905 | print " <manvolnum>9</manvolnum>\n"; | 905 | print " <manvolnum>9</manvolnum>\n"; |
906 | print "</refmeta>\n"; | 906 | print "</refmeta>\n"; |
907 | print "<refnamediv>\n"; | 907 | print "<refnamediv>\n"; |
908 | print " <refname>typedef ".$args{'typedef'}."</refname>\n"; | 908 | print " <refname>typedef " . $args{'typedef'} . "</refname>\n"; |
909 | print " <refpurpose>\n"; | 909 | print " <refpurpose>\n"; |
910 | print " "; | 910 | print " "; |
911 | output_highlight ($args{'purpose'}); | 911 | output_highlight ($args{'purpose'}); |
@@ -914,7 +914,7 @@ sub output_typedef_xml(%) { | |||
914 | 914 | ||
915 | print "<refsynopsisdiv>\n"; | 915 | print "<refsynopsisdiv>\n"; |
916 | print " <title>Synopsis</title>\n"; | 916 | print " <title>Synopsis</title>\n"; |
917 | print " <synopsis>typedef ".$args{'typedef'}.";</synopsis>\n"; | 917 | print " <synopsis>typedef " . $args{'typedef'} . ";</synopsis>\n"; |
918 | print "</refsynopsisdiv>\n"; | 918 | print "</refsynopsisdiv>\n"; |
919 | 919 | ||
920 | output_section_xml(@_); | 920 | output_section_xml(@_); |
@@ -963,15 +963,15 @@ sub output_function_gnome { | |||
963 | my $count; | 963 | my $count; |
964 | my $id; | 964 | my $id; |
965 | 965 | ||
966 | $id = $args{'module'}."-".$args{'function'}; | 966 | $id = $args{'module'} . "-" . $args{'function'}; |
967 | $id =~ s/[^A-Za-z0-9]/-/g; | 967 | $id =~ s/[^A-Za-z0-9]/-/g; |
968 | 968 | ||
969 | print "<sect2>\n"; | 969 | print "<sect2>\n"; |
970 | print " <title id=\"$id\">".$args{'function'}."</title>\n"; | 970 | print " <title id=\"$id\">" . $args{'function'} . "</title>\n"; |
971 | 971 | ||
972 | print " <funcsynopsis>\n"; | 972 | print " <funcsynopsis>\n"; |
973 | print " <funcdef>".$args{'functiontype'}." "; | 973 | print " <funcdef>" . $args{'functiontype'} . " "; |
974 | print "<function>".$args{'function'}." "; | 974 | print "<function>" . $args{'function'} . " "; |
975 | print "</function></funcdef>\n"; | 975 | print "</function></funcdef>\n"; |
976 | 976 | ||
977 | $count = 0; | 977 | $count = 0; |
@@ -983,7 +983,7 @@ sub output_function_gnome { | |||
983 | print " <paramdef>$1 <parameter>$parameter</parameter>)\n"; | 983 | print " <paramdef>$1 <parameter>$parameter</parameter>)\n"; |
984 | print " <funcparams>$2</funcparams></paramdef>\n"; | 984 | print " <funcparams>$2</funcparams></paramdef>\n"; |
985 | } else { | 985 | } else { |
986 | print " <paramdef>".$type; | 986 | print " <paramdef>" . $type; |
987 | print " <parameter>$parameter</parameter></paramdef>\n"; | 987 | print " <parameter>$parameter</parameter></paramdef>\n"; |
988 | } | 988 | } |
989 | } | 989 | } |
@@ -1043,13 +1043,13 @@ sub output_function_man(%) { | |||
1043 | print ".TH \"$args{'function'}\" 9 \"$args{'function'}\" \"$man_date\" \"Kernel Hacker's Manual\" LINUX\n"; | 1043 | print ".TH \"$args{'function'}\" 9 \"$args{'function'}\" \"$man_date\" \"Kernel Hacker's Manual\" LINUX\n"; |
1044 | 1044 | ||
1045 | print ".SH NAME\n"; | 1045 | print ".SH NAME\n"; |
1046 | print $args{'function'}." \\- ".$args{'purpose'}."\n"; | 1046 | print $args{'function'} . " \\- " . $args{'purpose'} . "\n"; |
1047 | 1047 | ||
1048 | print ".SH SYNOPSIS\n"; | 1048 | print ".SH SYNOPSIS\n"; |
1049 | if ($args{'functiontype'} ne "") { | 1049 | if ($args{'functiontype'} ne "") { |
1050 | print ".B \"".$args{'functiontype'}."\" ".$args{'function'}."\n"; | 1050 | print ".B \"" . $args{'functiontype'} . "\" " . $args{'function'} . "\n"; |
1051 | } else { | 1051 | } else { |
1052 | print ".B \"".$args{'function'}."\n"; | 1052 | print ".B \"" . $args{'function'} . "\n"; |
1053 | } | 1053 | } |
1054 | $count = 0; | 1054 | $count = 0; |
1055 | my $parenth = "("; | 1055 | my $parenth = "("; |
@@ -1061,10 +1061,10 @@ sub output_function_man(%) { | |||
1061 | $type = $args{'parametertypes'}{$parameter}; | 1061 | $type = $args{'parametertypes'}{$parameter}; |
1062 | if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { | 1062 | if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { |
1063 | # pointer-to-function | 1063 | # pointer-to-function |
1064 | print ".BI \"".$parenth.$1."\" ".$parameter." \") (".$2.")".$post."\"\n"; | 1064 | print ".BI \"" . $parenth . $1 . "\" " . $parameter . " \") (" . $2 . ")" . $post . "\"\n"; |
1065 | } else { | 1065 | } else { |
1066 | $type =~ s/([^\*])$/$1 /; | 1066 | $type =~ s/([^\*])$/$1 /; |
1067 | print ".BI \"".$parenth.$type."\" ".$parameter." \"".$post."\"\n"; | 1067 | print ".BI \"" . $parenth . $type . "\" " . $parameter . " \"" . $post . "\"\n"; |
1068 | } | 1068 | } |
1069 | $count++; | 1069 | $count++; |
1070 | $parenth = ""; | 1070 | $parenth = ""; |
@@ -1075,7 +1075,7 @@ sub output_function_man(%) { | |||
1075 | my $parameter_name = $parameter; | 1075 | my $parameter_name = $parameter; |
1076 | $parameter_name =~ s/\[.*//; | 1076 | $parameter_name =~ s/\[.*//; |
1077 | 1077 | ||
1078 | print ".IP \"".$parameter."\" 12\n"; | 1078 | print ".IP \"" . $parameter . "\" 12\n"; |
1079 | output_highlight($args{'parameterdescs'}{$parameter_name}); | 1079 | output_highlight($args{'parameterdescs'}{$parameter_name}); |
1080 | } | 1080 | } |
1081 | foreach $section (@{$args{'sectionlist'}}) { | 1081 | foreach $section (@{$args{'sectionlist'}}) { |
@@ -1094,10 +1094,10 @@ sub output_enum_man(%) { | |||
1094 | print ".TH \"$args{'module'}\" 9 \"enum $args{'enum'}\" \"$man_date\" \"API Manual\" LINUX\n"; | 1094 | print ".TH \"$args{'module'}\" 9 \"enum $args{'enum'}\" \"$man_date\" \"API Manual\" LINUX\n"; |
1095 | 1095 | ||
1096 | print ".SH NAME\n"; | 1096 | print ".SH NAME\n"; |
1097 | print "enum ".$args{'enum'}." \\- ".$args{'purpose'}."\n"; | 1097 | print "enum " . $args{'enum'} . " \\- " . $args{'purpose'} . "\n"; |
1098 | 1098 | ||
1099 | print ".SH SYNOPSIS\n"; | 1099 | print ".SH SYNOPSIS\n"; |
1100 | print "enum ".$args{'enum'}." {\n"; | 1100 | print "enum " . $args{'enum'} . " {\n"; |
1101 | $count = 0; | 1101 | $count = 0; |
1102 | foreach my $parameter (@{$args{'parameterlist'}}) { | 1102 | foreach my $parameter (@{$args{'parameterlist'}}) { |
1103 | print ".br\n.BI \" $parameter\"\n"; | 1103 | print ".br\n.BI \" $parameter\"\n"; |
@@ -1116,7 +1116,7 @@ sub output_enum_man(%) { | |||
1116 | my $parameter_name = $parameter; | 1116 | my $parameter_name = $parameter; |
1117 | $parameter_name =~ s/\[.*//; | 1117 | $parameter_name =~ s/\[.*//; |
1118 | 1118 | ||
1119 | print ".IP \"".$parameter."\" 12\n"; | 1119 | print ".IP \"" . $parameter . "\" 12\n"; |
1120 | output_highlight($args{'parameterdescs'}{$parameter_name}); | 1120 | output_highlight($args{'parameterdescs'}{$parameter_name}); |
1121 | } | 1121 | } |
1122 | foreach $section (@{$args{'sectionlist'}}) { | 1122 | foreach $section (@{$args{'sectionlist'}}) { |
@@ -1131,13 +1131,13 @@ sub output_struct_man(%) { | |||
1131 | my %args = %{$_[0]}; | 1131 | my %args = %{$_[0]}; |
1132 | my ($parameter, $section); | 1132 | my ($parameter, $section); |
1133 | 1133 | ||
1134 | print ".TH \"$args{'module'}\" 9 \"".$args{'type'}." ".$args{'struct'}."\" \"$man_date\" \"API Manual\" LINUX\n"; | 1134 | print ".TH \"$args{'module'}\" 9 \"" . $args{'type'} . " " . $args{'struct'} . "\" \"$man_date\" \"API Manual\" LINUX\n"; |
1135 | 1135 | ||
1136 | print ".SH NAME\n"; | 1136 | print ".SH NAME\n"; |
1137 | print $args{'type'}." ".$args{'struct'}." \\- ".$args{'purpose'}."\n"; | 1137 | print $args{'type'} . " " . $args{'struct'} . " \\- " . $args{'purpose'} . "\n"; |
1138 | 1138 | ||
1139 | print ".SH SYNOPSIS\n"; | 1139 | print ".SH SYNOPSIS\n"; |
1140 | print $args{'type'}." ".$args{'struct'}." {\n.br\n"; | 1140 | print $args{'type'} . " " . $args{'struct'} . " {\n.br\n"; |
1141 | 1141 | ||
1142 | foreach my $parameter (@{$args{'parameterlist'}}) { | 1142 | foreach my $parameter (@{$args{'parameterlist'}}) { |
1143 | if ($parameter =~ /^#/) { | 1143 | if ($parameter =~ /^#/) { |
@@ -1151,13 +1151,13 @@ sub output_struct_man(%) { | |||
1151 | $type = $args{'parametertypes'}{$parameter}; | 1151 | $type = $args{'parametertypes'}{$parameter}; |
1152 | if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { | 1152 | if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { |
1153 | # pointer-to-function | 1153 | # pointer-to-function |
1154 | print ".BI \" ".$1."\" ".$parameter." \") (".$2.")"."\"\n;\n"; | 1154 | print ".BI \" " . $1 . "\" " . $parameter . " \") (" . $2 . ")" . "\"\n;\n"; |
1155 | } elsif ($type =~ m/^(.*?)\s*(:.*)/) { | 1155 | } elsif ($type =~ m/^(.*?)\s*(:.*)/) { |
1156 | # bitfield | 1156 | # bitfield |
1157 | print ".BI \" ".$1."\ \" ".$parameter.$2." \""."\"\n;\n"; | 1157 | print ".BI \" " . $1 . "\ \" " . $parameter . $2 . " \"" . "\"\n;\n"; |
1158 | } else { | 1158 | } else { |
1159 | $type =~ s/([^\*])$/$1 /; | 1159 | $type =~ s/([^\*])$/$1 /; |
1160 | print ".BI \" ".$type."\" ".$parameter." \""."\"\n;\n"; | 1160 | print ".BI \" " . $type . "\" " . $parameter . " \"" . "\"\n;\n"; |
1161 | } | 1161 | } |
1162 | print "\n.br\n"; | 1162 | print "\n.br\n"; |
1163 | } | 1163 | } |
@@ -1171,7 +1171,7 @@ sub output_struct_man(%) { | |||
1171 | $parameter_name =~ s/\[.*//; | 1171 | $parameter_name =~ s/\[.*//; |
1172 | 1172 | ||
1173 | ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; | 1173 | ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; |
1174 | print ".IP \"".$parameter."\" 12\n"; | 1174 | print ".IP \"" . $parameter . "\" 12\n"; |
1175 | output_highlight($args{'parameterdescs'}{$parameter_name}); | 1175 | output_highlight($args{'parameterdescs'}{$parameter_name}); |
1176 | } | 1176 | } |
1177 | foreach $section (@{$args{'sectionlist'}}) { | 1177 | foreach $section (@{$args{'sectionlist'}}) { |
@@ -1189,7 +1189,7 @@ sub output_typedef_man(%) { | |||
1189 | print ".TH \"$args{'module'}\" 9 \"$args{'typedef'}\" \"$man_date\" \"API Manual\" LINUX\n"; | 1189 | print ".TH \"$args{'module'}\" 9 \"$args{'typedef'}\" \"$man_date\" \"API Manual\" LINUX\n"; |
1190 | 1190 | ||
1191 | print ".SH NAME\n"; | 1191 | print ".SH NAME\n"; |
1192 | print "typedef ".$args{'typedef'}." \\- ".$args{'purpose'}."\n"; | 1192 | print "typedef " . $args{'typedef'} . " \\- " . $args{'purpose'} . "\n"; |
1193 | 1193 | ||
1194 | foreach $section (@{$args{'sectionlist'}}) { | 1194 | foreach $section (@{$args{'sectionlist'}}) { |
1195 | print ".SH \"$section\"\n"; | 1195 | print ".SH \"$section\"\n"; |
@@ -1218,13 +1218,13 @@ sub output_function_text(%) { | |||
1218 | my $start; | 1218 | my $start; |
1219 | 1219 | ||
1220 | print "Name:\n\n"; | 1220 | print "Name:\n\n"; |
1221 | print $args{'function'}." - ".$args{'purpose'}."\n"; | 1221 | print $args{'function'} . " - " . $args{'purpose'} . "\n"; |
1222 | 1222 | ||
1223 | print "\nSynopsis:\n\n"; | 1223 | print "\nSynopsis:\n\n"; |
1224 | if ($args{'functiontype'} ne "") { | 1224 | if ($args{'functiontype'} ne "") { |
1225 | $start = $args{'functiontype'}." ".$args{'function'}." ("; | 1225 | $start = $args{'functiontype'} . " " . $args{'function'} . " ("; |
1226 | } else { | 1226 | } else { |
1227 | $start = $args{'function'}." ("; | 1227 | $start = $args{'function'} . " ("; |
1228 | } | 1228 | } |
1229 | print $start; | 1229 | print $start; |
1230 | 1230 | ||
@@ -1233,9 +1233,9 @@ sub output_function_text(%) { | |||
1233 | $type = $args{'parametertypes'}{$parameter}; | 1233 | $type = $args{'parametertypes'}{$parameter}; |
1234 | if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { | 1234 | if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { |
1235 | # pointer-to-function | 1235 | # pointer-to-function |
1236 | print $1.$parameter.") (".$2; | 1236 | print $1 . $parameter . ") (" . $2; |
1237 | } else { | 1237 | } else { |
1238 | print $type." ".$parameter; | 1238 | print $type . " " . $parameter; |
1239 | } | 1239 | } |
1240 | if ($count != $#{$args{'parameterlist'}}) { | 1240 | if ($count != $#{$args{'parameterlist'}}) { |
1241 | $count++; | 1241 | $count++; |
@@ -1251,7 +1251,7 @@ sub output_function_text(%) { | |||
1251 | my $parameter_name = $parameter; | 1251 | my $parameter_name = $parameter; |
1252 | $parameter_name =~ s/\[.*//; | 1252 | $parameter_name =~ s/\[.*//; |
1253 | 1253 | ||
1254 | print $parameter."\n\t".$args{'parameterdescs'}{$parameter_name}."\n"; | 1254 | print $parameter . "\n\t" . $args{'parameterdescs'}{$parameter_name} . "\n"; |
1255 | } | 1255 | } |
1256 | output_section_text(@_); | 1256 | output_section_text(@_); |
1257 | } | 1257 | } |
@@ -1276,8 +1276,8 @@ sub output_enum_text(%) { | |||
1276 | my $count; | 1276 | my $count; |
1277 | print "Enum:\n\n"; | 1277 | print "Enum:\n\n"; |
1278 | 1278 | ||
1279 | print "enum ".$args{'enum'}." - ".$args{'purpose'}."\n\n"; | 1279 | print "enum " . $args{'enum'} . " - " . $args{'purpose'} . "\n\n"; |
1280 | print "enum ".$args{'enum'}." {\n"; | 1280 | print "enum " . $args{'enum'} . " {\n"; |
1281 | $count = 0; | 1281 | $count = 0; |
1282 | foreach $parameter (@{$args{'parameterlist'}}) { | 1282 | foreach $parameter (@{$args{'parameterlist'}}) { |
1283 | print "\t$parameter"; | 1283 | print "\t$parameter"; |
@@ -1292,7 +1292,7 @@ sub output_enum_text(%) { | |||
1292 | print "Constants:\n\n"; | 1292 | print "Constants:\n\n"; |
1293 | foreach $parameter (@{$args{'parameterlist'}}) { | 1293 | foreach $parameter (@{$args{'parameterlist'}}) { |
1294 | print "$parameter\n\t"; | 1294 | print "$parameter\n\t"; |
1295 | print $args{'parameterdescs'}{$parameter}."\n"; | 1295 | print $args{'parameterdescs'}{$parameter} . "\n"; |
1296 | } | 1296 | } |
1297 | 1297 | ||
1298 | output_section_text(@_); | 1298 | output_section_text(@_); |
@@ -1305,7 +1305,7 @@ sub output_typedef_text(%) { | |||
1305 | my $count; | 1305 | my $count; |
1306 | print "Typedef:\n\n"; | 1306 | print "Typedef:\n\n"; |
1307 | 1307 | ||
1308 | print "typedef ".$args{'typedef'}." - ".$args{'purpose'}."\n"; | 1308 | print "typedef " . $args{'typedef'} . " - " . $args{'purpose'} . "\n"; |
1309 | output_section_text(@_); | 1309 | output_section_text(@_); |
1310 | } | 1310 | } |
1311 | 1311 | ||
@@ -1314,8 +1314,8 @@ sub output_struct_text(%) { | |||
1314 | my %args = %{$_[0]}; | 1314 | my %args = %{$_[0]}; |
1315 | my ($parameter); | 1315 | my ($parameter); |
1316 | 1316 | ||
1317 | print $args{'type'}." ".$args{'struct'}." - ".$args{'purpose'}."\n\n"; | 1317 | print $args{'type'} . " " . $args{'struct'} . " - " . $args{'purpose'} . "\n\n"; |
1318 | print $args{'type'}." ".$args{'struct'}." {\n"; | 1318 | print $args{'type'} . " " . $args{'struct'} . " {\n"; |
1319 | foreach $parameter (@{$args{'parameterlist'}}) { | 1319 | foreach $parameter (@{$args{'parameterlist'}}) { |
1320 | if ($parameter =~ /^#/) { | 1320 | if ($parameter =~ /^#/) { |
1321 | print "$parameter\n"; | 1321 | print "$parameter\n"; |
@@ -1334,7 +1334,7 @@ sub output_struct_text(%) { | |||
1334 | # bitfield | 1334 | # bitfield |
1335 | print "\t$1 $parameter$2;\n"; | 1335 | print "\t$1 $parameter$2;\n"; |
1336 | } else { | 1336 | } else { |
1337 | print "\t".$type." ".$parameter.";\n"; | 1337 | print "\t" . $type . " " . $parameter . ";\n"; |
1338 | } | 1338 | } |
1339 | } | 1339 | } |
1340 | print "};\n\n"; | 1340 | print "};\n\n"; |
@@ -1348,7 +1348,7 @@ sub output_struct_text(%) { | |||
1348 | 1348 | ||
1349 | ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; | 1349 | ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; |
1350 | print "$parameter\n\t"; | 1350 | print "$parameter\n\t"; |
1351 | print $args{'parameterdescs'}{$parameter_name}."\n"; | 1351 | print $args{'parameterdescs'}{$parameter_name} . "\n"; |
1352 | } | 1352 | } |
1353 | print "\n"; | 1353 | print "\n"; |
1354 | output_section_text(@_); | 1354 | output_section_text(@_); |
@@ -1387,7 +1387,7 @@ sub output_declaration { | |||
1387 | # generic output function - calls the right one based on current output mode. | 1387 | # generic output function - calls the right one based on current output mode. |
1388 | sub output_blockhead { | 1388 | sub output_blockhead { |
1389 | no strict 'refs'; | 1389 | no strict 'refs'; |
1390 | my $func = "output_blockhead_".$output_mode; | 1390 | my $func = "output_blockhead_" . $output_mode; |
1391 | &$func(@_); | 1391 | &$func(@_); |
1392 | $section_counter++; | 1392 | $section_counter++; |
1393 | } | 1393 | } |
@@ -1398,7 +1398,7 @@ sub output_blockhead { | |||
1398 | sub dump_declaration($$) { | 1398 | sub dump_declaration($$) { |
1399 | no strict 'refs'; | 1399 | no strict 'refs'; |
1400 | my ($prototype, $file) = @_; | 1400 | my ($prototype, $file) = @_; |
1401 | my $func = "dump_".$decl_type; | 1401 | my $func = "dump_" . $decl_type; |
1402 | &$func(@_); | 1402 | &$func(@_); |
1403 | } | 1403 | } |
1404 | 1404 | ||
@@ -1645,7 +1645,7 @@ sub push_parameter($$$) { | |||
1645 | "or member '$param' not " . | 1645 | "or member '$param' not " . |
1646 | "described in '$declaration_name'\n"; | 1646 | "described in '$declaration_name'\n"; |
1647 | } | 1647 | } |
1648 | print STDERR "Warning(${file}:$.):". | 1648 | print STDERR "Warning(${file}:$.):" . |
1649 | " No description found for parameter '$param'\n"; | 1649 | " No description found for parameter '$param'\n"; |
1650 | ++$warnings; | 1650 | ++$warnings; |
1651 | } | 1651 | } |
@@ -1929,7 +1929,7 @@ sub process_state3_type($$) { | |||
1929 | ($2 eq '{') && $brcount++; | 1929 | ($2 eq '{') && $brcount++; |
1930 | ($2 eq '}') && $brcount--; | 1930 | ($2 eq '}') && $brcount--; |
1931 | if (($2 eq ';') && ($brcount == 0)) { | 1931 | if (($2 eq ';') && ($brcount == 0)) { |
1932 | dump_declaration($prototype,$file); | 1932 | dump_declaration($prototype, $file); |
1933 | reset_state(); | 1933 | reset_state(); |
1934 | last; | 1934 | last; |
1935 | } | 1935 | } |
@@ -2106,7 +2106,7 @@ sub process_file($) { | |||
2106 | $section = $section_default; | 2106 | $section = $section_default; |
2107 | $contents = ""; | 2107 | $contents = ""; |
2108 | } else { | 2108 | } else { |
2109 | $contents .= $1."\n"; | 2109 | $contents .= $1 . "\n"; |
2110 | } | 2110 | } |
2111 | } else { | 2111 | } else { |
2112 | # i dont know - bad line? ignore. | 2112 | # i dont know - bad line? ignore. |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 161b7846733..4522948a012 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -763,6 +763,8 @@ static void check_section(const char *modname, struct elf_info *elf, | |||
763 | 763 | ||
764 | 764 | ||
765 | #define ALL_INIT_DATA_SECTIONS \ | 765 | #define ALL_INIT_DATA_SECTIONS \ |
766 | ".init.setup$", ".init.rodata$", \ | ||
767 | ".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$" \ | ||
766 | ".init.data$", ".devinit.data$", ".cpuinit.data$", ".meminit.data$" | 768 | ".init.data$", ".devinit.data$", ".cpuinit.data$", ".meminit.data$" |
767 | #define ALL_EXIT_DATA_SECTIONS \ | 769 | #define ALL_EXIT_DATA_SECTIONS \ |
768 | ".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$" | 770 | ".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$" |
@@ -772,21 +774,23 @@ static void check_section(const char *modname, struct elf_info *elf, | |||
772 | #define ALL_EXIT_TEXT_SECTIONS \ | 774 | #define ALL_EXIT_TEXT_SECTIONS \ |
773 | ".exit.text$", ".devexit.text$", ".cpuexit.text$", ".memexit.text$" | 775 | ".exit.text$", ".devexit.text$", ".cpuexit.text$", ".memexit.text$" |
774 | 776 | ||
775 | #define ALL_INIT_SECTIONS ALL_INIT_DATA_SECTIONS, ALL_INIT_TEXT_SECTIONS | 777 | #define ALL_INIT_SECTIONS INIT_SECTIONS, DEV_INIT_SECTIONS, \ |
776 | #define ALL_EXIT_SECTIONS ALL_EXIT_DATA_SECTIONS, ALL_EXIT_TEXT_SECTIONS | 778 | CPU_INIT_SECTIONS, MEM_INIT_SECTIONS |
779 | #define ALL_EXIT_SECTIONS EXIT_SECTIONS, DEV_EXIT_SECTIONS, \ | ||
780 | CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS | ||
777 | 781 | ||
778 | #define DATA_SECTIONS ".data$", ".data.rel$" | 782 | #define DATA_SECTIONS ".data$", ".data.rel$" |
779 | #define TEXT_SECTIONS ".text$" | 783 | #define TEXT_SECTIONS ".text$" |
780 | 784 | ||
781 | #define INIT_SECTIONS ".init.data$", ".init.text$" | 785 | #define INIT_SECTIONS ".init.*" |
782 | #define DEV_INIT_SECTIONS ".devinit.data$", ".devinit.text$" | 786 | #define DEV_INIT_SECTIONS ".devinit.*" |
783 | #define CPU_INIT_SECTIONS ".cpuinit.data$", ".cpuinit.text$" | 787 | #define CPU_INIT_SECTIONS ".cpuinit.*" |
784 | #define MEM_INIT_SECTIONS ".meminit.data$", ".meminit.text$" | 788 | #define MEM_INIT_SECTIONS ".meminit.*" |
785 | 789 | ||
786 | #define EXIT_SECTIONS ".exit.data$", ".exit.text$" | 790 | #define EXIT_SECTIONS ".exit.*" |
787 | #define DEV_EXIT_SECTIONS ".devexit.data$", ".devexit.text$" | 791 | #define DEV_EXIT_SECTIONS ".devexit.*" |
788 | #define CPU_EXIT_SECTIONS ".cpuexit.data$", ".cpuexit.text$" | 792 | #define CPU_EXIT_SECTIONS ".cpuexit.*" |
789 | #define MEM_EXIT_SECTIONS ".memexit.data$", ".memexit.text$" | 793 | #define MEM_EXIT_SECTIONS ".memexit.*" |
790 | 794 | ||
791 | /* init data sections */ | 795 | /* init data sections */ |
792 | static const char *init_data_sections[] = { ALL_INIT_DATA_SECTIONS, NULL }; | 796 | static const char *init_data_sections[] = { ALL_INIT_DATA_SECTIONS, NULL }; |
@@ -869,12 +873,36 @@ const struct sectioncheck sectioncheck[] = { | |||
869 | .tosec = { INIT_SECTIONS, NULL }, | 873 | .tosec = { INIT_SECTIONS, NULL }, |
870 | .mismatch = XXXINIT_TO_INIT, | 874 | .mismatch = XXXINIT_TO_INIT, |
871 | }, | 875 | }, |
876 | /* Do not reference cpuinit code/data from meminit code/data */ | ||
877 | { | ||
878 | .fromsec = { MEM_INIT_SECTIONS, NULL }, | ||
879 | .tosec = { CPU_INIT_SECTIONS, NULL }, | ||
880 | .mismatch = XXXINIT_TO_INIT, | ||
881 | }, | ||
882 | /* Do not reference meminit code/data from cpuinit code/data */ | ||
883 | { | ||
884 | .fromsec = { CPU_INIT_SECTIONS, NULL }, | ||
885 | .tosec = { MEM_INIT_SECTIONS, NULL }, | ||
886 | .mismatch = XXXINIT_TO_INIT, | ||
887 | }, | ||
872 | /* Do not reference exit code/data from devexit/cpuexit/memexit code/data */ | 888 | /* Do not reference exit code/data from devexit/cpuexit/memexit code/data */ |
873 | { | 889 | { |
874 | .fromsec = { DEV_EXIT_SECTIONS, CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS, NULL }, | 890 | .fromsec = { DEV_EXIT_SECTIONS, CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS, NULL }, |
875 | .tosec = { EXIT_SECTIONS, NULL }, | 891 | .tosec = { EXIT_SECTIONS, NULL }, |
876 | .mismatch = XXXEXIT_TO_EXIT, | 892 | .mismatch = XXXEXIT_TO_EXIT, |
877 | }, | 893 | }, |
894 | /* Do not reference cpuexit code/data from memexit code/data */ | ||
895 | { | ||
896 | .fromsec = { MEM_EXIT_SECTIONS, NULL }, | ||
897 | .tosec = { CPU_EXIT_SECTIONS, NULL }, | ||
898 | .mismatch = XXXEXIT_TO_EXIT, | ||
899 | }, | ||
900 | /* Do not reference memexit code/data from cpuexit code/data */ | ||
901 | { | ||
902 | .fromsec = { CPU_EXIT_SECTIONS, NULL }, | ||
903 | .tosec = { MEM_EXIT_SECTIONS, NULL }, | ||
904 | .mismatch = XXXEXIT_TO_EXIT, | ||
905 | }, | ||
878 | /* Do not use exit code/data from init code */ | 906 | /* Do not use exit code/data from init code */ |
879 | { | 907 | { |
880 | .fromsec = { ALL_INIT_SECTIONS, NULL }, | 908 | .fromsec = { ALL_INIT_SECTIONS, NULL }, |
@@ -1168,7 +1196,7 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch, | |||
1168 | "The variable %s references\n" | 1196 | "The variable %s references\n" |
1169 | "the %s %s%s%s\n" | 1197 | "the %s %s%s%s\n" |
1170 | "If the reference is valid then annotate the\n" | 1198 | "If the reference is valid then annotate the\n" |
1171 | "variable with __init* (see linux/init.h) " | 1199 | "variable with __init* or __refdata (see linux/init.h) " |
1172 | "or name the variable:\n", | 1200 | "or name the variable:\n", |
1173 | fromsym, to, sec2annotation(tosec), tosym, to_p); | 1201 | fromsym, to, sec2annotation(tosec), tosym, to_p); |
1174 | while (*s) | 1202 | while (*s) |
diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 1264b8e2829..01c2d13dd02 100644 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb | |||
@@ -1,38 +1,58 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # | 2 | # |
3 | # builddeb 1.2 | 3 | # builddeb 1.3 |
4 | # Copyright 2003 Wichert Akkerman <wichert@wiggy.net> | 4 | # Copyright 2003 Wichert Akkerman <wichert@wiggy.net> |
5 | # | 5 | # |
6 | # Simple script to generate a deb package for a Linux kernel. All the | 6 | # Simple script to generate a deb package for a Linux kernel. All the |
7 | # complexity of what to do with a kernel after it is installer or removed | 7 | # complexity of what to do with a kernel after it is installed or removed |
8 | # is left to other scripts and packages: they can install scripts in the | 8 | # is left to other scripts and packages: they can install scripts in the |
9 | # /etc/kernel/{pre,post}{inst,rm}.d/ directories that will be called on | 9 | # /etc/kernel/{pre,post}{inst,rm}.d/ directories (or an alternative location |
10 | # package install and removal. | 10 | # specified in KDEB_HOOKDIR) that will be called on package install and |
11 | # removal. | ||
11 | 12 | ||
12 | set -e | 13 | set -e |
13 | 14 | ||
15 | create_package() { | ||
16 | local pname="$1" pdir="$2" | ||
17 | |||
18 | cp debian/copyright "$pdir/usr/share/doc/$pname/" | ||
19 | |||
20 | # Fix ownership and permissions | ||
21 | chown -R root:root "$pdir" | ||
22 | chmod -R go-w "$pdir" | ||
23 | |||
24 | # Create the package | ||
25 | dpkg-gencontrol -isp -p$pname -P"$pdir" | ||
26 | dpkg --build "$pdir" .. | ||
27 | } | ||
28 | |||
14 | # Some variables and settings used throughout the script | 29 | # Some variables and settings used throughout the script |
15 | version=$KERNELRELEASE | 30 | version=$KERNELRELEASE |
16 | revision=`cat .version` | 31 | revision=$(cat .version) |
32 | if [ -n "$KDEB_PKGVERSION" ]; then | ||
33 | packageversion=$KDEB_PKGVERSION | ||
34 | else | ||
35 | packageversion=$version-$revision | ||
36 | fi | ||
17 | tmpdir="$objtree/debian/tmp" | 37 | tmpdir="$objtree/debian/tmp" |
18 | fwdir="$objtree/debian/fwtmp" | 38 | fwdir="$objtree/debian/fwtmp" |
19 | packagename=linux-$version | 39 | packagename=linux-image-$version |
20 | fwpackagename=linux-firmware-image | 40 | fwpackagename=linux-firmware-image |
21 | 41 | ||
22 | if [ "$ARCH" == "um" ] ; then | 42 | if [ "$ARCH" = "um" ] ; then |
23 | packagename=user-mode-linux-$version | 43 | packagename=user-mode-linux-$version |
24 | fi | 44 | fi |
25 | 45 | ||
26 | # Setup the directory structure | 46 | # Setup the directory structure |
27 | rm -rf "$tmpdir" "$fwdir" | 47 | rm -rf "$tmpdir" "$fwdir" |
28 | mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" | 48 | mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" "$tmpdir/usr/share/doc/$packagename" |
29 | mkdir -p "$fwdir/DEBIAN" "$fwdir/lib" | 49 | mkdir -p "$fwdir/DEBIAN" "$fwdir/lib" "$fwdir/usr/share/doc/$fwpackagename" |
30 | if [ "$ARCH" == "um" ] ; then | 50 | if [ "$ARCH" = "um" ] ; then |
31 | mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/share/doc/$packagename" "$tmpdir/usr/bin" | 51 | mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/bin" |
32 | fi | 52 | fi |
33 | 53 | ||
34 | # Build and install the kernel | 54 | # Build and install the kernel |
35 | if [ "$ARCH" == "um" ] ; then | 55 | if [ "$ARCH" = "um" ] ; then |
36 | $MAKE linux | 56 | $MAKE linux |
37 | cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map" | 57 | cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map" |
38 | cp .config "$tmpdir/usr/share/doc/$packagename/config" | 58 | cp .config "$tmpdir/usr/share/doc/$packagename/config" |
@@ -41,53 +61,100 @@ if [ "$ARCH" == "um" ] ; then | |||
41 | else | 61 | else |
42 | cp System.map "$tmpdir/boot/System.map-$version" | 62 | cp System.map "$tmpdir/boot/System.map-$version" |
43 | cp .config "$tmpdir/boot/config-$version" | 63 | cp .config "$tmpdir/boot/config-$version" |
44 | cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version" | 64 | # Not all arches include the boot path in KBUILD_IMAGE |
65 | if ! cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"; then | ||
66 | cp arch/$ARCH/boot/$KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version" | ||
67 | fi | ||
45 | fi | 68 | fi |
46 | 69 | ||
47 | if grep -q '^CONFIG_MODULES=y' .config ; then | 70 | if grep -q '^CONFIG_MODULES=y' .config ; then |
48 | INSTALL_MOD_PATH="$tmpdir" make KBUILD_SRC= modules_install | 71 | INSTALL_MOD_PATH="$tmpdir" make KBUILD_SRC= modules_install |
49 | if [ "$ARCH" == "um" ] ; then | 72 | if [ "$ARCH" = "um" ] ; then |
50 | mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/" | 73 | mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/" |
51 | rmdir "$tmpdir/lib/modules/$version" | 74 | rmdir "$tmpdir/lib/modules/$version" |
52 | fi | 75 | fi |
53 | fi | 76 | fi |
54 | 77 | ||
55 | # Install the maintainer scripts | 78 | # Install the maintainer scripts |
79 | # Note: hook scripts under /etc/kernel are also executed by official Debian | ||
80 | # kernel packages, as well as kernel packages built using make-kpkg | ||
81 | debhookdir=${KDEB_HOOKDIR:-/etc/kernel} | ||
56 | for script in postinst postrm preinst prerm ; do | 82 | for script in postinst postrm preinst prerm ; do |
57 | mkdir -p "$tmpdir/etc/kernel/$script.d" | 83 | mkdir -p "$tmpdir$debhookdir/$script.d" |
58 | cat <<EOF > "$tmpdir/DEBIAN/$script" | 84 | cat <<EOF > "$tmpdir/DEBIAN/$script" |
59 | #!/bin/sh | 85 | #!/bin/sh |
60 | 86 | ||
61 | set -e | 87 | set -e |
62 | 88 | ||
63 | test -d /etc/kernel/$script.d && run-parts --arg="$version" /etc/kernel/$script.d | 89 | # Pass maintainer script parameters to hook scripts |
90 | export DEB_MAINT_PARAMS="\$@" | ||
91 | |||
92 | test -d $debhookdir/$script.d && run-parts --arg="$version" $debhookdir/$script.d | ||
64 | exit 0 | 93 | exit 0 |
65 | EOF | 94 | EOF |
66 | chmod 755 "$tmpdir/DEBIAN/$script" | 95 | chmod 755 "$tmpdir/DEBIAN/$script" |
67 | done | 96 | done |
68 | 97 | ||
69 | name="Kernel Compiler <$(id -nu)@$(hostname -f)>" | 98 | # Try to determine maintainer and email values |
99 | if [ -n "$DEBEMAIL" ]; then | ||
100 | email=$DEBEMAIL | ||
101 | elif [ -n "$EMAIL" ]; then | ||
102 | email=$EMAIL | ||
103 | else | ||
104 | email=$(id -nu)@$(hostname -f) | ||
105 | fi | ||
106 | if [ -n "$DEBFULLNAME" ]; then | ||
107 | name=$DEBFULLNAME | ||
108 | elif [ -n "$NAME" ]; then | ||
109 | name=$NAME | ||
110 | else | ||
111 | name="Anonymous" | ||
112 | fi | ||
113 | maintainer="$name <$email>" | ||
114 | |||
70 | # Generate a simple changelog template | 115 | # Generate a simple changelog template |
71 | cat <<EOF > debian/changelog | 116 | cat <<EOF > debian/changelog |
72 | linux ($version-$revision) unstable; urgency=low | 117 | linux-upstream ($packageversion) unstable; urgency=low |
73 | 118 | ||
74 | * A standard release | 119 | * Custom built Linux kernel. |
75 | 120 | ||
76 | -- $name $(date -R) | 121 | -- $maintainer $(date -R) |
77 | EOF | 122 | EOF |
78 | 123 | ||
79 | # Generate a control file | 124 | # Generate copyright file |
80 | if [ "$ARCH" == "um" ]; then | 125 | cat <<EOF > debian/copyright |
126 | This is a packacked upstream version of the Linux kernel. | ||
127 | |||
128 | The sources may be found at most Linux ftp sites, including: | ||
129 | ftp://ftp.kernel.org/pub/linux/kernel | ||
81 | 130 | ||
131 | Copyright: 1991 - 2009 Linus Torvalds and others. | ||
132 | |||
133 | The git repository for mainline kernel development is at: | ||
134 | git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git | ||
135 | |||
136 | This program is free software; you can redistribute it and/or modify | ||
137 | it under the terms of the GNU General Public License as published by | ||
138 | the Free Software Foundation; version 2 dated June, 1991. | ||
139 | |||
140 | On Debian GNU/Linux systems, the complete text of the GNU General Public | ||
141 | License version 2 can be found in \`/usr/share/common-licenses/GPL-2'. | ||
142 | EOF | ||
143 | |||
144 | # Generate a control file | ||
82 | cat <<EOF > debian/control | 145 | cat <<EOF > debian/control |
83 | Source: linux | 146 | Source: linux-upstream |
84 | Section: base | 147 | Section: admin |
85 | Priority: optional | 148 | Priority: optional |
86 | Maintainer: $name | 149 | Maintainer: $maintainer |
87 | Standards-Version: 3.6.1 | 150 | Standards-Version: 3.8.1 |
151 | EOF | ||
152 | |||
153 | if [ "$ARCH" = "um" ]; then | ||
154 | cat <<EOF >> debian/control | ||
88 | 155 | ||
89 | Package: $packagename | 156 | Package: $packagename |
90 | Provides: kernel-image-$version, linux-image-$version | 157 | Provides: linux-image, linux-image-2.6, linux-modules-$version |
91 | Architecture: any | 158 | Architecture: any |
92 | Description: User Mode Linux kernel, version $version | 159 | Description: User Mode Linux kernel, version $version |
93 | User-mode Linux is a port of the Linux kernel to its own system call | 160 | User-mode Linux is a port of the Linux kernel to its own system call |
@@ -97,30 +164,22 @@ Description: User Mode Linux kernel, version $version | |||
97 | many other things. | 164 | many other things. |
98 | . | 165 | . |
99 | This package contains the Linux kernel, modules and corresponding other | 166 | This package contains the Linux kernel, modules and corresponding other |
100 | files version $version | 167 | files, version: $version. |
101 | EOF | 168 | EOF |
102 | 169 | ||
103 | else | 170 | else |
104 | cat <<EOF > debian/control | 171 | cat <<EOF >> debian/control |
105 | Source: linux | ||
106 | Section: base | ||
107 | Priority: optional | ||
108 | Maintainer: $name | ||
109 | Standards-Version: 3.6.1 | ||
110 | 172 | ||
111 | Package: $packagename | 173 | Package: $packagename |
112 | Provides: kernel-image-$version, linux-image-$version | 174 | Provides: linux-image, linux-image-2.6, linux-modules-$version |
113 | Suggests: $fwpackagename | 175 | Suggests: $fwpackagename |
114 | Architecture: any | 176 | Architecture: any |
115 | Description: Linux kernel, version $version | 177 | Description: Linux kernel, version $version |
116 | This package contains the Linux kernel, modules and corresponding other | 178 | This package contains the Linux kernel, modules and corresponding other |
117 | files version $version | 179 | files, version: $version. |
118 | EOF | 180 | EOF |
119 | fi | ||
120 | 181 | ||
121 | # Fix some ownership and permissions | 182 | fi |
122 | chown -R root:root "$tmpdir" | ||
123 | chmod -R go-w "$tmpdir" | ||
124 | 183 | ||
125 | # Do we have firmware? Move it out of the way and build it into a package. | 184 | # Do we have firmware? Move it out of the way and build it into a package. |
126 | if [ -e "$tmpdir/lib/firmware" ]; then | 185 | if [ -e "$tmpdir/lib/firmware" ]; then |
@@ -131,16 +190,12 @@ if [ -e "$tmpdir/lib/firmware" ]; then | |||
131 | Package: $fwpackagename | 190 | Package: $fwpackagename |
132 | Architecture: all | 191 | Architecture: all |
133 | Description: Linux kernel firmware, version $version | 192 | Description: Linux kernel firmware, version $version |
134 | This package contains firmware from the Linux kernel, version $version | 193 | This package contains firmware from the Linux kernel, version $version. |
135 | EOF | 194 | EOF |
136 | 195 | ||
137 | dpkg-gencontrol -isp -p$fwpackagename -P"$fwdir" | 196 | create_package "$fwpackagename" "$fwdir" |
138 | dpkg --build "$fwdir" .. | ||
139 | fi | 197 | fi |
140 | 198 | ||
141 | # Perform the final magic | 199 | create_package "$packagename" "$tmpdir" |
142 | dpkg-gencontrol -isp -p$packagename | ||
143 | dpkg --build "$tmpdir" .. | ||
144 | 200 | ||
145 | exit 0 | 201 | exit 0 |
146 | |||
diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 00790472f64..46989b88d73 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion | |||
@@ -39,8 +39,10 @@ if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then | |||
39 | printf -- '-svn%s' "`git svn find-rev $head`" | 39 | printf -- '-svn%s' "`git svn find-rev $head`" |
40 | fi | 40 | fi |
41 | 41 | ||
42 | # Are there uncommitted changes? | 42 | # Update index only on r/w media |
43 | git update-index --refresh --unmerged > /dev/null | 43 | [ -w . ] && git update-index --refresh --unmerged > /dev/null |
44 | |||
45 | # Check for uncommitted changes | ||
44 | if git diff-index --name-only HEAD | grep -v "^scripts/package" \ | 46 | if git diff-index --name-only HEAD | grep -v "^scripts/package" \ |
45 | | read dummy; then | 47 | | read dummy; then |
46 | printf '%s' -dirty | 48 | printf '%s' -dirty |
diff --git a/scripts/unifdef.c b/scripts/unifdef.c index 05a31a6c7e1..30d459fb070 100644 --- a/scripts/unifdef.c +++ b/scripts/unifdef.c | |||
@@ -678,8 +678,10 @@ eval_unary(const struct ops *ops, int *valp, const char **cpp) | |||
678 | if (*cp == '!') { | 678 | if (*cp == '!') { |
679 | debug("eval%d !", ops - eval_ops); | 679 | debug("eval%d !", ops - eval_ops); |
680 | cp++; | 680 | cp++; |
681 | if (eval_unary(ops, valp, &cp) == LT_IF) | 681 | if (eval_unary(ops, valp, &cp) == LT_IF) { |
682 | *cpp = cp; | ||
682 | return (LT_IF); | 683 | return (LT_IF); |
684 | } | ||
683 | *valp = !*valp; | 685 | *valp = !*valp; |
684 | } else if (*cp == '(') { | 686 | } else if (*cp == '(') { |
685 | cp++; | 687 | cp++; |
@@ -700,13 +702,16 @@ eval_unary(const struct ops *ops, int *valp, const char **cpp) | |||
700 | return (LT_IF); | 702 | return (LT_IF); |
701 | cp = skipcomment(cp); | 703 | cp = skipcomment(cp); |
702 | sym = findsym(cp); | 704 | sym = findsym(cp); |
703 | if (sym < 0) | ||
704 | return (LT_IF); | ||
705 | *valp = (value[sym] != NULL); | ||
706 | cp = skipsym(cp); | 705 | cp = skipsym(cp); |
707 | cp = skipcomment(cp); | 706 | cp = skipcomment(cp); |
708 | if (*cp++ != ')') | 707 | if (*cp++ != ')') |
709 | return (LT_IF); | 708 | return (LT_IF); |
709 | if (sym >= 0) | ||
710 | *valp = (value[sym] != NULL); | ||
711 | else { | ||
712 | *cpp = cp; | ||
713 | return (LT_IF); | ||
714 | } | ||
710 | keepthis = false; | 715 | keepthis = false; |
711 | } else if (!endsym(*cp)) { | 716 | } else if (!endsym(*cp)) { |
712 | debug("eval%d symbol", ops - eval_ops); | 717 | debug("eval%d symbol", ops - eval_ops); |
@@ -741,11 +746,11 @@ eval_table(const struct ops *ops, int *valp, const char **cpp) | |||
741 | const struct op *op; | 746 | const struct op *op; |
742 | const char *cp; | 747 | const char *cp; |
743 | int val; | 748 | int val; |
749 | Linetype lhs, rhs; | ||
744 | 750 | ||
745 | debug("eval%d", ops - eval_ops); | 751 | debug("eval%d", ops - eval_ops); |
746 | cp = *cpp; | 752 | cp = *cpp; |
747 | if (ops->inner(ops+1, valp, &cp) == LT_IF) | 753 | lhs = ops->inner(ops+1, valp, &cp); |
748 | return (LT_IF); | ||
749 | for (;;) { | 754 | for (;;) { |
750 | cp = skipcomment(cp); | 755 | cp = skipcomment(cp); |
751 | for (op = ops->op; op->str != NULL; op++) | 756 | for (op = ops->op; op->str != NULL; op++) |
@@ -755,14 +760,32 @@ eval_table(const struct ops *ops, int *valp, const char **cpp) | |||
755 | break; | 760 | break; |
756 | cp += strlen(op->str); | 761 | cp += strlen(op->str); |
757 | debug("eval%d %s", ops - eval_ops, op->str); | 762 | debug("eval%d %s", ops - eval_ops, op->str); |
758 | if (ops->inner(ops+1, &val, &cp) == LT_IF) | 763 | rhs = ops->inner(ops+1, &val, &cp); |
759 | return (LT_IF); | 764 | if (op->fn == op_and && (lhs == LT_FALSE || rhs == LT_FALSE)) { |
760 | *valp = op->fn(*valp, val); | 765 | debug("eval%d: and always false", ops - eval_ops); |
766 | if (lhs == LT_IF) | ||
767 | *valp = val; | ||
768 | lhs = LT_FALSE; | ||
769 | continue; | ||
770 | } | ||
771 | if (op->fn == op_or && (lhs == LT_TRUE || rhs == LT_TRUE)) { | ||
772 | debug("eval%d: or always true", ops - eval_ops); | ||
773 | if (lhs == LT_IF) | ||
774 | *valp = val; | ||
775 | lhs = LT_TRUE; | ||
776 | continue; | ||
777 | } | ||
778 | if (rhs == LT_IF) | ||
779 | lhs = LT_IF; | ||
780 | if (lhs != LT_IF) | ||
781 | *valp = op->fn(*valp, val); | ||
761 | } | 782 | } |
762 | 783 | ||
763 | *cpp = cp; | 784 | *cpp = cp; |
764 | debug("eval%d = %d", ops - eval_ops, *valp); | 785 | debug("eval%d = %d", ops - eval_ops, *valp); |
765 | return (*valp ? LT_TRUE : LT_FALSE); | 786 | if (lhs != LT_IF) |
787 | lhs = (*valp ? LT_TRUE : LT_FALSE); | ||
788 | return lhs; | ||
766 | } | 789 | } |
767 | 790 | ||
768 | /* | 791 | /* |
@@ -773,12 +796,15 @@ eval_table(const struct ops *ops, int *valp, const char **cpp) | |||
773 | static Linetype | 796 | static Linetype |
774 | ifeval(const char **cpp) | 797 | ifeval(const char **cpp) |
775 | { | 798 | { |
799 | const char *cp = *cpp; | ||
776 | int ret; | 800 | int ret; |
777 | int val; | 801 | int val; |
778 | 802 | ||
779 | debug("eval %s", *cpp); | 803 | debug("eval %s", *cpp); |
780 | keepthis = killconsts ? false : true; | 804 | keepthis = killconsts ? false : true; |
781 | ret = eval_table(eval_ops, &val, cpp); | 805 | ret = eval_table(eval_ops, &val, &cp); |
806 | if (ret != LT_IF) | ||
807 | *cpp = cp; | ||
782 | debug("eval = %d", val); | 808 | debug("eval = %d", val); |
783 | return (keepthis ? LT_IF : ret); | 809 | return (keepthis ? LT_IF : ret); |
784 | } | 810 | } |
diff --git a/scripts/ver_linux b/scripts/ver_linux index dbb3037f134..7de36df4eaa 100755 --- a/scripts/ver_linux +++ b/scripts/ver_linux | |||
@@ -65,7 +65,7 @@ sed -n -e '/^.*\/libc-\([^/]*\)\.so$/{s//\1/;p;q}' < /proc/self/maps | |||
65 | ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \ | 65 | ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \ |
66 | 'NR==1{print "Dynamic linker (ldd) ", $NF}' | 66 | 'NR==1{print "Dynamic linker (ldd) ", $NF}' |
67 | 67 | ||
68 | ls -l /usr/lib/lib{g,stdc}++.so 2>/dev/null | awk -F. \ | 68 | ls -l /usr/lib/libg++.so /usr/lib/libstdc++.so 2>/dev/null | awk -F. \ |
69 | '{print "Linux C++ Library " $4"."$5"."$6}' | 69 | '{print "Linux C++ Library " $4"."$5"."$6}' |
70 | 70 | ||
71 | ps --version 2>&1 | grep version | awk \ | 71 | ps --version 2>&1 | grep version | awk \ |