Commit 45e3e1935e2857c54783291107d33323b3ef33c8
Exists in
master
and in
7 other branches
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next: (53 commits) .gitignore: ignore *.lzma files kbuild: add generic --set-str option to scripts/config kbuild: simplify argument loop in scripts/config kbuild: handle non-existing options in scripts/config kallsyms: generalize text region handling kallsyms: support kernel symbols in Blackfin on-chip memory documentation: make version fix kbuild: fix a compile warning gitignore: Add GNU GLOBAL files to top .gitignore kbuild: fix delay in setlocalversion on readonly source README: fix misleading pointer to the defconf directory vmlinux.lds.h update kernel-doc: cleanup perl script Improve vmlinux.lds.h support for arch specific linker scripts kbuild: fix headers_exports with boolean expression kbuild/headers_check: refine extern check kbuild: fix "Argument list too long" error for "make headers_check", ignore *.patch files Remove bashisms from scripts menu: fix embedded menu presentation ...
Showing 34 changed files Side-by-side Diff
- .gitignore
- Documentation/Changes
- Documentation/kbuild/kconfig.txt
- Documentation/kbuild/modules.txt
- Makefile
- README
- include/asm-generic/vmlinux.lds.h
- include/linux/init.h
- include/linux/section-names.h
- init/Kconfig
- kernel/kallsyms.c
- scripts/Makefile.headersinst
- scripts/basic/docproc.c
- scripts/basic/fixdep.c
- scripts/config
- scripts/gcc-version.sh
- scripts/headers.sh
- scripts/headers_check.pl
- scripts/kallsyms.c
- scripts/kconfig/.gitignore
- scripts/kconfig/Makefile
- scripts/kconfig/conf.c
- scripts/kconfig/confdata.c
- scripts/kconfig/lkc.h
- scripts/kconfig/lxdialog/checklist.c
- scripts/kconfig/mconf.c
- scripts/kconfig/qconf.cc
- scripts/kconfig/util.c
- scripts/kernel-doc
- scripts/mod/modpost.c
- scripts/package/builddeb
- scripts/setlocalversion
- scripts/unifdef.c
- scripts/ver_linux
.gitignore
| ... | ... | @@ -25,6 +25,8 @@ |
| 25 | 25 | *.elf |
| 26 | 26 | *.bin |
| 27 | 27 | *.gz |
| 28 | +*.lzma | |
| 29 | +*.patch | |
| 28 | 30 | |
| 29 | 31 | # |
| 30 | 32 | # Top-level generic files |
| ... | ... | @@ -61,6 +63,12 @@ |
| 61 | 63 | # cscope files |
| 62 | 64 | cscope.* |
| 63 | 65 | ncscope.* |
| 66 | + | |
| 67 | +# gnu global files | |
| 68 | +GPATH | |
| 69 | +GRTAGS | |
| 70 | +GSYMS | |
| 71 | +GTAGS | |
| 64 | 72 | |
| 65 | 73 | *.orig |
| 66 | 74 | *~ |
Documentation/Changes
| ... | ... | @@ -29,7 +29,7 @@ |
| 29 | 29 | isdn4k-utils. |
| 30 | 30 | |
| 31 | 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 | 33 | o binutils 2.12 # ld -v |
| 34 | 34 | o util-linux 2.10o # fdformat --version |
| 35 | 35 | o module-init-tools 0.9.10 # depmod -V |
| ... | ... | @@ -62,7 +62,7 @@ |
| 62 | 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 | 67 | Binutils |
| 68 | 68 | -------- |
Documentation/kbuild/kconfig.txt
| ... | ... | @@ -35,49 +35,27 @@ |
| 35 | 35 | |
| 36 | 36 | (Yes, we need something better here.) |
| 37 | 37 | |
| 38 | +______________________________________________________________________ | |
| 39 | +Environment variables for '*config' | |
| 38 | 40 | |
| 39 | -====================================================================== | |
| 40 | -menuconfig | |
| 41 | +KCONFIG_CONFIG | |
| 41 | 42 | -------------------------------------------------- |
| 43 | +This environment variable can be used to specify a default kernel config | |
| 44 | +file name to override the default name of ".config". | |
| 42 | 45 | |
| 43 | -SEARCHING for CONFIG symbols | |
| 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. | |
| 44 | 50 | |
| 45 | -Searching in menuconfig: | |
| 51 | +KCONFIG_NOTIMESTAMP | |
| 52 | +-------------------------------------------------- | |
| 53 | +If this environment variable exists and is non-null, the timestamp line | |
| 54 | +in generated .config files is omitted. | |
| 46 | 55 | |
| 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 | 56 | ______________________________________________________________________ |
| 65 | -Color Themes for 'menuconfig' | |
| 57 | +Environment variables for '{allyes/allmod/allno/rand}config' | |
| 66 | 58 | |
| 67 | -It is possible to select different color themes using the variable | |
| 68 | -MENUCONFIG_COLOR. To select a theme use: | |
| 69 | - | |
| 70 | - make MENUCONFIG_COLOR=<theme> menuconfig | |
| 71 | - | |
| 72 | -Available themes are: | |
| 73 | - mono => selects colors suitable for monochrome displays | |
| 74 | - blackbg => selects a color scheme with black background | |
| 75 | - classic => theme with blue background. The classic look | |
| 76 | - bluetitle => a LCD friendly version of classic. (default) | |
| 77 | - | |
| 78 | -______________________________________________________________________ | |
| 79 | -Environment variables in 'menuconfig' | |
| 80 | - | |
| 81 | 59 | KCONFIG_ALLCONFIG |
| 82 | 60 | -------------------------------------------------- |
| 83 | 61 | (partially based on lkml email from/by Rob Landley, re: miniconfig) |
| ... | ... | @@ -95,8 +73,7 @@ |
| 95 | 73 | This enables you to create "miniature" config (miniconfig) or custom |
| 96 | 74 | config files containing just the config symbols that you are interested |
| 97 | 75 | in. Then the kernel config system generates the full .config file, |
| 98 | -including dependencies of your miniconfig file, based on the miniconfig | |
| 99 | -file. | |
| 76 | +including symbols of your miniconfig file. | |
| 100 | 77 | |
| 101 | 78 | This 'KCONFIG_ALLCONFIG' file is a config file which contains |
| 102 | 79 | (usually a subset of all) preset config symbols. These variable |
| 103 | 80 | |
| ... | ... | @@ -113,26 +90,14 @@ |
| 113 | 90 | disable the options that are explicitly listed in the specified |
| 114 | 91 | mini-config files. |
| 115 | 92 | |
| 93 | +______________________________________________________________________ | |
| 94 | +Environment variables for 'silentoldconfig' | |
| 95 | + | |
| 116 | 96 | KCONFIG_NOSILENTUPDATE |
| 117 | 97 | -------------------------------------------------- |
| 118 | 98 | If this variable has a non-blank value, it prevents silent kernel |
| 119 | 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 | 101 | KCONFIG_AUTOCONFIG |
| 137 | 102 | -------------------------------------------------- |
| 138 | 103 | This environment variable can be set to specify the path & name of the |
| 139 | 104 | |
| 140 | 105 | |
| ... | ... | @@ -143,15 +108,54 @@ |
| 143 | 108 | This environment variable can be set to specify the path & name of the |
| 144 | 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 | |
| 148 | ----------------------------------------------------------------------- | |
| 137 | +User interface options for 'menuconfig' | |
| 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 | 152 | MENUCONFIG_MODE |
| 150 | 153 | -------------------------------------------------- |
| 151 | 154 | This mode shows all sub-menus in one large tree. |
| 152 | 155 | |
| 153 | 156 | Example: |
| 154 | - MENUCONFIG_MODE=single_menu make menuconfig | |
| 157 | + make MENUCONFIG_MODE=single_menu menuconfig | |
| 158 | + | |
| 155 | 159 | |
| 156 | 160 | ====================================================================== |
| 157 | 161 | xconfig |
Documentation/kbuild/modules.txt
Makefile
| ... | ... | @@ -35,10 +35,8 @@ |
| 35 | 35 | # To put more focus on warnings, be less verbose as default |
| 36 | 36 | # Use 'make V=1' to see the full commands |
| 37 | 37 | |
| 38 | -ifdef V | |
| 39 | - ifeq ("$(origin V)", "command line") | |
| 40 | - KBUILD_VERBOSE = $(V) | |
| 41 | - endif | |
| 38 | +ifeq ("$(origin V)", "command line") | |
| 39 | + KBUILD_VERBOSE = $(V) | |
| 42 | 40 | endif |
| 43 | 41 | ifndef KBUILD_VERBOSE |
| 44 | 42 | KBUILD_VERBOSE = 0 |
| ... | ... | @@ -54,10 +52,8 @@ |
| 54 | 52 | # See the file "Documentation/sparse.txt" for more details, including |
| 55 | 53 | # where to get the "sparse" utility. |
| 56 | 54 | |
| 57 | -ifdef C | |
| 58 | - ifeq ("$(origin C)", "command line") | |
| 59 | - KBUILD_CHECKSRC = $(C) | |
| 60 | - endif | |
| 55 | +ifeq ("$(origin C)", "command line") | |
| 56 | + KBUILD_CHECKSRC = $(C) | |
| 61 | 57 | endif |
| 62 | 58 | ifndef KBUILD_CHECKSRC |
| 63 | 59 | KBUILD_CHECKSRC = 0 |
| 64 | 60 | |
| ... | ... | @@ -69,13 +65,11 @@ |
| 69 | 65 | ifdef SUBDIRS |
| 70 | 66 | KBUILD_EXTMOD ?= $(SUBDIRS) |
| 71 | 67 | endif |
| 72 | -ifdef M | |
| 73 | - ifeq ("$(origin M)", "command line") | |
| 74 | - KBUILD_EXTMOD := $(M) | |
| 75 | - endif | |
| 68 | + | |
| 69 | +ifeq ("$(origin M)", "command line") | |
| 70 | + KBUILD_EXTMOD := $(M) | |
| 76 | 71 | endif |
| 77 | 72 | |
| 78 | - | |
| 79 | 73 | # kbuild supports saving output files in a separate directory. |
| 80 | 74 | # To locate output files in a separate directory two syntaxes are supported. |
| 81 | 75 | # In both cases the working directory must be the root of the kernel src. |
| ... | ... | @@ -98,10 +92,8 @@ |
| 98 | 92 | |
| 99 | 93 | # OK, Make called in directory where kernel src resides |
| 100 | 94 | # Do we want to locate output files in a separate directory? |
| 101 | -ifdef O | |
| 102 | - ifeq ("$(origin O)", "command line") | |
| 103 | - KBUILD_OUTPUT := $(O) | |
| 104 | - endif | |
| 95 | +ifeq ("$(origin O)", "command line") | |
| 96 | + KBUILD_OUTPUT := $(O) | |
| 105 | 97 | endif |
| 106 | 98 | |
| 107 | 99 | # That's our default target when none is given on the command line |
README
| ... | ... | @@ -174,8 +174,17 @@ |
| 174 | 174 | "make silentoldconfig" |
| 175 | 175 | Like above, but avoids cluttering the screen |
| 176 | 176 | with questions already answered. |
| 177 | + Additionally updates the dependencies. | |
| 177 | 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 | 188 | "make allyesconfig" |
| 180 | 189 | Create a ./.config file by setting symbol |
| 181 | 190 | values to 'y' as much as possible. |
include/asm-generic/vmlinux.lds.h
| 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 | 56 | #ifndef LOAD_OFFSET |
| 4 | 57 | #define LOAD_OFFSET 0 |
| ... | ... | @@ -116,7 +169,36 @@ |
| 116 | 169 | FTRACE_EVENTS() \ |
| 117 | 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 | 202 | . = ALIGN((align)); \ |
| 121 | 203 | .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ |
| 122 | 204 | VMLINUX_SYMBOL(__start_rodata) = .; \ |
| 123 | 205 | |
| ... | ... | @@ -270,9 +352,10 @@ |
| 270 | 352 | } \ |
| 271 | 353 | . = ALIGN((align)); |
| 272 | 354 | |
| 273 | -/* RODATA provided for backward compatibility. | |
| 355 | +/* RODATA & RO_DATA provided for backward compatibility. | |
| 274 | 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 | 360 | #define SECURITY_INIT \ |
| 278 | 361 | .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \ |
| 279 | 362 | |
| 280 | 363 | |
| 281 | 364 | |
| 282 | 365 | |
| ... | ... | @@ -330,16 +413,42 @@ |
| 330 | 413 | #endif |
| 331 | 414 | |
| 332 | 415 | /* Section used for early init (in .S files) */ |
| 333 | -#define HEAD_TEXT *(HEAD_TEXT_SECTION) | |
| 416 | +#define HEAD_TEXT *(.head.text) | |
| 334 | 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 | + } | |
| 442 | + | |
| 335 | 443 | /* init and exit section handling */ |
| 336 | 444 | #define INIT_DATA \ |
| 337 | 445 | *(.init.data) \ |
| 338 | 446 | DEV_DISCARD(init.data) \ |
| 339 | - DEV_DISCARD(init.rodata) \ | |
| 340 | 447 | CPU_DISCARD(init.data) \ |
| 341 | - CPU_DISCARD(init.rodata) \ | |
| 342 | 448 | MEM_DISCARD(init.data) \ |
| 449 | + *(.init.rodata) \ | |
| 450 | + DEV_DISCARD(init.rodata) \ | |
| 451 | + CPU_DISCARD(init.rodata) \ | |
| 343 | 452 | MEM_DISCARD(init.rodata) |
| 344 | 453 | |
| 345 | 454 | #define INIT_TEXT \ |
| ... | ... | @@ -363,9 +472,35 @@ |
| 363 | 472 | CPU_DISCARD(exit.text) \ |
| 364 | 473 | MEM_DISCARD(exit.text) |
| 365 | 474 | |
| 366 | - /* DWARF debug sections. | |
| 367 | - Symbols in the DWARF debugging sections are relative to | |
| 368 | - the beginning of the section so we begin them at 0. */ | |
| 475 | +#define EXIT_CALL \ | |
| 476 | + *(.exitcall.exit) | |
| 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 | 504 | #define DWARF_DEBUG \ |
| 370 | 505 | /* DWARF 1 */ \ |
| 371 | 506 | .debug 0 : { *(.debug) } \ |
| ... | ... | @@ -432,6 +567,12 @@ |
| 432 | 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 | 576 | #define INITCALLS \ |
| 436 | 577 | *(.initcallearly.init) \ |
| 437 | 578 | VMLINUX_SYMBOL(__early_initcall_end) = .; \ |
| ... | ... | @@ -453,6 +594,31 @@ |
| 453 | 594 | *(.initcall7.init) \ |
| 454 | 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 | 623 | * PERCPU_VADDR - define output section for percpu area |
| 458 | 624 | * @vaddr: explicit base address (optional) |
| ... | ... | @@ -509,4 +675,58 @@ |
| 509 | 675 | *(.data.percpu.shared_aligned) \ |
| 510 | 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); |
include/linux/init.h
| ... | ... | @@ -2,8 +2,6 @@ |
| 2 | 2 | #define _LINUX_INIT_H |
| 3 | 3 | |
| 4 | 4 | #include <linux/compiler.h> |
| 5 | -#include <linux/section-names.h> | |
| 6 | -#include <linux/stringify.h> | |
| 7 | 5 | |
| 8 | 6 | /* These macros are used to mark some functions or |
| 9 | 7 | * initialized data (doesn't apply to uninitialized data) |
| ... | ... | @@ -101,7 +99,7 @@ |
| 101 | 99 | #define __memexitconst __section(.memexit.rodata) |
| 102 | 100 | |
| 103 | 101 | /* For assembly routines */ |
| 104 | -#define __HEAD .section __stringify(HEAD_TEXT_SECTION),"ax" | |
| 102 | +#define __HEAD .section ".head.text","ax" | |
| 105 | 103 | #define __INIT .section ".init.text","ax" |
| 106 | 104 | #define __FINIT .previous |
| 107 | 105 | |
| ... | ... | @@ -225,7 +223,8 @@ |
| 225 | 223 | * obs_kernel_param "array" too far apart in .init.setup. |
| 226 | 224 | */ |
| 227 | 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 | 228 | static struct obs_kernel_param __setup_##unique_id \ |
| 230 | 229 | __used __section(.init.setup) \ |
| 231 | 230 | __attribute__((aligned((sizeof(long))))) \ |
include/linux/section-names.h
init/Kconfig
| ... | ... | @@ -809,14 +809,6 @@ |
| 809 | 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 | 812 | config HOTPLUG |
| 821 | 813 | bool "Support for hot-pluggable devices" if EMBEDDED |
| 822 | 814 | default y |
| ... | ... | @@ -997,6 +989,14 @@ |
| 997 | 989 | result in significant savings in code size. This also disables |
| 998 | 990 | SLUB sysfs support. /sys/slab will not exist and there will be |
| 999 | 991 | no support for cache validation etc. |
| 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 | 1000 | |
| 1001 | 1001 | config COMPAT_BRK |
| 1002 | 1002 | bool "Disable heap randomization" |
kernel/kallsyms.c
| ... | ... | @@ -30,12 +30,16 @@ |
| 30 | 30 | #define all_var 0 |
| 31 | 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 | 37 | extern const unsigned long kallsyms_addresses[] __attribute__((weak)); |
| 35 | 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 | |
| 38 | - * has one (eg: FRV) | |
| 40 | +/* | |
| 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 | 44 | extern const unsigned long kallsyms_num_syms |
| 41 | 45 | __attribute__((weak, section(".rodata"))); |
| 42 | 46 | |
| 43 | 47 | |
| 44 | 48 | |
| 45 | 49 | |
| ... | ... | @@ -75,31 +79,37 @@ |
| 75 | 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, | |
| 79 | - given the offset to where the symbol is in the compressed stream */ | |
| 82 | +/* | |
| 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 | 86 | static unsigned int kallsyms_expand_symbol(unsigned int off, char *result) |
| 81 | 87 | { |
| 82 | 88 | int len, skipped_first = 0; |
| 83 | 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 | 92 | data = &kallsyms_names[off]; |
| 87 | 93 | len = *data; |
| 88 | 94 | data++; |
| 89 | 95 | |
| 90 | - /* update the offset to return the offset for the next symbol on | |
| 91 | - * the compressed stream */ | |
| 96 | + /* | |
| 97 | + * Update the offset to return the offset for the next symbol on | |
| 98 | + * the compressed stream. | |
| 99 | + */ | |
| 92 | 100 | off += len + 1; |
| 93 | 101 | |
| 94 | - /* for every byte on the compressed symbol data, copy the table | |
| 95 | - entry for that byte */ | |
| 96 | - while(len) { | |
| 97 | - tptr = &kallsyms_token_table[ kallsyms_token_index[*data] ]; | |
| 102 | + /* | |
| 103 | + * For every byte on the compressed symbol data, copy the table | |
| 104 | + * entry for that byte. | |
| 105 | + */ | |
| 106 | + while (len) { | |
| 107 | + tptr = &kallsyms_token_table[kallsyms_token_index[*data]]; | |
| 98 | 108 | data++; |
| 99 | 109 | len--; |
| 100 | 110 | |
| 101 | 111 | while (*tptr) { |
| 102 | - if(skipped_first) { | |
| 112 | + if (skipped_first) { | |
| 103 | 113 | *result = *tptr; |
| 104 | 114 | result++; |
| 105 | 115 | } else |
| 106 | 116 | |
| 107 | 117 | |
| 108 | 118 | |
| 109 | 119 | |
| 110 | 120 | |
| ... | ... | @@ -110,36 +120,46 @@ |
| 110 | 120 | |
| 111 | 121 | *result = '\0'; |
| 112 | 122 | |
| 113 | - /* return to offset to the next symbol */ | |
| 123 | + /* Return to offset to the next symbol. */ | |
| 114 | 124 | return off; |
| 115 | 125 | } |
| 116 | 126 | |
| 117 | -/* get symbol type information. This is encoded as a single char at the | |
| 118 | - * begining of the symbol name */ | |
| 127 | +/* | |
| 128 | + * Get symbol type information. This is encoded as a single char at the | |
| 129 | + * beginning of the symbol name. | |
| 130 | + */ | |
| 119 | 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 | |
| 122 | - * first char from this token */ | |
| 123 | - return kallsyms_token_table[ kallsyms_token_index[ kallsyms_names[off+1] ] ]; | |
| 133 | + /* | |
| 134 | + * Get just the first code, look it up in the token table, | |
| 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 | |
| 128 | - * kallsyms array */ | |
| 141 | +/* | |
| 142 | + * Find the offset on the compressed stream given and index in the | |
| 143 | + * kallsyms array. | |
| 144 | + */ | |
| 129 | 145 | static unsigned int get_symbol_offset(unsigned long pos) |
| 130 | 146 | { |
| 131 | 147 | const u8 *name; |
| 132 | 148 | int i; |
| 133 | 149 | |
| 134 | - /* use the closest marker we have. We have markers every 256 positions, | |
| 135 | - * so that should be close enough */ | |
| 136 | - name = &kallsyms_names[ kallsyms_markers[pos>>8] ]; | |
| 150 | + /* | |
| 151 | + * Use the closest marker we have. We have markers every 256 positions, | |
| 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. | |
| 139 | - * Every symbol is stored in a [<len>][<len> bytes of data] format, so we | |
| 140 | - * just need to add the len to the current pointer for every symbol we | |
| 141 | - * wish to skip */ | |
| 142 | - for(i = 0; i < (pos&0xFF); i++) | |
| 156 | + /* | |
| 157 | + * Sequentially scan all the symbols up to the point we're searching | |
| 158 | + * for. Every symbol is stored in a [<len>][<len> bytes of data] format, | |
| 159 | + * so we just need to add the len to the current pointer for every | |
| 160 | + * symbol we wish to skip. | |
| 161 | + */ | |
| 162 | + for (i = 0; i < (pos & 0xFF); i++) | |
| 143 | 163 | name = name + (*name) + 1; |
| 144 | 164 | |
| 145 | 165 | return name - kallsyms_names; |
| ... | ... | @@ -190,7 +210,7 @@ |
| 190 | 210 | /* This kernel should never had been booted. */ |
| 191 | 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 | 214 | low = 0; |
| 195 | 215 | high = kallsyms_num_syms; |
| 196 | 216 | |
| 197 | 217 | |
| ... | ... | @@ -203,15 +223,15 @@ |
| 203 | 223 | } |
| 204 | 224 | |
| 205 | 225 | /* |
| 206 | - * search for the first aliased symbol. Aliased | |
| 207 | - * symbols are symbols with the same address | |
| 226 | + * Search for the first aliased symbol. Aliased | |
| 227 | + * symbols are symbols with the same address. | |
| 208 | 228 | */ |
| 209 | 229 | while (low && kallsyms_addresses[low-1] == kallsyms_addresses[low]) |
| 210 | 230 | --low; |
| 211 | 231 | |
| 212 | 232 | symbol_start = kallsyms_addresses[low]; |
| 213 | 233 | |
| 214 | - /* Search for next non-aliased symbol */ | |
| 234 | + /* Search for next non-aliased symbol. */ | |
| 215 | 235 | for (i = low + 1; i < kallsyms_num_syms; i++) { |
| 216 | 236 | if (kallsyms_addresses[i] > symbol_start) { |
| 217 | 237 | symbol_end = kallsyms_addresses[i]; |
| ... | ... | @@ -219,7 +239,7 @@ |
| 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 | 243 | if (!symbol_end) { |
| 224 | 244 | if (is_kernel_inittext(addr)) |
| 225 | 245 | symbol_end = (unsigned long)_einittext; |
| ... | ... | @@ -252,10 +272,10 @@ |
| 252 | 272 | |
| 253 | 273 | /* |
| 254 | 274 | * Lookup an address |
| 255 | - * - 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 | |
| 257 | - * it resides in a module | |
| 258 | - * - we also guarantee that modname will be valid until rescheduled | |
| 275 | + * - modname is set to NULL if it's in the kernel. | |
| 276 | + * - We guarantee that the returned name is valid until we reschedule even if. | |
| 277 | + * It resides in a module. | |
| 278 | + * - We also guarantee that modname will be valid until rescheduled. | |
| 259 | 279 | */ |
| 260 | 280 | const char *kallsyms_lookup(unsigned long addr, |
| 261 | 281 | unsigned long *symbolsize, |
| ... | ... | @@ -276,7 +296,7 @@ |
| 276 | 296 | return namebuf; |
| 277 | 297 | } |
| 278 | 298 | |
| 279 | - /* see if it's in a module */ | |
| 299 | + /* See if it's in a module. */ | |
| 280 | 300 | return module_address_lookup(addr, symbolsize, offset, modname, |
| 281 | 301 | namebuf); |
| 282 | 302 | } |
| ... | ... | @@ -294,7 +314,7 @@ |
| 294 | 314 | kallsyms_expand_symbol(get_symbol_offset(pos), symname); |
| 295 | 315 | return 0; |
| 296 | 316 | } |
| 297 | - /* see if it's in a module */ | |
| 317 | + /* See if it's in a module. */ | |
| 298 | 318 | return lookup_module_symbol_name(addr, symname); |
| 299 | 319 | } |
| 300 | 320 | |
| ... | ... | @@ -313,7 +333,7 @@ |
| 313 | 333 | modname[0] = '\0'; |
| 314 | 334 | return 0; |
| 315 | 335 | } |
| 316 | - /* see if it's in a module */ | |
| 336 | + /* See if it's in a module. */ | |
| 317 | 337 | return lookup_module_symbol_attrs(addr, size, offset, modname, name); |
| 318 | 338 | } |
| 319 | 339 | |
| ... | ... | @@ -342,6 +362,7 @@ |
| 342 | 362 | |
| 343 | 363 | return len; |
| 344 | 364 | } |
| 365 | +EXPORT_SYMBOL_GPL(sprint_symbol); | |
| 345 | 366 | |
| 346 | 367 | /* Look up a kernel symbol and print it to the kernel messages. */ |
| 347 | 368 | void __print_symbol(const char *fmt, unsigned long address) |
| 348 | 369 | |
| 349 | 370 | |
| ... | ... | @@ -352,13 +373,13 @@ |
| 352 | 373 | |
| 353 | 374 | printk(fmt, buffer); |
| 354 | 375 | } |
| 376 | +EXPORT_SYMBOL(__print_symbol); | |
| 355 | 377 | |
| 356 | 378 | /* To avoid using get_symbol_offset for every symbol, we carry prefix along. */ |
| 357 | -struct kallsym_iter | |
| 358 | -{ | |
| 379 | +struct kallsym_iter { | |
| 359 | 380 | loff_t pos; |
| 360 | 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 | 383 | char type; |
| 363 | 384 | char name[KSYM_NAME_LEN]; |
| 364 | 385 | char module_name[MODULE_NAME_LEN]; |
| ... | ... | @@ -404,7 +425,7 @@ |
| 404 | 425 | iter->pos = pos; |
| 405 | 426 | return get_ksymbol_mod(iter); |
| 406 | 427 | } |
| 407 | - | |
| 428 | + | |
| 408 | 429 | /* If we're not on the desired position, reset to new position. */ |
| 409 | 430 | if (pos != iter->pos) |
| 410 | 431 | reset_iter(iter, pos); |
| 411 | 432 | |
| 412 | 433 | |
| 413 | 434 | |
| ... | ... | @@ -439,23 +460,25 @@ |
| 439 | 460 | { |
| 440 | 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 | 464 | if (!iter->name[0]) |
| 444 | 465 | return 0; |
| 445 | 466 | |
| 446 | 467 | if (iter->module_name[0]) { |
| 447 | 468 | char type; |
| 448 | 469 | |
| 449 | - /* Label it "global" if it is exported, | |
| 450 | - * "local" if not exported. */ | |
| 470 | + /* | |
| 471 | + * Label it "global" if it is exported, | |
| 472 | + * "local" if not exported. | |
| 473 | + */ | |
| 451 | 474 | type = iter->exported ? toupper(iter->type) : |
| 452 | 475 | tolower(iter->type); |
| 453 | 476 | seq_printf(m, "%0*lx %c %s\t[%s]\n", |
| 454 | - (int)(2*sizeof(void*)), | |
| 477 | + (int)(2 * sizeof(void *)), | |
| 455 | 478 | iter->value, type, iter->name, iter->module_name); |
| 456 | 479 | } else |
| 457 | 480 | seq_printf(m, "%0*lx %c %s\n", |
| 458 | - (int)(2*sizeof(void*)), | |
| 481 | + (int)(2 * sizeof(void *)), | |
| 459 | 482 | iter->value, iter->type, iter->name); |
| 460 | 483 | return 0; |
| 461 | 484 | } |
| 462 | 485 | |
| ... | ... | @@ -469,9 +492,11 @@ |
| 469 | 492 | |
| 470 | 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 | 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 | 500 | struct kallsym_iter *iter; |
| 476 | 501 | int ret; |
| 477 | 502 | |
| ... | ... | @@ -500,8 +525,5 @@ |
| 500 | 525 | proc_create("kallsyms", 0444, NULL, &kallsyms_operations); |
| 501 | 526 | return 0; |
| 502 | 527 | } |
| 503 | -__initcall(kallsyms_init); | |
| 504 | - | |
| 505 | -EXPORT_SYMBOL(__print_symbol); | |
| 506 | -EXPORT_SYMBOL_GPL(sprint_symbol); | |
| 528 | +device_initcall(kallsyms_init); |
scripts/Makefile.headersinst
| ... | ... | @@ -54,8 +54,12 @@ |
| 54 | 54 | cmd_remove = rm -f $(unwanted-file) |
| 55 | 55 | |
| 56 | 56 | quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files) |
| 57 | - cmd_check = $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH) \ | |
| 58 | - $(addprefix $(install)/, $(all-files)); \ | |
| 57 | +# Headers list can be pretty long, xargs helps to avoid | |
| 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 | 63 | touch $@ |
| 60 | 64 | |
| 61 | 65 | PHONY += __headersinst __headerscheck |
scripts/basic/docproc.c
| ... | ... | @@ -69,7 +69,7 @@ |
| 69 | 69 | #define NOFUNCTION "-nofunction" |
| 70 | 70 | #define NODOCSECTIONS "-no-doc-sections" |
| 71 | 71 | |
| 72 | -char *srctree; | |
| 72 | +static char *srctree, *kernsrctree; | |
| 73 | 73 | |
| 74 | 74 | void usage (void) |
| 75 | 75 | { |
| ... | ... | @@ -77,7 +77,8 @@ |
| 77 | 77 | fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n"); |
| 78 | 78 | fprintf(stderr, "doc: frontend when generating kernel documentation\n"); |
| 79 | 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 @@ |
| 96 | 97 | exit(1); |
| 97 | 98 | case 0: |
| 98 | 99 | memset(real_filename, 0, sizeof(real_filename)); |
| 99 | - strncat(real_filename, srctree, PATH_MAX); | |
| 100 | - strncat(real_filename, KERNELDOCPATH KERNELDOC, | |
| 100 | + strncat(real_filename, kernsrctree, PATH_MAX); | |
| 101 | + strncat(real_filename, "/" KERNELDOCPATH KERNELDOC, | |
| 101 | 102 | PATH_MAX - strlen(real_filename)); |
| 102 | 103 | execvp(real_filename, svec); |
| 103 | 104 | fprintf(stderr, "exec "); |
| ... | ... | @@ -178,6 +179,7 @@ |
| 178 | 179 | char real_filename[PATH_MAX + 1]; |
| 179 | 180 | memset(real_filename, 0, sizeof(real_filename)); |
| 180 | 181 | strncat(real_filename, srctree, PATH_MAX); |
| 182 | + strncat(real_filename, "/", PATH_MAX - strlen(real_filename)); | |
| 181 | 183 | strncat(real_filename, filename, |
| 182 | 184 | PATH_MAX - strlen(real_filename)); |
| 183 | 185 | sym = add_new_file(filename); |
| ... | ... | @@ -382,6 +384,9 @@ |
| 382 | 384 | srctree = getenv("SRCTREE"); |
| 383 | 385 | if (!srctree) |
| 384 | 386 | srctree = getcwd(NULL, 0); |
| 387 | + kernsrctree = getenv("KBUILD_SRC"); | |
| 388 | + if (!kernsrctree) | |
| 389 | + kernsrctree = srctree; | |
| 385 | 390 | if (argc != 3) { |
| 386 | 391 | usage(); |
| 387 | 392 | exit(1); |
scripts/basic/fixdep.c
| ... | ... | @@ -373,10 +373,11 @@ |
| 373 | 373 | void traps(void) |
| 374 | 374 | { |
| 375 | 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 | 379 | fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", |
| 379 | - *(int *)test); | |
| 380 | + *p); | |
| 380 | 381 | exit(2); |
| 381 | 382 | } |
| 382 | 383 | } |
scripts/config
| ... | ... | @@ -9,8 +9,10 @@ |
| 9 | 9 | commands: |
| 10 | 10 | --enable|-e option Enable option |
| 11 | 11 | --disable|-d option Disable option |
| 12 | - --module|-m option Turn option into a module | |
| 13 | - --state|-s option Print state of option (n,y,m,undef) | |
| 12 | + --module|-m option Turn option into a module | |
| 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 | 17 | --enable-after|-E beforeopt option |
| 16 | 18 | Enable option directly after other option |
| ... | ... | @@ -26,8 +28,6 @@ |
| 26 | 28 | |
| 27 | 29 | config doesn't check the validity of the .config file. This is done at next |
| 28 | 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 | 31 | EOL |
| 32 | 32 | exit 1 |
| 33 | 33 | } |
| ... | ... | @@ -45,8 +45,18 @@ |
| 45 | 45 | ARG="`echo $ARG | tr a-z A-Z`" |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | -replace() { | |
| 49 | - sed -i -e "$@" $FN | |
| 48 | +set_var() { | |
| 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 | 62 | if [ "$1" = "--file" ]; then |
| ... | ... | @@ -54,8 +64,7 @@ |
| 54 | 64 | if [ "$FN" = "" ] ; then |
| 55 | 65 | usage |
| 56 | 66 | fi |
| 57 | - shift | |
| 58 | - shift | |
| 67 | + shift 2 | |
| 59 | 68 | else |
| 60 | 69 | FN=.config |
| 61 | 70 | fi |
| 62 | 71 | |
| 63 | 72 | |
| 64 | 73 | |
| 65 | 74 | |
| 66 | 75 | |
| ... | ... | @@ -68,27 +77,39 @@ |
| 68 | 77 | CMD="$1" |
| 69 | 78 | shift |
| 70 | 79 | case "$CMD" in |
| 71 | - --enable|-e) | |
| 80 | + --refresh) | |
| 81 | + ;; | |
| 82 | + --*-after) | |
| 72 | 83 | checkarg "$1" |
| 73 | - replace "s/# CONFIG_$ARG is not set/CONFIG_$ARG=y/" | |
| 84 | + A=$ARG | |
| 85 | + checkarg "$2" | |
| 86 | + B=$ARG | |
| 87 | + shift 2 | |
| 88 | + ;; | |
| 89 | + --*) | |
| 90 | + checkarg "$1" | |
| 74 | 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 | 99 | --disable|-d) |
| 78 | - checkarg "$1" | |
| 79 | - replace "s/CONFIG_$ARG=[my]/# CONFIG_$ARG is not set/" | |
| 80 | - shift | |
| 100 | + set_var "CONFIG_$ARG" "# CONFIG_$ARG is not set" | |
| 81 | 101 | ;; |
| 82 | 102 | |
| 83 | 103 | --module|-m) |
| 84 | - checkarg "$1" | |
| 85 | - replace "s/CONFIG_$ARG=y/CONFIG_$ARG=m/" \ | |
| 86 | - -e "s/# CONFIG_$ARG is not set/CONFIG_$ARG=m/" | |
| 104 | + set_var "CONFIG_$ARG" "CONFIG_$ARG=m" | |
| 105 | + ;; | |
| 106 | + | |
| 107 | + --set-str) | |
| 108 | + set_var "CONFIG_$ARG" "CONFIG_$ARG=\"$1\"" | |
| 87 | 109 | shift |
| 88 | 110 | ;; |
| 89 | 111 | |
| 90 | 112 | --state|-s) |
| 91 | - checkarg "$1" | |
| 92 | 113 | if grep -q "# CONFIG_$ARG is not set" $FN ; then |
| 93 | 114 | echo n |
| 94 | 115 | else |
| 95 | 116 | |
| 96 | 117 | |
| 97 | 118 | |
| ... | ... | @@ -101,44 +122,18 @@ |
| 101 | 122 | echo "$V" |
| 102 | 123 | fi |
| 103 | 124 | fi |
| 104 | - shift | |
| 105 | 125 | ;; |
| 106 | 126 | |
| 107 | 127 | --enable-after|-E) |
| 108 | - checkarg "$1" | |
| 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 | |
| 128 | + set_var "CONFIG_$B" "CONFIG_$B=y" "CONFIG_$A" | |
| 117 | 129 | ;; |
| 118 | 130 | |
| 119 | 131 | --disable-after|-D) |
| 120 | - checkarg "$1" | |
| 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 | |
| 132 | + set_var "CONFIG_$B" "# CONFIG_$B is not set" "CONFIG_$A" | |
| 129 | 133 | ;; |
| 130 | 134 | |
| 131 | 135 | --module-after|-M) |
| 132 | - checkarg "$1" | |
| 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 | |
| 136 | + set_var "CONFIG_$B" "CONFIG_$B=m" "CONFIG_$A" | |
| 142 | 137 | ;; |
| 143 | 138 | |
| 144 | 139 | # undocumented because it ignores --file (fixme) |
scripts/gcc-version.sh
scripts/headers.sh
| ... | ... | @@ -15,18 +15,11 @@ |
| 15 | 15 | fi |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | -# Do not try this architecture | |
| 19 | -drop="generic um ppc sparc64 cris" | |
| 20 | - | |
| 21 | 18 | archs=$(ls ${srctree}/arch) |
| 22 | 19 | |
| 23 | 20 | for arch in ${archs}; do |
| 24 | 21 | case ${arch} in |
| 25 | 22 | um) # no userspace export |
| 26 | - ;; | |
| 27 | - ppc) # headers exported by powerpc | |
| 28 | - ;; | |
| 29 | - sparc64) # headers exported by sparc | |
| 30 | 23 | ;; |
| 31 | 24 | cris) # headers export are known broken |
| 32 | 25 | ;; |
scripts/headers_check.pl
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | # |
| 3 | 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 | 6 | # dir: dir to look for included files |
| 7 | 7 | # arch: architecture |
| 8 | 8 | # files: list of files to check |
| ... | ... | @@ -37,7 +37,7 @@ |
| 37 | 37 | &check_include(); |
| 38 | 38 | &check_asm_types(); |
| 39 | 39 | &check_sizetypes(); |
| 40 | - &check_prototypes(); | |
| 40 | + &check_declarations(); | |
| 41 | 41 | # Dropped for now. Too much noise &check_config(); |
| 42 | 42 | } |
| 43 | 43 | close FH; |
| 44 | 44 | |
| 45 | 45 | |
| ... | ... | @@ -61,16 +61,18 @@ |
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | -sub check_prototypes | |
| 64 | +sub check_declarations | |
| 65 | 65 | { |
| 66 | - if ($line =~ m/^\s*extern\b/) { | |
| 67 | - printf STDERR "$filename:$lineno: extern's make no sense in userspace\n"; | |
| 66 | + if ($line =~m/^\s*extern\b/) { | |
| 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 | 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 | 76 | printf STDERR "$filename:$lineno: leaks CONFIG_$1 to userspace where it is not valid\n"; |
| 75 | 77 | } |
| 76 | 78 | } |
scripts/kallsyms.c
| ... | ... | @@ -23,6 +23,10 @@ |
| 23 | 23 | #include <string.h> |
| 24 | 24 | #include <ctype.h> |
| 25 | 25 | |
| 26 | +#ifndef ARRAY_SIZE | |
| 27 | +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) | |
| 28 | +#endif | |
| 29 | + | |
| 26 | 30 | #define KSYM_NAME_LEN 128 |
| 27 | 31 | |
| 28 | 32 | struct sym_entry { |
| 29 | 33 | |
| ... | ... | @@ -32,9 +36,23 @@ |
| 32 | 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 | 54 | static struct sym_entry *table; |
| 36 | 55 | static unsigned int table_size, table_cnt; |
| 37 | -static unsigned long long _text, _stext, _etext, _sinittext, _einittext; | |
| 38 | 56 | static int all_symbols = 0; |
| 39 | 57 | static char symbol_prefix_char = '\0'; |
| 40 | 58 | |
| ... | ... | @@ -61,6 +79,26 @@ |
| 61 | 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 | 102 | static int read_symbol(FILE *in, struct sym_entry *s) |
| 65 | 103 | { |
| 66 | 104 | char str[500]; |
| ... | ... | @@ -84,14 +122,8 @@ |
| 84 | 122 | /* Ignore most absolute/undefined (?) symbols. */ |
| 85 | 123 | if (strcmp(sym, "_text") == 0) |
| 86 | 124 | _text = s->addr; |
| 87 | - else if (strcmp(sym, "_stext") == 0) | |
| 88 | - _stext = s->addr; | |
| 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; | |
| 125 | + else if (read_symbol_tr(sym, s->addr) == 0) | |
| 126 | + /* nothing to do */; | |
| 95 | 127 | else if (toupper(stype) == 'A') |
| 96 | 128 | { |
| 97 | 129 | /* Keep these useful absolute symbols */ |
| ... | ... | @@ -127,6 +159,21 @@ |
| 127 | 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 | 177 | static int symbol_valid(struct sym_entry *s) |
| 131 | 178 | { |
| 132 | 179 | /* Symbols which vary between passes. Passes 1 and 2 must have |
| ... | ... | @@ -156,8 +203,7 @@ |
| 156 | 203 | /* if --all-symbols is not specified, then symbols outside the text |
| 157 | 204 | * and inittext sections are discarded */ |
| 158 | 205 | if (!all_symbols) { |
| 159 | - if ((s->addr < _stext || s->addr > _etext) | |
| 160 | - && (s->addr < _sinittext || s->addr > _einittext)) | |
| 206 | + if (symbol_valid_tr(s) == 0) | |
| 161 | 207 | return 0; |
| 162 | 208 | /* Corner case. Discard any symbols with the same value as |
| 163 | 209 | * _etext _einittext; they can move between pass 1 and 2 when |
| ... | ... | @@ -165,10 +211,10 @@ |
| 165 | 211 | * they may get dropped in pass 2, which breaks the kallsyms |
| 166 | 212 | * rules. |
| 167 | 213 | */ |
| 168 | - if ((s->addr == _etext && | |
| 169 | - strcmp((char *)s->sym + offset, "_etext")) || | |
| 170 | - (s->addr == _einittext && | |
| 171 | - strcmp((char *)s->sym + offset, "_einittext"))) | |
| 214 | + if ((s->addr == text_range_text->end && | |
| 215 | + strcmp((char *)s->sym + offset, text_range_text->etext)) || | |
| 216 | + (s->addr == text_range_inittext->end && | |
| 217 | + strcmp((char *)s->sym + offset, text_range_inittext->etext))) | |
| 172 | 218 | return 0; |
| 173 | 219 | } |
| 174 | 220 |
scripts/kconfig/.gitignore
scripts/kconfig/Makefile
| ... | ... | @@ -83,7 +83,7 @@ |
| 83 | 83 | @echo ' xconfig - Update current config utilising a QT based front-end' |
| 84 | 84 | @echo ' gconfig - Update current config utilising a GTK based front-end' |
| 85 | 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 | 87 | @echo ' randconfig - New config with random answer to all options' |
| 88 | 88 | @echo ' defconfig - New config with default answer to all options' |
| 89 | 89 | @echo ' allmodconfig - New config selecting modules when possible' |
| ... | ... | @@ -104,7 +104,7 @@ |
| 104 | 104 | # =========================================================================== |
| 105 | 105 | # Shared Makefile for the various kconfig executables: |
| 106 | 106 | # conf: Used for defconfig, oldconfig and related targets |
| 107 | -# mconf: Used for the mconfig target. | |
| 107 | +# mconf: Used for the menuconfig target | |
| 108 | 108 | # Utilizes the lxdialog package |
| 109 | 109 | # qconf: Used for the xconfig target |
| 110 | 110 | # Based on QT which needs to be installed to compile it |
scripts/kconfig/conf.c
| ... | ... | @@ -498,14 +498,15 @@ |
| 498 | 498 | conf_parse(name); |
| 499 | 499 | //zconfdump(stdout); |
| 500 | 500 | if (sync_kconfig) { |
| 501 | - if (stat(".config", &tmpstat)) { | |
| 501 | + name = conf_get_configname(); | |
| 502 | + if (stat(name, &tmpstat)) { | |
| 502 | 503 | fprintf(stderr, _("***\n" |
| 503 | 504 | "*** You have not yet configured your kernel!\n" |
| 504 | - "*** (missing kernel .config file)\n" | |
| 505 | + "*** (missing kernel config file \"%s\")\n" | |
| 505 | 506 | "***\n" |
| 506 | 507 | "*** Please run some configurator (e.g. \"make oldconfig\" or\n" |
| 507 | 508 | "*** \"make menuconfig\" or \"make xconfig\").\n" |
| 508 | - "***\n")); | |
| 509 | + "***\n"), name); | |
| 509 | 510 | exit(1); |
| 510 | 511 | } |
| 511 | 512 | } |
scripts/kconfig/confdata.c
| ... | ... | @@ -41,6 +41,13 @@ |
| 41 | 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 | 51 | static char *conf_expand_value(const char *in) |
| 45 | 52 | { |
| 46 | 53 | struct symbol *sym; |
| 47 | 54 | |
| ... | ... | @@ -555,15 +562,14 @@ |
| 555 | 562 | |
| 556 | 563 | int conf_split_config(void) |
| 557 | 564 | { |
| 558 | - char *name, path[128]; | |
| 565 | + const char *name; | |
| 566 | + char path[128]; | |
| 559 | 567 | char *s, *d, c; |
| 560 | 568 | struct symbol *sym; |
| 561 | 569 | struct stat sb; |
| 562 | 570 | int res, i, fd; |
| 563 | 571 | |
| 564 | - name = getenv("KCONFIG_AUTOCONFIG"); | |
| 565 | - if (!name) | |
| 566 | - name = "include/config/auto.conf"; | |
| 572 | + name = conf_get_autoconfig_name(); | |
| 567 | 573 | conf_read_simple(name, S_DEF_AUTO); |
| 568 | 574 | |
| 569 | 575 | if (chdir("include/config")) |
| ... | ... | @@ -670,7 +676,7 @@ |
| 670 | 676 | { |
| 671 | 677 | struct symbol *sym; |
| 672 | 678 | const char *str; |
| 673 | - char *name; | |
| 679 | + const char *name; | |
| 674 | 680 | FILE *out, *out_h; |
| 675 | 681 | time_t now; |
| 676 | 682 | int i, l; |
| ... | ... | @@ -773,9 +779,7 @@ |
| 773 | 779 | name = "include/linux/autoconf.h"; |
| 774 | 780 | if (rename(".tmpconfig.h", name)) |
| 775 | 781 | return 1; |
| 776 | - name = getenv("KCONFIG_AUTOCONFIG"); | |
| 777 | - if (!name) | |
| 778 | - name = "include/config/auto.conf"; | |
| 782 | + name = conf_get_autoconfig_name(); | |
| 779 | 783 | /* |
| 780 | 784 | * This must be the last step, kbuild has a dependency on auto.conf |
| 781 | 785 | * and this marks the successful completion of the previous steps. |
scripts/kconfig/lkc.h
scripts/kconfig/lxdialog/checklist.c
| ... | ... | @@ -41,7 +41,8 @@ |
| 41 | 41 | wmove(win, choice, check_x); |
| 42 | 42 | wattrset(win, selected ? dlg.check_selected.atr |
| 43 | 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 | 47 | wattrset(win, selected ? dlg.tag_selected.atr : dlg.tag.atr); |
| 47 | 48 | mvwaddch(win, choice, item_x, item_str()[0]); |
scripts/kconfig/mconf.c
| ... | ... | @@ -732,7 +732,12 @@ |
| 732 | 732 | for (child = menu->list; child; child = child->next) { |
| 733 | 733 | if (!menu_is_visible(child)) |
| 734 | 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 | 741 | item_set_data(child); |
| 737 | 742 | if (child->sym == active) |
| 738 | 743 | item_set_selected(1); |
| ... | ... | @@ -748,6 +753,9 @@ |
| 748 | 753 | case 0: |
| 749 | 754 | if (selected) { |
| 750 | 755 | child = item_data(); |
| 756 | + if (!child->sym) | |
| 757 | + break; | |
| 758 | + | |
| 751 | 759 | sym_set_tristate_value(child->sym, yes); |
| 752 | 760 | } |
| 753 | 761 | return; |
scripts/kconfig/qconf.cc
| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | |
| 6 | 6 | #include <qapplication.h> |
| 7 | 7 | #include <qmainwindow.h> |
| 8 | +#include <qdesktopwidget.h> | |
| 8 | 9 | #include <qtoolbar.h> |
| 9 | 10 | #include <qlayout.h> |
| 10 | 11 | #include <qvbox.h> |
| 11 | 12 | |
| ... | ... | @@ -297,10 +298,10 @@ |
| 297 | 298 | void ConfigLineEdit::keyPressEvent(QKeyEvent* e) |
| 298 | 299 | { |
| 299 | 300 | switch (e->key()) { |
| 300 | - case Key_Escape: | |
| 301 | + case Qt::Key_Escape: | |
| 301 | 302 | break; |
| 302 | - case Key_Return: | |
| 303 | - case Key_Enter: | |
| 303 | + case Qt::Key_Return: | |
| 304 | + case Qt::Key_Enter: | |
| 304 | 305 | sym_set_string_value(item->menu->sym, text().latin1()); |
| 305 | 306 | parent()->updateList(item); |
| 306 | 307 | break; |
| ... | ... | @@ -639,7 +640,7 @@ |
| 639 | 640 | struct menu *menu; |
| 640 | 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 | 644 | emit parentSelected(); |
| 644 | 645 | ev->accept(); |
| 645 | 646 | return; |
| ... | ... | @@ -652,8 +653,8 @@ |
| 652 | 653 | item = (ConfigItem*)i; |
| 653 | 654 | |
| 654 | 655 | switch (ev->key()) { |
| 655 | - case Key_Return: | |
| 656 | - case Key_Enter: | |
| 656 | + case Qt::Key_Return: | |
| 657 | + case Qt::Key_Enter: | |
| 657 | 658 | if (item->goParent) { |
| 658 | 659 | emit parentSelected(); |
| 659 | 660 | break; |
| 660 | 661 | |
| 661 | 662 | |
| 662 | 663 | |
| ... | ... | @@ -667,16 +668,16 @@ |
| 667 | 668 | emit menuSelected(menu); |
| 668 | 669 | break; |
| 669 | 670 | } |
| 670 | - case Key_Space: | |
| 671 | + case Qt::Key_Space: | |
| 671 | 672 | changeValue(item); |
| 672 | 673 | break; |
| 673 | - case Key_N: | |
| 674 | + case Qt::Key_N: | |
| 674 | 675 | setValue(item, no); |
| 675 | 676 | break; |
| 676 | - case Key_M: | |
| 677 | + case Qt::Key_M: | |
| 677 | 678 | setValue(item, mod); |
| 678 | 679 | break; |
| 679 | - case Key_Y: | |
| 680 | + case Qt::Key_Y: | |
| 680 | 681 | setValue(item, yes); |
| 681 | 682 | break; |
| 682 | 683 | default: |
| ... | ... | @@ -920,7 +921,7 @@ |
| 920 | 921 | } |
| 921 | 922 | |
| 922 | 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 | 926 | if (name) { |
| 926 | 927 | configSettings->beginGroup(name); |
| ... | ... | @@ -1199,7 +1200,7 @@ |
| 1199 | 1200 | layout1->addLayout(layout2); |
| 1200 | 1201 | |
| 1201 | 1202 | split = new QSplitter(this); |
| 1202 | - split->setOrientation(QSplitter::Vertical); | |
| 1203 | + split->setOrientation(Qt::Vertical); | |
| 1203 | 1204 | list = new ConfigView(split, name); |
| 1204 | 1205 | list->list->mode = listMode; |
| 1205 | 1206 | info = new ConfigInfoView(split, name); |
| ... | ... | @@ -1275,7 +1276,7 @@ |
| 1275 | 1276 | int x, y, width, height; |
| 1276 | 1277 | char title[256]; |
| 1277 | 1278 | |
| 1278 | - QWidget *d = configApp->desktop(); | |
| 1279 | + QDesktopWidget *d = configApp->desktop(); | |
| 1279 | 1280 | snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration"), |
| 1280 | 1281 | getenv("KERNELVERSION")); |
| 1281 | 1282 | setCaption(title); |
| 1282 | 1283 | |
| ... | ... | @@ -1290,14 +1291,14 @@ |
| 1290 | 1291 | move(x, y); |
| 1291 | 1292 | |
| 1292 | 1293 | split1 = new QSplitter(this); |
| 1293 | - split1->setOrientation(QSplitter::Horizontal); | |
| 1294 | + split1->setOrientation(Qt::Horizontal); | |
| 1294 | 1295 | setCentralWidget(split1); |
| 1295 | 1296 | |
| 1296 | 1297 | menuView = new ConfigView(split1, "menu"); |
| 1297 | 1298 | menuList = menuView->list; |
| 1298 | 1299 | |
| 1299 | 1300 | split2 = new QSplitter(split1); |
| 1300 | - split2->setOrientation(QSplitter::Vertical); | |
| 1301 | + split2->setOrientation(Qt::Vertical); | |
| 1301 | 1302 | |
| 1302 | 1303 | // create config tree |
| 1303 | 1304 | configView = new ConfigView(split2, "config"); |
| 1304 | 1305 | |
| 1305 | 1306 | |
| 1306 | 1307 | |
| ... | ... | @@ -1315,18 +1316,18 @@ |
| 1315 | 1316 | backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this); |
| 1316 | 1317 | connect(backAction, SIGNAL(activated()), SLOT(goBack())); |
| 1317 | 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 | 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 | 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 | 1324 | connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); |
| 1324 | 1325 | conf_set_changed_callback(conf_changed); |
| 1325 | 1326 | // Set saveAction's initial state |
| 1326 | 1327 | conf_changed(); |
| 1327 | 1328 | QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this); |
| 1328 | 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 | 1331 | connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); |
| 1331 | 1332 | QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this); |
| 1332 | 1333 | connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView())); |
| ... | ... | @@ -1447,7 +1448,7 @@ |
| 1447 | 1448 | |
| 1448 | 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 | 1452 | if (s.isNull()) |
| 1452 | 1453 | return; |
| 1453 | 1454 | if (conf_read(QFile::encodeName(s))) |
| ... | ... | @@ -1463,7 +1464,7 @@ |
| 1463 | 1464 | |
| 1464 | 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 | 1468 | if (s.isNull()) |
| 1468 | 1469 | return; |
| 1469 | 1470 | if (conf_write(QFile::encodeName(s))) |
| ... | ... | @@ -1524,6 +1525,8 @@ |
| 1524 | 1525 | case fullMode: |
| 1525 | 1526 | list = configList; |
| 1526 | 1527 | break; |
| 1528 | + default: | |
| 1529 | + break; | |
| 1527 | 1530 | } |
| 1528 | 1531 | |
| 1529 | 1532 | if (list) { |
| ... | ... | @@ -1672,6 +1675,9 @@ |
| 1672 | 1675 | |
| 1673 | 1676 | case fullMode : |
| 1674 | 1677 | entry = "full"; |
| 1678 | + break; | |
| 1679 | + | |
| 1680 | + default: | |
| 1675 | 1681 | break; |
| 1676 | 1682 | } |
| 1677 | 1683 | configSettings->writeEntry("/listMode", entry); |
scripts/kconfig/util.c
| ... | ... | @@ -46,8 +46,8 @@ |
| 46 | 46 | else |
| 47 | 47 | fprintf(out, "\t%s\n", file->name); |
| 48 | 48 | } |
| 49 | - fprintf(out, "\ninclude/config/auto.conf: \\\n" | |
| 50 | - "\t$(deps_config)\n\n"); | |
| 49 | + fprintf(out, "\n%s: \\\n" | |
| 50 | + "\t$(deps_config)\n\n", conf_get_autoconfig_name()); | |
| 51 | 51 | |
| 52 | 52 | expr_list_for_each_sym(sym_env_list, e, sym) { |
| 53 | 53 | struct property *prop; |
| ... | ... | @@ -61,7 +61,7 @@ |
| 61 | 61 | if (!value) |
| 62 | 62 | value = ""; |
| 63 | 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 | 65 | fprintf(out, "endif\n"); |
| 66 | 66 | } |
| 67 | 67 |
scripts/kernel-doc
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | ## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## |
| 6 | 6 | ## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ## |
| 7 | 7 | ## Copyright (C) 2001 Simon Huggins ## |
| 8 | -## Copyright (C) 2005-2008 Randy Dunlap ## | |
| 8 | +## Copyright (C) 2005-2009 Randy Dunlap ## | |
| 9 | 9 | ## ## |
| 10 | 10 | ## #define enhancements by Armin Kuster <akuster@mvista.com> ## |
| 11 | 11 | ## Copyright (c) 2000 MontaVista Software, Inc. ## |
| ... | ... | @@ -85,7 +85,7 @@ |
| 85 | 85 | # |
| 86 | 86 | # /** |
| 87 | 87 | # * my_function |
| 88 | -# **/ | |
| 88 | +# */ | |
| 89 | 89 | # |
| 90 | 90 | # If the Description: header tag is omitted, then there must be a blank line |
| 91 | 91 | # after the last parameter specification. |
| ... | ... | @@ -105,7 +105,7 @@ |
| 105 | 105 | # */ |
| 106 | 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 | 109 | # enums and typedefs. Instead of the function name you must write the name |
| 110 | 110 | # of the declaration; the struct/union/enum/typedef must always precede |
| 111 | 111 | # the name. Nesting of declarations is not supported. |
| ... | ... | @@ -223,7 +223,7 @@ |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | # read arguments |
| 226 | -if ($#ARGV==-1) { | |
| 226 | +if ($#ARGV == -1) { | |
| 227 | 227 | usage(); |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | |
| ... | ... | @@ -240,12 +240,12 @@ |
| 240 | 240 | " " . ((localtime)[5]+1900); |
| 241 | 241 | |
| 242 | 242 | # Essentially these are globals |
| 243 | -# They probably want to be tidied up made more localised or summat. | |
| 244 | -# CAVEAT EMPTOR! Some of the others I localised may not want to be which | |
| 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 | |
| 245 | 245 | # could cause "use of undefined value" or other bugs. |
| 246 | -my ($function, %function_table,%parametertypes,$declaration_purpose); | |
| 247 | -my ($type,$declaration_name,$return_type); | |
| 248 | -my ($newsection,$newcontents,$prototype,$filelist, $brcount, %source_map); | |
| 246 | +my ($function, %function_table, %parametertypes, $declaration_purpose); | |
| 247 | +my ($type, $declaration_name, $return_type); | |
| 248 | +my ($newsection, $newcontents, $prototype, $filelist, $brcount, %source_map); | |
| 249 | 249 | |
| 250 | 250 | if (defined($ENV{'KBUILD_VERBOSE'})) { |
| 251 | 251 | $verbose = "$ENV{'KBUILD_VERBOSE'}"; |
| ... | ... | @@ -279,10 +279,10 @@ |
| 279 | 279 | my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start. |
| 280 | 280 | my $doc_end = '\*/'; |
| 281 | 281 | my $doc_com = '\s*\*\s*'; |
| 282 | -my $doc_decl = $doc_com.'(\w+)'; | |
| 283 | -my $doc_sect = $doc_com.'(['.$doc_special.']?[\w\s]+):(.*)'; | |
| 284 | -my $doc_content = $doc_com.'(.*)'; | |
| 285 | -my $doc_block = $doc_com.'DOC:\s*(.*)?'; | |
| 282 | +my $doc_decl = $doc_com . '(\w+)'; | |
| 283 | +my $doc_sect = $doc_com . '([' . $doc_special . ']?[\w\s]+):(.*)'; | |
| 284 | +my $doc_content = $doc_com . '(.*)'; | |
| 285 | +my $doc_block = $doc_com . 'DOC:\s*(.*)?'; | |
| 286 | 286 | |
| 287 | 287 | my %constants; |
| 288 | 288 | my %parameterdescs; |
| 289 | 289 | |
| 290 | 290 | |
| ... | ... | @@ -485,12 +485,12 @@ |
| 485 | 485 | my %args = %{$_[0]}; |
| 486 | 486 | my ($parameter); |
| 487 | 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 | 491 | $count = 0; |
| 492 | 492 | foreach $parameter (@{$args{'parameterlist'}}) { |
| 493 | - print " <b>".$parameter."</b>"; | |
| 493 | + print " <b>" . $parameter . "</b>"; | |
| 494 | 494 | if ($count != $#{$args{'parameterlist'}}) { |
| 495 | 495 | $count++; |
| 496 | 496 | print ",\n"; |
| ... | ... | @@ -502,7 +502,7 @@ |
| 502 | 502 | print "<h3>Constants</h3>\n"; |
| 503 | 503 | print "<dl>\n"; |
| 504 | 504 | foreach $parameter (@{$args{'parameterlist'}}) { |
| 505 | - print "<dt><b>".$parameter."</b>\n"; | |
| 505 | + print "<dt><b>" . $parameter . "</b>\n"; | |
| 506 | 506 | print "<dd>"; |
| 507 | 507 | output_highlight($args{'parameterdescs'}{$parameter}); |
| 508 | 508 | } |
| 509 | 509 | |
| ... | ... | @@ -516,9 +516,9 @@ |
| 516 | 516 | my %args = %{$_[0]}; |
| 517 | 517 | my ($parameter); |
| 518 | 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 | 522 | output_section_html(@_); |
| 523 | 523 | print "<hr>\n"; |
| 524 | 524 | } |
| ... | ... | @@ -528,8 +528,8 @@ |
| 528 | 528 | my %args = %{$_[0]}; |
| 529 | 529 | my ($parameter); |
| 530 | 530 | |
| 531 | - print "<h2>".$args{'type'}." ".$args{'struct'}. " - " .$args{'purpose'}."</h2>\n"; | |
| 532 | - print "<b>".$args{'type'}." ".$args{'struct'}."</b> {<br>\n"; | |
| 531 | + print "<h2>" . $args{'type'} . " " . $args{'struct'} . " - " . $args{'purpose'} . "</h2>\n"; | |
| 532 | + print "<b>" . $args{'type'} . " " . $args{'struct'} . "</b> {<br>\n"; | |
| 533 | 533 | foreach $parameter (@{$args{'parameterlist'}}) { |
| 534 | 534 | if ($parameter =~ /^#/) { |
| 535 | 535 | print "$parameter<br>\n"; |
| ... | ... | @@ -561,7 +561,7 @@ |
| 561 | 561 | $parameter_name =~ s/\[.*//; |
| 562 | 562 | |
| 563 | 563 | ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; |
| 564 | - print "<dt><b>".$parameter."</b>\n"; | |
| 564 | + print "<dt><b>" . $parameter . "</b>\n"; | |
| 565 | 565 | print "<dd>"; |
| 566 | 566 | output_highlight($args{'parameterdescs'}{$parameter_name}); |
| 567 | 567 | } |
| ... | ... | @@ -576,9 +576,9 @@ |
| 576 | 576 | my ($parameter, $section); |
| 577 | 577 | my $count; |
| 578 | 578 | |
| 579 | - print "<h2>" .$args{'function'}." - ".$args{'purpose'}."</h2>\n"; | |
| 580 | - print "<i>".$args{'functiontype'}."</i>\n"; | |
| 581 | - print "<b>".$args{'function'}."</b>\n"; | |
| 579 | + print "<h2>" . $args{'function'} . " - " . $args{'purpose'} . "</h2>\n"; | |
| 580 | + print "<i>" . $args{'functiontype'} . "</i>\n"; | |
| 581 | + print "<b>" . $args{'function'} . "</b>\n"; | |
| 582 | 582 | print "("; |
| 583 | 583 | $count = 0; |
| 584 | 584 | foreach $parameter (@{$args{'parameterlist'}}) { |
| ... | ... | @@ -587,7 +587,7 @@ |
| 587 | 587 | # pointer-to-function |
| 588 | 588 | print "<i>$1</i><b>$parameter</b>) <i>($2)</i>"; |
| 589 | 589 | } else { |
| 590 | - print "<i>".$type."</i> <b>".$parameter."</b>"; | |
| 590 | + print "<i>" . $type . "</i> <b>" . $parameter . "</b>"; | |
| 591 | 591 | } |
| 592 | 592 | if ($count != $#{$args{'parameterlist'}}) { |
| 593 | 593 | $count++; |
| ... | ... | @@ -603,7 +603,7 @@ |
| 603 | 603 | $parameter_name =~ s/\[.*//; |
| 604 | 604 | |
| 605 | 605 | ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; |
| 606 | - print "<dt><b>".$parameter."</b>\n"; | |
| 606 | + print "<dt><b>" . $parameter . "</b>\n"; | |
| 607 | 607 | print "<dd>"; |
| 608 | 608 | output_highlight($args{'parameterdescs'}{$parameter_name}); |
| 609 | 609 | } |
| ... | ... | @@ -657,7 +657,7 @@ |
| 657 | 657 | my $count; |
| 658 | 658 | my $id; |
| 659 | 659 | |
| 660 | - $id = "API-".$args{'function'}; | |
| 660 | + $id = "API-" . $args{'function'}; | |
| 661 | 661 | $id =~ s/[^A-Za-z0-9]/-/g; |
| 662 | 662 | |
| 663 | 663 | print "<refentry id=\"$id\">\n"; |
| 664 | 664 | |
| ... | ... | @@ -667,12 +667,12 @@ |
| 667 | 667 | print " <date>$man_date</date>\n"; |
| 668 | 668 | print "</refentryinfo>\n"; |
| 669 | 669 | print "<refmeta>\n"; |
| 670 | - print " <refentrytitle><phrase>".$args{'function'}."</phrase></refentrytitle>\n"; | |
| 670 | + print " <refentrytitle><phrase>" . $args{'function'} . "</phrase></refentrytitle>\n"; | |
| 671 | 671 | print " <manvolnum>9</manvolnum>\n"; |
| 672 | 672 | print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; |
| 673 | 673 | print "</refmeta>\n"; |
| 674 | 674 | print "<refnamediv>\n"; |
| 675 | - print " <refname>".$args{'function'}."</refname>\n"; | |
| 675 | + print " <refname>" . $args{'function'} . "</refname>\n"; | |
| 676 | 676 | print " <refpurpose>\n"; |
| 677 | 677 | print " "; |
| 678 | 678 | output_highlight ($args{'purpose'}); |
| ... | ... | @@ -682,8 +682,8 @@ |
| 682 | 682 | print "<refsynopsisdiv>\n"; |
| 683 | 683 | print " <title>Synopsis</title>\n"; |
| 684 | 684 | print " <funcsynopsis><funcprototype>\n"; |
| 685 | - print " <funcdef>".$args{'functiontype'}." "; | |
| 686 | - print "<function>".$args{'function'}." </function></funcdef>\n"; | |
| 685 | + print " <funcdef>" . $args{'functiontype'} . " "; | |
| 686 | + print "<function>" . $args{'function'} . " </function></funcdef>\n"; | |
| 687 | 687 | |
| 688 | 688 | $count = 0; |
| 689 | 689 | if ($#{$args{'parameterlist'}} >= 0) { |
| ... | ... | @@ -694,7 +694,7 @@ |
| 694 | 694 | print " <paramdef>$1<parameter>$parameter</parameter>)\n"; |
| 695 | 695 | print " <funcparams>$2</funcparams></paramdef>\n"; |
| 696 | 696 | } else { |
| 697 | - print " <paramdef>".$type; | |
| 697 | + print " <paramdef>" . $type; | |
| 698 | 698 | print " <parameter>$parameter</parameter></paramdef>\n"; |
| 699 | 699 | } |
| 700 | 700 | } |
| ... | ... | @@ -734,7 +734,7 @@ |
| 734 | 734 | my ($parameter, $section); |
| 735 | 735 | my $id; |
| 736 | 736 | |
| 737 | - $id = "API-struct-".$args{'struct'}; | |
| 737 | + $id = "API-struct-" . $args{'struct'}; | |
| 738 | 738 | $id =~ s/[^A-Za-z0-9]/-/g; |
| 739 | 739 | |
| 740 | 740 | print "<refentry id=\"$id\">\n"; |
| 741 | 741 | |
| ... | ... | @@ -744,12 +744,12 @@ |
| 744 | 744 | print " <date>$man_date</date>\n"; |
| 745 | 745 | print "</refentryinfo>\n"; |
| 746 | 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 | 748 | print " <manvolnum>9</manvolnum>\n"; |
| 749 | 749 | print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; |
| 750 | 750 | print "</refmeta>\n"; |
| 751 | 751 | print "<refnamediv>\n"; |
| 752 | - print " <refname>".$args{'type'}." ".$args{'struct'}."</refname>\n"; | |
| 752 | + print " <refname>" . $args{'type'} . " " . $args{'struct'} . "</refname>\n"; | |
| 753 | 753 | print " <refpurpose>\n"; |
| 754 | 754 | print " "; |
| 755 | 755 | output_highlight ($args{'purpose'}); |
| ... | ... | @@ -759,7 +759,7 @@ |
| 759 | 759 | print "<refsynopsisdiv>\n"; |
| 760 | 760 | print " <title>Synopsis</title>\n"; |
| 761 | 761 | print " <programlisting>\n"; |
| 762 | - print $args{'type'}." ".$args{'struct'}." {\n"; | |
| 762 | + print $args{'type'} . " " . $args{'struct'} . " {\n"; | |
| 763 | 763 | foreach $parameter (@{$args{'parameterlist'}}) { |
| 764 | 764 | if ($parameter =~ /^#/) { |
| 765 | 765 | print "$parameter\n"; |
| ... | ... | @@ -779,7 +779,7 @@ |
| 779 | 779 | # bitfield |
| 780 | 780 | print " $1 $parameter$2;\n"; |
| 781 | 781 | } else { |
| 782 | - print " ".$type." ".$parameter.";\n"; | |
| 782 | + print " " . $type . " " . $parameter . ";\n"; | |
| 783 | 783 | } |
| 784 | 784 | } |
| 785 | 785 | print "};"; |
| ... | ... | @@ -824,7 +824,7 @@ |
| 824 | 824 | my $count; |
| 825 | 825 | my $id; |
| 826 | 826 | |
| 827 | - $id = "API-enum-".$args{'enum'}; | |
| 827 | + $id = "API-enum-" . $args{'enum'}; | |
| 828 | 828 | $id =~ s/[^A-Za-z0-9]/-/g; |
| 829 | 829 | |
| 830 | 830 | print "<refentry id=\"$id\">\n"; |
| 831 | 831 | |
| ... | ... | @@ -834,12 +834,12 @@ |
| 834 | 834 | print " <date>$man_date</date>\n"; |
| 835 | 835 | print "</refentryinfo>\n"; |
| 836 | 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 | 838 | print " <manvolnum>9</manvolnum>\n"; |
| 839 | 839 | print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; |
| 840 | 840 | print "</refmeta>\n"; |
| 841 | 841 | print "<refnamediv>\n"; |
| 842 | - print " <refname>enum ".$args{'enum'}."</refname>\n"; | |
| 842 | + print " <refname>enum " . $args{'enum'} . "</refname>\n"; | |
| 843 | 843 | print " <refpurpose>\n"; |
| 844 | 844 | print " "; |
| 845 | 845 | output_highlight ($args{'purpose'}); |
| ... | ... | @@ -849,7 +849,7 @@ |
| 849 | 849 | print "<refsynopsisdiv>\n"; |
| 850 | 850 | print " <title>Synopsis</title>\n"; |
| 851 | 851 | print " <programlisting>\n"; |
| 852 | - print "enum ".$args{'enum'}." {\n"; | |
| 852 | + print "enum " . $args{'enum'} . " {\n"; | |
| 853 | 853 | $count = 0; |
| 854 | 854 | foreach $parameter (@{$args{'parameterlist'}}) { |
| 855 | 855 | print " $parameter"; |
| ... | ... | @@ -891,7 +891,7 @@ |
| 891 | 891 | my ($parameter, $section); |
| 892 | 892 | my $id; |
| 893 | 893 | |
| 894 | - $id = "API-typedef-".$args{'typedef'}; | |
| 894 | + $id = "API-typedef-" . $args{'typedef'}; | |
| 895 | 895 | $id =~ s/[^A-Za-z0-9]/-/g; |
| 896 | 896 | |
| 897 | 897 | print "<refentry id=\"$id\">\n"; |
| 898 | 898 | |
| ... | ... | @@ -901,11 +901,11 @@ |
| 901 | 901 | print " <date>$man_date</date>\n"; |
| 902 | 902 | print "</refentryinfo>\n"; |
| 903 | 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 | 905 | print " <manvolnum>9</manvolnum>\n"; |
| 906 | 906 | print "</refmeta>\n"; |
| 907 | 907 | print "<refnamediv>\n"; |
| 908 | - print " <refname>typedef ".$args{'typedef'}."</refname>\n"; | |
| 908 | + print " <refname>typedef " . $args{'typedef'} . "</refname>\n"; | |
| 909 | 909 | print " <refpurpose>\n"; |
| 910 | 910 | print " "; |
| 911 | 911 | output_highlight ($args{'purpose'}); |
| ... | ... | @@ -914,7 +914,7 @@ |
| 914 | 914 | |
| 915 | 915 | print "<refsynopsisdiv>\n"; |
| 916 | 916 | print " <title>Synopsis</title>\n"; |
| 917 | - print " <synopsis>typedef ".$args{'typedef'}.";</synopsis>\n"; | |
| 917 | + print " <synopsis>typedef " . $args{'typedef'} . ";</synopsis>\n"; | |
| 918 | 918 | print "</refsynopsisdiv>\n"; |
| 919 | 919 | |
| 920 | 920 | output_section_xml(@_); |
| 921 | 921 | |
| 922 | 922 | |
| ... | ... | @@ -963,15 +963,15 @@ |
| 963 | 963 | my $count; |
| 964 | 964 | my $id; |
| 965 | 965 | |
| 966 | - $id = $args{'module'}."-".$args{'function'}; | |
| 966 | + $id = $args{'module'} . "-" . $args{'function'}; | |
| 967 | 967 | $id =~ s/[^A-Za-z0-9]/-/g; |
| 968 | 968 | |
| 969 | 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 | 972 | print " <funcsynopsis>\n"; |
| 973 | - print " <funcdef>".$args{'functiontype'}." "; | |
| 974 | - print "<function>".$args{'function'}." "; | |
| 973 | + print " <funcdef>" . $args{'functiontype'} . " "; | |
| 974 | + print "<function>" . $args{'function'} . " "; | |
| 975 | 975 | print "</function></funcdef>\n"; |
| 976 | 976 | |
| 977 | 977 | $count = 0; |
| ... | ... | @@ -983,7 +983,7 @@ |
| 983 | 983 | print " <paramdef>$1 <parameter>$parameter</parameter>)\n"; |
| 984 | 984 | print " <funcparams>$2</funcparams></paramdef>\n"; |
| 985 | 985 | } else { |
| 986 | - print " <paramdef>".$type; | |
| 986 | + print " <paramdef>" . $type; | |
| 987 | 987 | print " <parameter>$parameter</parameter></paramdef>\n"; |
| 988 | 988 | } |
| 989 | 989 | } |
| 990 | 990 | |
| 991 | 991 | |
| ... | ... | @@ -1043,13 +1043,13 @@ |
| 1043 | 1043 | print ".TH \"$args{'function'}\" 9 \"$args{'function'}\" \"$man_date\" \"Kernel Hacker's Manual\" LINUX\n"; |
| 1044 | 1044 | |
| 1045 | 1045 | print ".SH NAME\n"; |
| 1046 | - print $args{'function'}." \\- ".$args{'purpose'}."\n"; | |
| 1046 | + print $args{'function'} . " \\- " . $args{'purpose'} . "\n"; | |
| 1047 | 1047 | |
| 1048 | 1048 | print ".SH SYNOPSIS\n"; |
| 1049 | 1049 | if ($args{'functiontype'} ne "") { |
| 1050 | - print ".B \"".$args{'functiontype'}."\" ".$args{'function'}."\n"; | |
| 1050 | + print ".B \"" . $args{'functiontype'} . "\" " . $args{'function'} . "\n"; | |
| 1051 | 1051 | } else { |
| 1052 | - print ".B \"".$args{'function'}."\n"; | |
| 1052 | + print ".B \"" . $args{'function'} . "\n"; | |
| 1053 | 1053 | } |
| 1054 | 1054 | $count = 0; |
| 1055 | 1055 | my $parenth = "("; |
| 1056 | 1056 | |
| ... | ... | @@ -1061,10 +1061,10 @@ |
| 1061 | 1061 | $type = $args{'parametertypes'}{$parameter}; |
| 1062 | 1062 | if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { |
| 1063 | 1063 | # pointer-to-function |
| 1064 | - print ".BI \"".$parenth.$1."\" ".$parameter." \") (".$2.")".$post."\"\n"; | |
| 1064 | + print ".BI \"" . $parenth . $1 . "\" " . $parameter . " \") (" . $2 . ")" . $post . "\"\n"; | |
| 1065 | 1065 | } else { |
| 1066 | 1066 | $type =~ s/([^\*])$/$1 /; |
| 1067 | - print ".BI \"".$parenth.$type."\" ".$parameter." \"".$post."\"\n"; | |
| 1067 | + print ".BI \"" . $parenth . $type . "\" " . $parameter . " \"" . $post . "\"\n"; | |
| 1068 | 1068 | } |
| 1069 | 1069 | $count++; |
| 1070 | 1070 | $parenth = ""; |
| ... | ... | @@ -1075,7 +1075,7 @@ |
| 1075 | 1075 | my $parameter_name = $parameter; |
| 1076 | 1076 | $parameter_name =~ s/\[.*//; |
| 1077 | 1077 | |
| 1078 | - print ".IP \"".$parameter."\" 12\n"; | |
| 1078 | + print ".IP \"" . $parameter . "\" 12\n"; | |
| 1079 | 1079 | output_highlight($args{'parameterdescs'}{$parameter_name}); |
| 1080 | 1080 | } |
| 1081 | 1081 | foreach $section (@{$args{'sectionlist'}}) { |
| 1082 | 1082 | |
| ... | ... | @@ -1094,10 +1094,10 @@ |
| 1094 | 1094 | print ".TH \"$args{'module'}\" 9 \"enum $args{'enum'}\" \"$man_date\" \"API Manual\" LINUX\n"; |
| 1095 | 1095 | |
| 1096 | 1096 | print ".SH NAME\n"; |
| 1097 | - print "enum ".$args{'enum'}." \\- ".$args{'purpose'}."\n"; | |
| 1097 | + print "enum " . $args{'enum'} . " \\- " . $args{'purpose'} . "\n"; | |
| 1098 | 1098 | |
| 1099 | 1099 | print ".SH SYNOPSIS\n"; |
| 1100 | - print "enum ".$args{'enum'}." {\n"; | |
| 1100 | + print "enum " . $args{'enum'} . " {\n"; | |
| 1101 | 1101 | $count = 0; |
| 1102 | 1102 | foreach my $parameter (@{$args{'parameterlist'}}) { |
| 1103 | 1103 | print ".br\n.BI \" $parameter\"\n"; |
| ... | ... | @@ -1116,7 +1116,7 @@ |
| 1116 | 1116 | my $parameter_name = $parameter; |
| 1117 | 1117 | $parameter_name =~ s/\[.*//; |
| 1118 | 1118 | |
| 1119 | - print ".IP \"".$parameter."\" 12\n"; | |
| 1119 | + print ".IP \"" . $parameter . "\" 12\n"; | |
| 1120 | 1120 | output_highlight($args{'parameterdescs'}{$parameter_name}); |
| 1121 | 1121 | } |
| 1122 | 1122 | foreach $section (@{$args{'sectionlist'}}) { |
| 1123 | 1123 | |
| 1124 | 1124 | |
| ... | ... | @@ -1131,13 +1131,13 @@ |
| 1131 | 1131 | my %args = %{$_[0]}; |
| 1132 | 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 | 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 | 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 | 1142 | foreach my $parameter (@{$args{'parameterlist'}}) { |
| 1143 | 1143 | if ($parameter =~ /^#/) { |
| 1144 | 1144 | |
| 1145 | 1145 | |
| ... | ... | @@ -1151,13 +1151,13 @@ |
| 1151 | 1151 | $type = $args{'parametertypes'}{$parameter}; |
| 1152 | 1152 | if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { |
| 1153 | 1153 | # pointer-to-function |
| 1154 | - print ".BI \" ".$1."\" ".$parameter." \") (".$2.")"."\"\n;\n"; | |
| 1154 | + print ".BI \" " . $1 . "\" " . $parameter . " \") (" . $2 . ")" . "\"\n;\n"; | |
| 1155 | 1155 | } elsif ($type =~ m/^(.*?)\s*(:.*)/) { |
| 1156 | 1156 | # bitfield |
| 1157 | - print ".BI \" ".$1."\ \" ".$parameter.$2." \""."\"\n;\n"; | |
| 1157 | + print ".BI \" " . $1 . "\ \" " . $parameter . $2 . " \"" . "\"\n;\n"; | |
| 1158 | 1158 | } else { |
| 1159 | 1159 | $type =~ s/([^\*])$/$1 /; |
| 1160 | - print ".BI \" ".$type."\" ".$parameter." \""."\"\n;\n"; | |
| 1160 | + print ".BI \" " . $type . "\" " . $parameter . " \"" . "\"\n;\n"; | |
| 1161 | 1161 | } |
| 1162 | 1162 | print "\n.br\n"; |
| 1163 | 1163 | } |
| ... | ... | @@ -1171,7 +1171,7 @@ |
| 1171 | 1171 | $parameter_name =~ s/\[.*//; |
| 1172 | 1172 | |
| 1173 | 1173 | ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; |
| 1174 | - print ".IP \"".$parameter."\" 12\n"; | |
| 1174 | + print ".IP \"" . $parameter . "\" 12\n"; | |
| 1175 | 1175 | output_highlight($args{'parameterdescs'}{$parameter_name}); |
| 1176 | 1176 | } |
| 1177 | 1177 | foreach $section (@{$args{'sectionlist'}}) { |
| ... | ... | @@ -1189,7 +1189,7 @@ |
| 1189 | 1189 | print ".TH \"$args{'module'}\" 9 \"$args{'typedef'}\" \"$man_date\" \"API Manual\" LINUX\n"; |
| 1190 | 1190 | |
| 1191 | 1191 | print ".SH NAME\n"; |
| 1192 | - print "typedef ".$args{'typedef'}." \\- ".$args{'purpose'}."\n"; | |
| 1192 | + print "typedef " . $args{'typedef'} . " \\- " . $args{'purpose'} . "\n"; | |
| 1193 | 1193 | |
| 1194 | 1194 | foreach $section (@{$args{'sectionlist'}}) { |
| 1195 | 1195 | print ".SH \"$section\"\n"; |
| 1196 | 1196 | |
| 1197 | 1197 | |
| ... | ... | @@ -1218,13 +1218,13 @@ |
| 1218 | 1218 | my $start; |
| 1219 | 1219 | |
| 1220 | 1220 | print "Name:\n\n"; |
| 1221 | - print $args{'function'}." - ".$args{'purpose'}."\n"; | |
| 1221 | + print $args{'function'} . " - " . $args{'purpose'} . "\n"; | |
| 1222 | 1222 | |
| 1223 | 1223 | print "\nSynopsis:\n\n"; |
| 1224 | 1224 | if ($args{'functiontype'} ne "") { |
| 1225 | - $start = $args{'functiontype'}." ".$args{'function'}." ("; | |
| 1225 | + $start = $args{'functiontype'} . " " . $args{'function'} . " ("; | |
| 1226 | 1226 | } else { |
| 1227 | - $start = $args{'function'}." ("; | |
| 1227 | + $start = $args{'function'} . " ("; | |
| 1228 | 1228 | } |
| 1229 | 1229 | print $start; |
| 1230 | 1230 | |
| 1231 | 1231 | |
| ... | ... | @@ -1233,9 +1233,9 @@ |
| 1233 | 1233 | $type = $args{'parametertypes'}{$parameter}; |
| 1234 | 1234 | if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { |
| 1235 | 1235 | # pointer-to-function |
| 1236 | - print $1.$parameter.") (".$2; | |
| 1236 | + print $1 . $parameter . ") (" . $2; | |
| 1237 | 1237 | } else { |
| 1238 | - print $type." ".$parameter; | |
| 1238 | + print $type . " " . $parameter; | |
| 1239 | 1239 | } |
| 1240 | 1240 | if ($count != $#{$args{'parameterlist'}}) { |
| 1241 | 1241 | $count++; |
| ... | ... | @@ -1251,7 +1251,7 @@ |
| 1251 | 1251 | my $parameter_name = $parameter; |
| 1252 | 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 | 1256 | output_section_text(@_); |
| 1257 | 1257 | } |
| ... | ... | @@ -1276,8 +1276,8 @@ |
| 1276 | 1276 | my $count; |
| 1277 | 1277 | print "Enum:\n\n"; |
| 1278 | 1278 | |
| 1279 | - print "enum ".$args{'enum'}." - ".$args{'purpose'}."\n\n"; | |
| 1280 | - print "enum ".$args{'enum'}." {\n"; | |
| 1279 | + print "enum " . $args{'enum'} . " - " . $args{'purpose'} . "\n\n"; | |
| 1280 | + print "enum " . $args{'enum'} . " {\n"; | |
| 1281 | 1281 | $count = 0; |
| 1282 | 1282 | foreach $parameter (@{$args{'parameterlist'}}) { |
| 1283 | 1283 | print "\t$parameter"; |
| ... | ... | @@ -1292,7 +1292,7 @@ |
| 1292 | 1292 | print "Constants:\n\n"; |
| 1293 | 1293 | foreach $parameter (@{$args{'parameterlist'}}) { |
| 1294 | 1294 | print "$parameter\n\t"; |
| 1295 | - print $args{'parameterdescs'}{$parameter}."\n"; | |
| 1295 | + print $args{'parameterdescs'}{$parameter} . "\n"; | |
| 1296 | 1296 | } |
| 1297 | 1297 | |
| 1298 | 1298 | output_section_text(@_); |
| ... | ... | @@ -1305,7 +1305,7 @@ |
| 1305 | 1305 | my $count; |
| 1306 | 1306 | print "Typedef:\n\n"; |
| 1307 | 1307 | |
| 1308 | - print "typedef ".$args{'typedef'}." - ".$args{'purpose'}."\n"; | |
| 1308 | + print "typedef " . $args{'typedef'} . " - " . $args{'purpose'} . "\n"; | |
| 1309 | 1309 | output_section_text(@_); |
| 1310 | 1310 | } |
| 1311 | 1311 | |
| ... | ... | @@ -1314,8 +1314,8 @@ |
| 1314 | 1314 | my %args = %{$_[0]}; |
| 1315 | 1315 | my ($parameter); |
| 1316 | 1316 | |
| 1317 | - print $args{'type'}." ".$args{'struct'}." - ".$args{'purpose'}."\n\n"; | |
| 1318 | - print $args{'type'}." ".$args{'struct'}." {\n"; | |
| 1317 | + print $args{'type'} . " " . $args{'struct'} . " - " . $args{'purpose'} . "\n\n"; | |
| 1318 | + print $args{'type'} . " " . $args{'struct'} . " {\n"; | |
| 1319 | 1319 | foreach $parameter (@{$args{'parameterlist'}}) { |
| 1320 | 1320 | if ($parameter =~ /^#/) { |
| 1321 | 1321 | print "$parameter\n"; |
| ... | ... | @@ -1334,7 +1334,7 @@ |
| 1334 | 1334 | # bitfield |
| 1335 | 1335 | print "\t$1 $parameter$2;\n"; |
| 1336 | 1336 | } else { |
| 1337 | - print "\t".$type." ".$parameter.";\n"; | |
| 1337 | + print "\t" . $type . " " . $parameter . ";\n"; | |
| 1338 | 1338 | } |
| 1339 | 1339 | } |
| 1340 | 1340 | print "};\n\n"; |
| ... | ... | @@ -1348,7 +1348,7 @@ |
| 1348 | 1348 | |
| 1349 | 1349 | ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; |
| 1350 | 1350 | print "$parameter\n\t"; |
| 1351 | - print $args{'parameterdescs'}{$parameter_name}."\n"; | |
| 1351 | + print $args{'parameterdescs'}{$parameter_name} . "\n"; | |
| 1352 | 1352 | } |
| 1353 | 1353 | print "\n"; |
| 1354 | 1354 | output_section_text(@_); |
| ... | ... | @@ -1387,7 +1387,7 @@ |
| 1387 | 1387 | # generic output function - calls the right one based on current output mode. |
| 1388 | 1388 | sub output_blockhead { |
| 1389 | 1389 | no strict 'refs'; |
| 1390 | - my $func = "output_blockhead_".$output_mode; | |
| 1390 | + my $func = "output_blockhead_" . $output_mode; | |
| 1391 | 1391 | &$func(@_); |
| 1392 | 1392 | $section_counter++; |
| 1393 | 1393 | } |
| ... | ... | @@ -1398,7 +1398,7 @@ |
| 1398 | 1398 | sub dump_declaration($$) { |
| 1399 | 1399 | no strict 'refs'; |
| 1400 | 1400 | my ($prototype, $file) = @_; |
| 1401 | - my $func = "dump_".$decl_type; | |
| 1401 | + my $func = "dump_" . $decl_type; | |
| 1402 | 1402 | &$func(@_); |
| 1403 | 1403 | } |
| 1404 | 1404 | |
| ... | ... | @@ -1645,7 +1645,7 @@ |
| 1645 | 1645 | "or member '$param' not " . |
| 1646 | 1646 | "described in '$declaration_name'\n"; |
| 1647 | 1647 | } |
| 1648 | - print STDERR "Warning(${file}:$.):". | |
| 1648 | + print STDERR "Warning(${file}:$.):" . | |
| 1649 | 1649 | " No description found for parameter '$param'\n"; |
| 1650 | 1650 | ++$warnings; |
| 1651 | 1651 | } |
| ... | ... | @@ -1929,7 +1929,7 @@ |
| 1929 | 1929 | ($2 eq '{') && $brcount++; |
| 1930 | 1930 | ($2 eq '}') && $brcount--; |
| 1931 | 1931 | if (($2 eq ';') && ($brcount == 0)) { |
| 1932 | - dump_declaration($prototype,$file); | |
| 1932 | + dump_declaration($prototype, $file); | |
| 1933 | 1933 | reset_state(); |
| 1934 | 1934 | last; |
| 1935 | 1935 | } |
| ... | ... | @@ -2106,7 +2106,7 @@ |
| 2106 | 2106 | $section = $section_default; |
| 2107 | 2107 | $contents = ""; |
| 2108 | 2108 | } else { |
| 2109 | - $contents .= $1."\n"; | |
| 2109 | + $contents .= $1 . "\n"; | |
| 2110 | 2110 | } |
| 2111 | 2111 | } else { |
| 2112 | 2112 | # i dont know - bad line? ignore. |
scripts/mod/modpost.c
| ... | ... | @@ -763,6 +763,8 @@ |
| 763 | 763 | |
| 764 | 764 | |
| 765 | 765 | #define ALL_INIT_DATA_SECTIONS \ |
| 766 | + ".init.setup$", ".init.rodata$", \ | |
| 767 | + ".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$" \ | |
| 766 | 768 | ".init.data$", ".devinit.data$", ".cpuinit.data$", ".meminit.data$" |
| 767 | 769 | #define ALL_EXIT_DATA_SECTIONS \ |
| 768 | 770 | ".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$" |
| 769 | 771 | |
| 770 | 772 | |
| ... | ... | @@ -772,21 +774,23 @@ |
| 772 | 774 | #define ALL_EXIT_TEXT_SECTIONS \ |
| 773 | 775 | ".exit.text$", ".devexit.text$", ".cpuexit.text$", ".memexit.text$" |
| 774 | 776 | |
| 775 | -#define ALL_INIT_SECTIONS ALL_INIT_DATA_SECTIONS, ALL_INIT_TEXT_SECTIONS | |
| 776 | -#define ALL_EXIT_SECTIONS ALL_EXIT_DATA_SECTIONS, ALL_EXIT_TEXT_SECTIONS | |
| 777 | +#define ALL_INIT_SECTIONS INIT_SECTIONS, DEV_INIT_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 | 782 | #define DATA_SECTIONS ".data$", ".data.rel$" |
| 779 | 783 | #define TEXT_SECTIONS ".text$" |
| 780 | 784 | |
| 781 | -#define INIT_SECTIONS ".init.data$", ".init.text$" | |
| 782 | -#define DEV_INIT_SECTIONS ".devinit.data$", ".devinit.text$" | |
| 783 | -#define CPU_INIT_SECTIONS ".cpuinit.data$", ".cpuinit.text$" | |
| 784 | -#define MEM_INIT_SECTIONS ".meminit.data$", ".meminit.text$" | |
| 785 | +#define INIT_SECTIONS ".init.*" | |
| 786 | +#define DEV_INIT_SECTIONS ".devinit.*" | |
| 787 | +#define CPU_INIT_SECTIONS ".cpuinit.*" | |
| 788 | +#define MEM_INIT_SECTIONS ".meminit.*" | |
| 785 | 789 | |
| 786 | -#define EXIT_SECTIONS ".exit.data$", ".exit.text$" | |
| 787 | -#define DEV_EXIT_SECTIONS ".devexit.data$", ".devexit.text$" | |
| 788 | -#define CPU_EXIT_SECTIONS ".cpuexit.data$", ".cpuexit.text$" | |
| 789 | -#define MEM_EXIT_SECTIONS ".memexit.data$", ".memexit.text$" | |
| 790 | +#define EXIT_SECTIONS ".exit.*" | |
| 791 | +#define DEV_EXIT_SECTIONS ".devexit.*" | |
| 792 | +#define CPU_EXIT_SECTIONS ".cpuexit.*" | |
| 793 | +#define MEM_EXIT_SECTIONS ".memexit.*" | |
| 790 | 794 | |
| 791 | 795 | /* init data sections */ |
| 792 | 796 | static const char *init_data_sections[] = { ALL_INIT_DATA_SECTIONS, NULL }; |
| 793 | 797 | |
| ... | ... | @@ -869,12 +873,36 @@ |
| 869 | 873 | .tosec = { INIT_SECTIONS, NULL }, |
| 870 | 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 | 888 | /* Do not reference exit code/data from devexit/cpuexit/memexit code/data */ |
| 873 | 889 | { |
| 874 | 890 | .fromsec = { DEV_EXIT_SECTIONS, CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS, NULL }, |
| 875 | 891 | .tosec = { EXIT_SECTIONS, NULL }, |
| 876 | 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 | 906 | /* Do not use exit code/data from init code */ |
| 879 | 907 | { |
| 880 | 908 | .fromsec = { ALL_INIT_SECTIONS, NULL }, |
| ... | ... | @@ -1168,7 +1196,7 @@ |
| 1168 | 1196 | "The variable %s references\n" |
| 1169 | 1197 | "the %s %s%s%s\n" |
| 1170 | 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 | 1200 | "or name the variable:\n", |
| 1173 | 1201 | fromsym, to, sec2annotation(tosec), tosym, to_p); |
| 1174 | 1202 | while (*s) |
scripts/package/builddeb
| 1 | 1 | #!/bin/sh |
| 2 | 2 | # |
| 3 | -# builddeb 1.2 | |
| 3 | +# builddeb 1.3 | |
| 4 | 4 | # Copyright 2003 Wichert Akkerman <wichert@wiggy.net> |
| 5 | 5 | # |
| 6 | 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 | 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 | |
| 10 | -# package install and removal. | |
| 9 | +# /etc/kernel/{pre,post}{inst,rm}.d/ directories (or an alternative location | |
| 10 | +# specified in KDEB_HOOKDIR) that will be called on package install and | |
| 11 | +# removal. | |
| 11 | 12 | |
| 12 | 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 | 29 | # Some variables and settings used throughout the script |
| 15 | 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 | 37 | tmpdir="$objtree/debian/tmp" |
| 18 | 38 | fwdir="$objtree/debian/fwtmp" |
| 19 | -packagename=linux-$version | |
| 39 | +packagename=linux-image-$version | |
| 20 | 40 | fwpackagename=linux-firmware-image |
| 21 | 41 | |
| 22 | -if [ "$ARCH" == "um" ] ; then | |
| 42 | +if [ "$ARCH" = "um" ] ; then | |
| 23 | 43 | packagename=user-mode-linux-$version |
| 24 | 44 | fi |
| 25 | 45 | |
| 26 | 46 | # Setup the directory structure |
| 27 | 47 | rm -rf "$tmpdir" "$fwdir" |
| 28 | -mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" | |
| 29 | -mkdir -p "$fwdir/DEBIAN" "$fwdir/lib" | |
| 30 | -if [ "$ARCH" == "um" ] ; then | |
| 31 | - mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/share/doc/$packagename" "$tmpdir/usr/bin" | |
| 48 | +mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" "$tmpdir/usr/share/doc/$packagename" | |
| 49 | +mkdir -p "$fwdir/DEBIAN" "$fwdir/lib" "$fwdir/usr/share/doc/$fwpackagename" | |
| 50 | +if [ "$ARCH" = "um" ] ; then | |
| 51 | + mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/bin" | |
| 32 | 52 | fi |
| 33 | 53 | |
| 34 | 54 | # Build and install the kernel |
| 35 | -if [ "$ARCH" == "um" ] ; then | |
| 55 | +if [ "$ARCH" = "um" ] ; then | |
| 36 | 56 | $MAKE linux |
| 37 | 57 | cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map" |
| 38 | 58 | cp .config "$tmpdir/usr/share/doc/$packagename/config" |
| 39 | 59 | |
| 40 | 60 | |
| 41 | 61 | |
| 42 | 62 | |
| 43 | 63 | |
| 44 | 64 | |
| 45 | 65 | |
| 46 | 66 | |
| 47 | 67 | |
| 48 | 68 | |
| 49 | 69 | |
| 50 | 70 | |
| 51 | 71 | |
| 52 | 72 | |
| ... | ... | @@ -41,53 +61,100 @@ |
| 41 | 61 | else |
| 42 | 62 | cp System.map "$tmpdir/boot/System.map-$version" |
| 43 | 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 | 68 | fi |
| 46 | 69 | |
| 47 | 70 | if grep -q '^CONFIG_MODULES=y' .config ; then |
| 48 | 71 | INSTALL_MOD_PATH="$tmpdir" make KBUILD_SRC= modules_install |
| 49 | - if [ "$ARCH" == "um" ] ; then | |
| 72 | + if [ "$ARCH" = "um" ] ; then | |
| 50 | 73 | mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/" |
| 51 | 74 | rmdir "$tmpdir/lib/modules/$version" |
| 52 | 75 | fi |
| 53 | 76 | fi |
| 54 | 77 | |
| 55 | 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 | 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 | 84 | cat <<EOF > "$tmpdir/DEBIAN/$script" |
| 59 | 85 | #!/bin/sh |
| 60 | 86 | |
| 61 | 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 | 93 | exit 0 |
| 65 | 94 | EOF |
| 66 | 95 | chmod 755 "$tmpdir/DEBIAN/$script" |
| 67 | 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 | 115 | # Generate a simple changelog template |
| 71 | 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 | 122 | EOF |
| 78 | 123 | |
| 79 | -# Generate a control file | |
| 80 | -if [ "$ARCH" == "um" ]; then | |
| 124 | +# Generate copyright file | |
| 125 | +cat <<EOF > debian/copyright | |
| 126 | +This is a packacked upstream version of the Linux kernel. | |
| 81 | 127 | |
| 128 | +The sources may be found at most Linux ftp sites, including: | |
| 129 | +ftp://ftp.kernel.org/pub/linux/kernel | |
| 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 | 145 | cat <<EOF > debian/control |
| 83 | -Source: linux | |
| 84 | -Section: base | |
| 146 | +Source: linux-upstream | |
| 147 | +Section: admin | |
| 85 | 148 | Priority: optional |
| 86 | -Maintainer: $name | |
| 87 | -Standards-Version: 3.6.1 | |
| 149 | +Maintainer: $maintainer | |
| 150 | +Standards-Version: 3.8.1 | |
| 151 | +EOF | |
| 88 | 152 | |
| 153 | +if [ "$ARCH" = "um" ]; then | |
| 154 | + cat <<EOF >> debian/control | |
| 155 | + | |
| 89 | 156 | Package: $packagename |
| 90 | -Provides: kernel-image-$version, linux-image-$version | |
| 157 | +Provides: linux-image, linux-image-2.6, linux-modules-$version | |
| 91 | 158 | Architecture: any |
| 92 | 159 | Description: User Mode Linux kernel, version $version |
| 93 | 160 | User-mode Linux is a port of the Linux kernel to its own system call |
| 94 | 161 | |
| 95 | 162 | |
| 96 | 163 | |
| 97 | 164 | |
| 98 | 165 | |
| ... | ... | @@ -97,31 +164,23 @@ |
| 97 | 164 | many other things. |
| 98 | 165 | . |
| 99 | 166 | This package contains the Linux kernel, modules and corresponding other |
| 100 | - files version $version | |
| 167 | + files, version: $version. | |
| 101 | 168 | EOF |
| 102 | 169 | |
| 103 | 170 | else |
| 104 | -cat <<EOF > debian/control | |
| 105 | -Source: linux | |
| 106 | -Section: base | |
| 107 | -Priority: optional | |
| 108 | -Maintainer: $name | |
| 109 | -Standards-Version: 3.6.1 | |
| 171 | + cat <<EOF >> debian/control | |
| 110 | 172 | |
| 111 | 173 | Package: $packagename |
| 112 | -Provides: kernel-image-$version, linux-image-$version | |
| 174 | +Provides: linux-image, linux-image-2.6, linux-modules-$version | |
| 113 | 175 | Suggests: $fwpackagename |
| 114 | 176 | Architecture: any |
| 115 | 177 | Description: Linux kernel, version $version |
| 116 | 178 | This package contains the Linux kernel, modules and corresponding other |
| 117 | - files version $version | |
| 179 | + files, version: $version. | |
| 118 | 180 | EOF |
| 181 | + | |
| 119 | 182 | fi |
| 120 | 183 | |
| 121 | -# Fix some ownership and permissions | |
| 122 | -chown -R root:root "$tmpdir" | |
| 123 | -chmod -R go-w "$tmpdir" | |
| 124 | - | |
| 125 | 184 | # Do we have firmware? Move it out of the way and build it into a package. |
| 126 | 185 | if [ -e "$tmpdir/lib/firmware" ]; then |
| 127 | 186 | mv "$tmpdir/lib/firmware" "$fwdir/lib/" |
| 128 | 187 | |
| 129 | 188 | |
| ... | ... | @@ -131,16 +190,13 @@ |
| 131 | 190 | Package: $fwpackagename |
| 132 | 191 | Architecture: all |
| 133 | 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 | 194 | EOF |
| 136 | 195 | |
| 137 | - dpkg-gencontrol -isp -p$fwpackagename -P"$fwdir" | |
| 138 | - dpkg --build "$fwdir" .. | |
| 196 | + create_package "$fwpackagename" "$fwdir" | |
| 139 | 197 | fi |
| 140 | 198 | |
| 141 | -# Perform the final magic | |
| 142 | -dpkg-gencontrol -isp -p$packagename | |
| 143 | -dpkg --build "$tmpdir" .. | |
| 199 | +create_package "$packagename" "$tmpdir" | |
| 144 | 200 | |
| 145 | 201 | exit 0 |
scripts/setlocalversion
| ... | ... | @@ -39,8 +39,10 @@ |
| 39 | 39 | printf -- '-svn%s' "`git svn find-rev $head`" |
| 40 | 40 | fi |
| 41 | 41 | |
| 42 | - # Are there uncommitted changes? | |
| 43 | - git update-index --refresh --unmerged > /dev/null | |
| 42 | + # Update index only on r/w media | |
| 43 | + [ -w . ] && git update-index --refresh --unmerged > /dev/null | |
| 44 | + | |
| 45 | + # Check for uncommitted changes | |
| 44 | 46 | if git diff-index --name-only HEAD | grep -v "^scripts/package" \ |
| 45 | 47 | | read dummy; then |
| 46 | 48 | printf '%s' -dirty |
scripts/unifdef.c
| ... | ... | @@ -678,8 +678,10 @@ |
| 678 | 678 | if (*cp == '!') { |
| 679 | 679 | debug("eval%d !", ops - eval_ops); |
| 680 | 680 | cp++; |
| 681 | - if (eval_unary(ops, valp, &cp) == LT_IF) | |
| 681 | + if (eval_unary(ops, valp, &cp) == LT_IF) { | |
| 682 | + *cpp = cp; | |
| 682 | 683 | return (LT_IF); |
| 684 | + } | |
| 683 | 685 | *valp = !*valp; |
| 684 | 686 | } else if (*cp == '(') { |
| 685 | 687 | cp++; |
| 686 | 688 | |
| ... | ... | @@ -700,13 +702,16 @@ |
| 700 | 702 | return (LT_IF); |
| 701 | 703 | cp = skipcomment(cp); |
| 702 | 704 | sym = findsym(cp); |
| 703 | - if (sym < 0) | |
| 704 | - return (LT_IF); | |
| 705 | - *valp = (value[sym] != NULL); | |
| 706 | 705 | cp = skipsym(cp); |
| 707 | 706 | cp = skipcomment(cp); |
| 708 | 707 | if (*cp++ != ')') |
| 709 | 708 | return (LT_IF); |
| 709 | + if (sym >= 0) | |
| 710 | + *valp = (value[sym] != NULL); | |
| 711 | + else { | |
| 712 | + *cpp = cp; | |
| 713 | + return (LT_IF); | |
| 714 | + } | |
| 710 | 715 | keepthis = false; |
| 711 | 716 | } else if (!endsym(*cp)) { |
| 712 | 717 | debug("eval%d symbol", ops - eval_ops); |
| 713 | 718 | |
| ... | ... | @@ -741,11 +746,11 @@ |
| 741 | 746 | const struct op *op; |
| 742 | 747 | const char *cp; |
| 743 | 748 | int val; |
| 749 | + Linetype lhs, rhs; | |
| 744 | 750 | |
| 745 | 751 | debug("eval%d", ops - eval_ops); |
| 746 | 752 | cp = *cpp; |
| 747 | - if (ops->inner(ops+1, valp, &cp) == LT_IF) | |
| 748 | - return (LT_IF); | |
| 753 | + lhs = ops->inner(ops+1, valp, &cp); | |
| 749 | 754 | for (;;) { |
| 750 | 755 | cp = skipcomment(cp); |
| 751 | 756 | for (op = ops->op; op->str != NULL; op++) |
| 752 | 757 | |
| ... | ... | @@ -755,14 +760,32 @@ |
| 755 | 760 | break; |
| 756 | 761 | cp += strlen(op->str); |
| 757 | 762 | debug("eval%d %s", ops - eval_ops, op->str); |
| 758 | - if (ops->inner(ops+1, &val, &cp) == LT_IF) | |
| 759 | - return (LT_IF); | |
| 760 | - *valp = op->fn(*valp, val); | |
| 763 | + rhs = ops->inner(ops+1, &val, &cp); | |
| 764 | + if (op->fn == op_and && (lhs == LT_FALSE || rhs == LT_FALSE)) { | |
| 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 | 784 | *cpp = cp; |
| 764 | 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 | /* |
| 769 | 792 | |
| ... | ... | @@ -773,12 +796,15 @@ |
| 773 | 796 | static Linetype |
| 774 | 797 | ifeval(const char **cpp) |
| 775 | 798 | { |
| 799 | + const char *cp = *cpp; | |
| 776 | 800 | int ret; |
| 777 | 801 | int val; |
| 778 | 802 | |
| 779 | 803 | debug("eval %s", *cpp); |
| 780 | 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 | 808 | debug("eval = %d", val); |
| 783 | 809 | return (keepthis ? LT_IF : ret); |
| 784 | 810 | } |
scripts/ver_linux
| ... | ... | @@ -65,7 +65,7 @@ |
| 65 | 65 | ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \ |
| 66 | 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 | 69 | '{print "Linux C++ Library " $4"."$5"."$6}' |
| 70 | 70 | |
| 71 | 71 | ps --version 2>&1 | grep version | awk \ |