aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.headersinst8
-rw-r--r--scripts/Makefile.lib39
-rw-r--r--scripts/basic/docproc.c13
-rw-r--r--scripts/basic/fixdep.c5
-rw-r--r--scripts/bin_size10
-rwxr-xr-xscripts/checksyscalls.sh92
-rwxr-xr-xscripts/config87
-rw-r--r--scripts/gcc-version.sh2
-rwxr-xr-xscripts/get_maintainer.pl234
-rw-r--r--scripts/gfp-translate81
-rwxr-xr-xscripts/headers.sh7
-rw-r--r--scripts/headers_check.pl14
-rw-r--r--scripts/kallsyms.c76
-rw-r--r--scripts/kconfig/.gitignore3
-rw-r--r--scripts/kconfig/Makefile4
-rw-r--r--scripts/kconfig/conf.c7
-rw-r--r--scripts/kconfig/confdata.c20
-rw-r--r--scripts/kconfig/lkc.h1
-rw-r--r--scripts/kconfig/lxdialog/checklist.c3
-rw-r--r--scripts/kconfig/mconf.c10
-rw-r--r--scripts/kconfig/qconf.cc48
-rw-r--r--scripts/kconfig/util.c6
-rwxr-xr-xscripts/kernel-doc215
-rw-r--r--scripts/mod/file2alias.c2
-rw-r--r--scripts/mod/modpost.c50
-rw-r--r--scripts/package/builddeb149
-rw-r--r--scripts/pnmtologo.c18
-rwxr-xr-xscripts/recordmcount.pl39
-rwxr-xr-xscripts/setlocalversion6
-rw-r--r--scripts/tracing/draw_functrace.py7
-rw-r--r--scripts/unifdef.c48
-rwxr-xr-xscripts/ver_linux2
32 files changed, 943 insertions, 363 deletions
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
index 095cfc8b9dbf..0fcd83838771 100644
--- a/scripts/Makefile.headersinst
+++ b/scripts/Makefile.headersinst
@@ -54,8 +54,12 @@ quiet_cmd_remove = REMOVE $(unwanted)
54 cmd_remove = rm -f $(unwanted-file) 54 cmd_remove = rm -f $(unwanted-file)
55 55
56quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files) 56quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files)
57 cmd_check = $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH) \ 57# Headers list can be pretty long, xargs helps to avoid
58 $(addprefix $(install)/, $(all-files)); \ 58# the "Argument list too long" error.
59 cmd_check = for f in $(all-files); do \
60 echo "$(install)/$${f}"; done \
61 | xargs \
62 $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH); \
59 touch $@ 63 touch $@
60 64
61PHONY += __headersinst __headerscheck 65PHONY += __headersinst __headerscheck
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index cba61ca403ca..7a7778746ea6 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -116,6 +116,17 @@ _a_flags = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(KBUILD_SUBDIR_ASFLAGS) \
116 $(asflags-y) $(AFLAGS_$(basetarget).o) 116 $(asflags-y) $(AFLAGS_$(basetarget).o)
117_cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F)) 117_cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F))
118 118
119#
120# Enable gcov profiling flags for a file, directory or for all files depending
121# on variables GCOV_PROFILE_obj.o, GCOV_PROFILE and CONFIG_GCOV_PROFILE_ALL
122# (in this order)
123#
124ifeq ($(CONFIG_GCOV_KERNEL),y)
125_c_flags += $(if $(patsubst n%,, \
126 $(GCOV_PROFILE_$(basetarget).o)$(GCOV_PROFILE)$(CONFIG_GCOV_PROFILE_ALL)), \
127 $(CFLAGS_GCOV))
128endif
129
119# If building the kernel in a separate objtree expand all occurrences 130# If building the kernel in a separate objtree expand all occurrences
120# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). 131# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/').
121 132
@@ -188,20 +199,34 @@ cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
188# --------------------------------------------------------------------------- 199# ---------------------------------------------------------------------------
189 200
190quiet_cmd_gzip = GZIP $@ 201quiet_cmd_gzip = GZIP $@
191cmd_gzip = gzip -f -9 < $< > $@ 202cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 > $@) || \
203 (rm -f $@ ; false)
192 204
193 205
194# Bzip2 206# Bzip2
195# --------------------------------------------------------------------------- 207# ---------------------------------------------------------------------------
196 208
197# Bzip2 does not include size in file... so we have to fake that 209# Bzip2 and LZMA do not include size in file... so we have to fake that;
198size_append=$(CONFIG_SHELL) $(srctree)/scripts/bin_size 210# append the size as a 32-bit littleendian number as gzip does.
199 211size_append = echo -ne $(shell \
200quiet_cmd_bzip2 = BZIP2 $@ 212dec_size=0; \
201cmd_bzip2 = (bzip2 -9 < $< && $(size_append) $<) > $@ || (rm -f $@ ; false) 213for F in $1; do \
214 fsize=$$(stat -c "%s" $$F); \
215 dec_size=$$(expr $$dec_size + $$fsize); \
216done; \
217printf "%08x" $$dec_size | \
218 sed 's/\(..\)\(..\)\(..\)\(..\)/\\\\x\4\\\\x\3\\\\x\2\\\\x\1/g' \
219)
220
221quiet_cmd_bzip2 = BZIP2 $@
222cmd_bzip2 = (cat $(filter-out FORCE,$^) | \
223 bzip2 -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
224 (rm -f $@ ; false)
202 225
203# Lzma 226# Lzma
204# --------------------------------------------------------------------------- 227# ---------------------------------------------------------------------------
205 228
206quiet_cmd_lzma = LZMA $@ 229quiet_cmd_lzma = LZMA $@
207cmd_lzma = (lzma -9 -c $< && $(size_append) $<) >$@ || (rm -f $@ ; false) 230cmd_lzma = (cat $(filter-out FORCE,$^) | \
231 lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
232 (rm -f $@ ; false)
diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c
index 35bdc68b6e66..99ca7a698687 100644
--- a/scripts/basic/docproc.c
+++ b/scripts/basic/docproc.c
@@ -69,7 +69,7 @@ FILELINE * docsection;
69#define NOFUNCTION "-nofunction" 69#define NOFUNCTION "-nofunction"
70#define NODOCSECTIONS "-no-doc-sections" 70#define NODOCSECTIONS "-no-doc-sections"
71 71
72char *srctree; 72static char *srctree, *kernsrctree;
73 73
74void usage (void) 74void usage (void)
75{ 75{
@@ -77,7 +77,8 @@ void usage (void)
77 fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n"); 77 fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n");
78 fprintf(stderr, "doc: frontend when generating kernel documentation\n"); 78 fprintf(stderr, "doc: frontend when generating kernel documentation\n");
79 fprintf(stderr, "depend: generate list of files referenced within file\n"); 79 fprintf(stderr, "depend: generate list of files referenced within file\n");
80 fprintf(stderr, "Environment variable SRCTREE: absolute path to kernel source tree.\n"); 80 fprintf(stderr, "Environment variable SRCTREE: absolute path to sources.\n");
81 fprintf(stderr, " KBUILD_SRC: absolute path to kernel source tree.\n");
81} 82}
82 83
83/* 84/*
@@ -96,8 +97,8 @@ void exec_kernel_doc(char **svec)
96 exit(1); 97 exit(1);
97 case 0: 98 case 0:
98 memset(real_filename, 0, sizeof(real_filename)); 99 memset(real_filename, 0, sizeof(real_filename));
99 strncat(real_filename, srctree, PATH_MAX); 100 strncat(real_filename, kernsrctree, PATH_MAX);
100 strncat(real_filename, KERNELDOCPATH KERNELDOC, 101 strncat(real_filename, "/" KERNELDOCPATH KERNELDOC,
101 PATH_MAX - strlen(real_filename)); 102 PATH_MAX - strlen(real_filename));
102 execvp(real_filename, svec); 103 execvp(real_filename, svec);
103 fprintf(stderr, "exec "); 104 fprintf(stderr, "exec ");
@@ -178,6 +179,7 @@ void find_export_symbols(char * filename)
178 char real_filename[PATH_MAX + 1]; 179 char real_filename[PATH_MAX + 1];
179 memset(real_filename, 0, sizeof(real_filename)); 180 memset(real_filename, 0, sizeof(real_filename));
180 strncat(real_filename, srctree, PATH_MAX); 181 strncat(real_filename, srctree, PATH_MAX);
182 strncat(real_filename, "/", PATH_MAX - strlen(real_filename));
181 strncat(real_filename, filename, 183 strncat(real_filename, filename,
182 PATH_MAX - strlen(real_filename)); 184 PATH_MAX - strlen(real_filename));
183 sym = add_new_file(filename); 185 sym = add_new_file(filename);
@@ -382,6 +384,9 @@ int main(int argc, char *argv[])
382 srctree = getenv("SRCTREE"); 384 srctree = getenv("SRCTREE");
383 if (!srctree) 385 if (!srctree)
384 srctree = getcwd(NULL, 0); 386 srctree = getcwd(NULL, 0);
387 kernsrctree = getenv("KBUILD_SRC");
388 if (!kernsrctree || !*kernsrctree)
389 kernsrctree = srctree;
385 if (argc != 3) { 390 if (argc != 3) {
386 usage(); 391 usage();
387 exit(1); 392 exit(1);
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index 8912c0f5460b..72c15205bb2b 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -373,10 +373,11 @@ void print_deps(void)
373void traps(void) 373void traps(void)
374{ 374{
375 static char test[] __attribute__((aligned(sizeof(int)))) = "CONF"; 375 static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
376 int *p = (int *)test;
376 377
377 if (*(int *)test != INT_CONF) { 378 if (*p != INT_CONF) {
378 fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", 379 fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n",
379 *(int *)test); 380 *p);
380 exit(2); 381 exit(2);
381 } 382 }
382} 383}
diff --git a/scripts/bin_size b/scripts/bin_size
deleted file mode 100644
index 43e1b360cee6..000000000000
--- a/scripts/bin_size
+++ /dev/null
@@ -1,10 +0,0 @@
1#!/bin/sh
2
3if [ $# = 0 ] ; then
4 echo Usage: $0 file
5fi
6
7size_dec=`stat -c "%s" $1`
8size_hex_echo_string=`printf "%08x" $size_dec |
9 sed 's/\(..\)\(..\)\(..\)\(..\)/\\\\x\4\\\\x\3\\\\x\2\\\\x\1/g'`
10/bin/echo -ne $size_hex_echo_string
diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh
index 60d00d1c4eee..66ad375612f2 100755
--- a/scripts/checksyscalls.sh
+++ b/scripts/checksyscalls.sh
@@ -14,6 +14,57 @@ cat << EOF
14#include <asm/types.h> 14#include <asm/types.h>
15#include <asm/unistd.h> 15#include <asm/unistd.h>
16 16
17/* *at */
18#define __IGNORE_open /* openat */
19#define __IGNORE_link /* linkat */
20#define __IGNORE_unlink /* unlinkat */
21#define __IGNORE_mknod /* mknodat */
22#define __IGNORE_chmod /* fchmodat */
23#define __IGNORE_chown /* fchownat */
24#define __IGNORE_mkdir /* mkdirat */
25#define __IGNORE_rmdir /* unlinkat */
26#define __IGNORE_lchown /* fchownat */
27#define __IGNORE_access /* faccessat */
28#define __IGNORE_rename /* renameat */
29#define __IGNORE_readlink /* readlinkat */
30#define __IGNORE_symlink /* symlinkat */
31#define __IGNORE_utimes /* futimesat */
32#if BITS_PER_LONG == 64
33#define __IGNORE_stat /* fstatat */
34#define __IGNORE_lstat /* fstatat */
35#else
36#define __IGNORE_stat64 /* fstatat64 */
37#define __IGNORE_lstat64 /* fstatat64 */
38#endif
39
40/* CLOEXEC flag */
41#define __IGNORE_pipe /* pipe2 */
42#define __IGNORE_dup2 /* dup3 */
43#define __IGNORE_epoll_create /* epoll_create1 */
44#define __IGNORE_inotify_init /* inotify_init1 */
45#define __IGNORE_eventfd /* eventfd2 */
46#define __IGNORE_signalfd /* signalfd4 */
47
48/* MMU */
49#ifndef CONFIG_MMU
50#define __IGNORE_madvise
51#define __IGNORE_mbind
52#define __IGNORE_mincore
53#define __IGNORE_mlock
54#define __IGNORE_mlockall
55#define __IGNORE_munlock
56#define __IGNORE_munlockall
57#define __IGNORE_mprotect
58#define __IGNORE_msync
59#define __IGNORE_migrate_pages
60#define __IGNORE_move_pages
61#define __IGNORE_remap_file_pages
62#define __IGNORE_get_mempolicy
63#define __IGNORE_set_mempolicy
64#define __IGNORE_swapoff
65#define __IGNORE_swapon
66#endif
67
17/* System calls for 32-bit kernels only */ 68/* System calls for 32-bit kernels only */
18#if BITS_PER_LONG == 64 69#if BITS_PER_LONG == 64
19#define __IGNORE_sendfile64 70#define __IGNORE_sendfile64
@@ -27,6 +78,22 @@ cat << EOF
27#define __IGNORE_fstatat64 78#define __IGNORE_fstatat64
28#define __IGNORE_fstatfs64 79#define __IGNORE_fstatfs64
29#define __IGNORE_statfs64 80#define __IGNORE_statfs64
81#define __IGNORE_llseek
82#define __IGNORE_mmap2
83#else
84#define __IGNORE_sendfile
85#define __IGNORE_ftruncate
86#define __IGNORE_truncate
87#define __IGNORE_stat
88#define __IGNORE_lstat
89#define __IGNORE_fstat
90#define __IGNORE_fcntl
91#define __IGNORE_fadvise64
92#define __IGNORE_newfstatat
93#define __IGNORE_fstatfs
94#define __IGNORE_statfs
95#define __IGNORE_lseek
96#define __IGNORE_mmap
30#endif 97#endif
31 98
32/* i386-specific or historical system calls */ 99/* i386-specific or historical system calls */
@@ -44,7 +111,6 @@ cat << EOF
44#define __IGNORE_idle 111#define __IGNORE_idle
45#define __IGNORE_modify_ldt 112#define __IGNORE_modify_ldt
46#define __IGNORE_ugetrlimit 113#define __IGNORE_ugetrlimit
47#define __IGNORE_mmap2
48#define __IGNORE_vm86 114#define __IGNORE_vm86
49#define __IGNORE_vm86old 115#define __IGNORE_vm86old
50#define __IGNORE_set_thread_area 116#define __IGNORE_set_thread_area
@@ -55,7 +121,6 @@ cat << EOF
55#define __IGNORE_oldlstat 121#define __IGNORE_oldlstat
56#define __IGNORE_oldolduname 122#define __IGNORE_oldolduname
57#define __IGNORE_olduname 123#define __IGNORE_olduname
58#define __IGNORE_umount2
59#define __IGNORE_umount 124#define __IGNORE_umount
60#define __IGNORE_waitpid 125#define __IGNORE_waitpid
61#define __IGNORE_stime 126#define __IGNORE_stime
@@ -75,9 +140,12 @@ cat << EOF
75#define __IGNORE__llseek 140#define __IGNORE__llseek
76#define __IGNORE__newselect 141#define __IGNORE__newselect
77#define __IGNORE_create_module 142#define __IGNORE_create_module
78#define __IGNORE_delete_module
79#define __IGNORE_query_module 143#define __IGNORE_query_module
80#define __IGNORE_get_kernel_syms 144#define __IGNORE_get_kernel_syms
145#define __IGNORE_sysfs
146#define __IGNORE_uselib
147#define __IGNORE__sysctl
148
81/* ... including the "new" 32-bit uid syscalls */ 149/* ... including the "new" 32-bit uid syscalls */
82#define __IGNORE_lchown32 150#define __IGNORE_lchown32
83#define __IGNORE_getuid32 151#define __IGNORE_getuid32
@@ -99,6 +167,24 @@ cat << EOF
99#define __IGNORE_setfsuid32 167#define __IGNORE_setfsuid32
100#define __IGNORE_setfsgid32 168#define __IGNORE_setfsgid32
101 169
170/* these can be expressed using other calls */
171#define __IGNORE_alarm /* setitimer */
172#define __IGNORE_creat /* open */
173#define __IGNORE_fork /* clone */
174#define __IGNORE_futimesat /* utimensat */
175#define __IGNORE_getpgrp /* getpgid */
176#define __IGNORE_getdents /* getdents64 */
177#define __IGNORE_pause /* sigsuspend */
178#define __IGNORE_poll /* ppoll */
179#define __IGNORE_select /* pselect6 */
180#define __IGNORE_epoll_wait /* epoll_pwait */
181#define __IGNORE_time /* gettimeofday */
182#define __IGNORE_uname /* newuname */
183#define __IGNORE_ustat /* statfs */
184#define __IGNORE_utime /* utimes */
185#define __IGNORE_vfork /* clone */
186#define __IGNORE_wait4 /* waitid */
187
102/* sync_file_range had a stupid ABI. Allow sync_file_range2 instead */ 188/* sync_file_range had a stupid ABI. Allow sync_file_range2 instead */
103#ifdef __NR_sync_file_range2 189#ifdef __NR_sync_file_range2
104#define __IGNORE_sync_file_range 190#define __IGNORE_sync_file_range
diff --git a/scripts/config b/scripts/config
index db6084b78a10..608d7fdb13e8 100755
--- a/scripts/config
+++ b/scripts/config
@@ -9,8 +9,10 @@ config options command ...
9commands: 9commands:
10 --enable|-e option Enable option 10 --enable|-e option Enable option
11 --disable|-d option Disable option 11 --disable|-d option Disable option
12 --module|-m option Turn option into a module 12 --module|-m option Turn option into a module
13 --state|-s option Print state of option (n,y,m,undef) 13 --set-str option value
14 Set option to "value"
15 --state|-s option Print state of option (n,y,m,undef)
14 16
15 --enable-after|-E beforeopt option 17 --enable-after|-E beforeopt option
16 Enable option directly after other option 18 Enable option directly after other option
@@ -26,8 +28,6 @@ options:
26 28
27config doesn't check the validity of the .config file. This is done at next 29config doesn't check the validity of the .config file. This is done at next
28 make time. 30 make time.
29The options need to be already in the file before they can be changed,
30but sometimes you can cheat with the --*-after options.
31EOL 31EOL
32 exit 1 32 exit 1
33} 33}
@@ -45,8 +45,18 @@ checkarg() {
45 ARG="`echo $ARG | tr a-z A-Z`" 45 ARG="`echo $ARG | tr a-z A-Z`"
46} 46}
47 47
48replace() { 48set_var() {
49 sed -i -e "$@" $FN 49 local name=$1 new=$2 before=$3
50
51 name_re="^($name=|# $name is not set)"
52 before_re="^($before=|# $before is not set)"
53 if test -n "$before" && grep -Eq "$before_re" "$FN"; then
54 sed -ri "/$before_re/a $new" "$FN"
55 elif grep -Eq "$name_re" "$FN"; then
56 sed -ri "s:$name_re.*:$new:" "$FN"
57 else
58 echo "$new" >>"$FN"
59 fi
50} 60}
51 61
52if [ "$1" = "--file" ]; then 62if [ "$1" = "--file" ]; then
@@ -54,8 +64,7 @@ if [ "$1" = "--file" ]; then
54 if [ "$FN" = "" ] ; then 64 if [ "$FN" = "" ] ; then
55 usage 65 usage
56 fi 66 fi
57 shift 67 shift 2
58 shift
59else 68else
60 FN=.config 69 FN=.config
61fi 70fi
@@ -68,27 +77,39 @@ while [ "$1" != "" ] ; do
68 CMD="$1" 77 CMD="$1"
69 shift 78 shift
70 case "$CMD" in 79 case "$CMD" in
71 --enable|-e) 80 --refresh)
81 ;;
82 --*-after)
83 checkarg "$1"
84 A=$ARG
85 checkarg "$2"
86 B=$ARG
87 shift 2
88 ;;
89 --*)
72 checkarg "$1" 90 checkarg "$1"
73 replace "s/# CONFIG_$ARG is not set/CONFIG_$ARG=y/"
74 shift 91 shift
75 ;; 92 ;;
93 esac
94 case "$CMD" in
95 --enable|-e)
96 set_var "CONFIG_$ARG" "CONFIG_$ARG=y"
97 ;;
76 98
77 --disable|-d) 99 --disable|-d)
78 checkarg "$1" 100 set_var "CONFIG_$ARG" "# CONFIG_$ARG is not set"
79 replace "s/CONFIG_$ARG=[my]/# CONFIG_$ARG is not set/"
80 shift
81 ;; 101 ;;
82 102
83 --module|-m) 103 --module|-m)
84 checkarg "$1" 104 set_var "CONFIG_$ARG" "CONFIG_$ARG=m"
85 replace "s/CONFIG_$ARG=y/CONFIG_$ARG=m/" \ 105 ;;
86 -e "s/# CONFIG_$ARG is not set/CONFIG_$ARG=m/" 106
107 --set-str)
108 set_var "CONFIG_$ARG" "CONFIG_$ARG=\"$1\""
87 shift 109 shift
88 ;; 110 ;;
89 111
90 --state|-s) 112 --state|-s)
91 checkarg "$1"
92 if grep -q "# CONFIG_$ARG is not set" $FN ; then 113 if grep -q "# CONFIG_$ARG is not set" $FN ; then
93 echo n 114 echo n
94 else 115 else
@@ -101,44 +122,18 @@ while [ "$1" != "" ] ; do
101 echo "$V" 122 echo "$V"
102 fi 123 fi
103 fi 124 fi
104 shift
105 ;; 125 ;;
106 126
107 --enable-after|-E) 127 --enable-after|-E)
108 checkarg "$1" 128 set_var "CONFIG_$B" "CONFIG_$B=y" "CONFIG_$A"
109 A=$ARG
110 checkarg "$2"
111 B=$ARG
112 replace "/CONFIG_$A=[my]/aCONFIG_$B=y" \
113 -e "/# CONFIG_$ARG is not set/a/CONFIG_$ARG=y" \
114 -e "s/# CONFIG_$ARG is not set/CONFIG_$ARG=y/"
115 shift
116 shift
117 ;; 129 ;;
118 130
119 --disable-after|-D) 131 --disable-after|-D)
120 checkarg "$1" 132 set_var "CONFIG_$B" "# CONFIG_$B is not set" "CONFIG_$A"
121 A=$ARG
122 checkarg "$2"
123 B=$ARG
124 replace "/CONFIG_$A=[my]/a# CONFIG_$B is not set" \
125 -e "/# CONFIG_$ARG is not set/a/# CONFIG_$ARG is not set" \
126 -e "s/CONFIG_$ARG=[my]/# CONFIG_$ARG is not set/"
127 shift
128 shift
129 ;; 133 ;;
130 134
131 --module-after|-M) 135 --module-after|-M)
132 checkarg "$1" 136 set_var "CONFIG_$B" "CONFIG_$B=m" "CONFIG_$A"
133 A=$ARG
134 checkarg "$2"
135 B=$ARG
136 replace "/CONFIG_$A=[my]/aCONFIG_$B=m" \
137 -e "/# CONFIG_$ARG is not set/a/CONFIG_$ARG=m" \
138 -e "s/CONFIG_$ARG=y/CONFIG_$ARG=m/" \
139 -e "s/# CONFIG_$ARG is not set/CONFIG_$ARG=m/"
140 shift
141 shift
142 ;; 137 ;;
143 138
144 # undocumented because it ignores --file (fixme) 139 # undocumented because it ignores --file (fixme)
diff --git a/scripts/gcc-version.sh b/scripts/gcc-version.sh
index cc767b388baf..debecb5561c4 100644
--- a/scripts/gcc-version.sh
+++ b/scripts/gcc-version.sh
@@ -18,7 +18,7 @@ compiler="$*"
18 18
19if [ ${#compiler} -eq 0 ]; then 19if [ ${#compiler} -eq 0 ]; then
20 echo "Error: No compiler specified." 20 echo "Error: No compiler specified."
21 echo -e "Usage:\n\t$0 <gcc-command>" 21 printf "Usage:\n\t$0 <gcc-command>\n"
22 exit 1 22 exit 1
23fi 23fi
24 24
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 60dc0c48c929..3e733146cd51 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -13,7 +13,7 @@
13use strict; 13use strict;
14 14
15my $P = $0; 15my $P = $0;
16my $V = '0.15'; 16my $V = '0.16';
17 17
18use Getopt::Long qw(:config no_auto_abbrev); 18use Getopt::Long qw(:config no_auto_abbrev);
19 19
@@ -55,6 +55,10 @@ foreach my $chief (@penguin_chief) {
55} 55}
56my $penguin_chiefs = "\(" . join("|",@penguin_chief_names) . "\)"; 56my $penguin_chiefs = "\(" . join("|",@penguin_chief_names) . "\)";
57 57
58# rfc822 email address - preloaded methods go here.
59my $rfc822_lwsp = "(?:(?:\\r\\n)?[ \\t])";
60my $rfc822_char = '[\\000-\\377]';
61
58if (!GetOptions( 62if (!GetOptions(
59 'email!' => \$email, 63 'email!' => \$email,
60 'git!' => \$email_git, 64 'git!' => \$email_git,
@@ -161,7 +165,7 @@ foreach my $file (@ARGV) {
161 } 165 }
162 close(PATCH); 166 close(PATCH);
163 if ($file_cnt == @files) { 167 if ($file_cnt == @files) {
164 die "$P: file '${file}' doesn't appear to be a patch. " 168 warn "$P: file '${file}' doesn't appear to be a patch. "
165 . "Add -f to options?\n"; 169 . "Add -f to options?\n";
166 } 170 }
167 @files = sort_and_uniq(@files); 171 @files = sort_and_uniq(@files);
@@ -169,6 +173,7 @@ foreach my $file (@ARGV) {
169} 173}
170 174
171my @email_to = (); 175my @email_to = ();
176my @list_to = ();
172my @scm = (); 177my @scm = ();
173my @web = (); 178my @web = ();
174my @subsystem = (); 179my @subsystem = ();
@@ -182,7 +187,7 @@ foreach my $file (@files) {
182 187
183 my $exclude = 0; 188 my $exclude = 0;
184 foreach my $line (@typevalue) { 189 foreach my $line (@typevalue) {
185 if ($line =~ m/^(\C):(.*)/) { 190 if ($line =~ m/^(\C):\s*(.*)/) {
186 my $type = $1; 191 my $type = $1;
187 my $value = $2; 192 my $value = $2;
188 if ($type eq 'X') { 193 if ($type eq 'X') {
@@ -196,7 +201,7 @@ foreach my $file (@files) {
196 if (!$exclude) { 201 if (!$exclude) {
197 my $tvi = 0; 202 my $tvi = 0;
198 foreach my $line (@typevalue) { 203 foreach my $line (@typevalue) {
199 if ($line =~ m/^(\C):(.*)/) { 204 if ($line =~ m/^(\C):\s*(.*)/) {
200 my $type = $1; 205 my $type = $1;
201 my $value = $2; 206 my $value = $2;
202 if ($type eq 'F') { 207 if ($type eq 'F') {
@@ -215,29 +220,33 @@ foreach my $file (@files) {
215 220
216} 221}
217 222
218if ($email_git_penguin_chiefs) { 223if ($email) {
219 foreach my $chief (@penguin_chief) { 224 foreach my $chief (@penguin_chief) {
220 if ($chief =~ m/^(.*):(.*)/) { 225 if ($chief =~ m/^(.*):(.*)/) {
221 my $chief_name = $1; 226 my $email_address;
222 my $chief_addr = $2;
223 if ($email_usename) { 227 if ($email_usename) {
224 push(@email_to, format_email($chief_name, $chief_addr)); 228 $email_address = format_email($1, $2);
229 } else {
230 $email_address = $2;
231 }
232 if ($email_git_penguin_chiefs) {
233 push(@email_to, $email_address);
225 } else { 234 } else {
226 push(@email_to, $chief_addr); 235 @email_to = grep(!/${email_address}/, @email_to);
227 } 236 }
228 } 237 }
229 } 238 }
230} 239}
231 240
232if ($email) { 241if ($email || $email_list) {
233 my $address_cnt = @email_to; 242 my @to = ();
234 if ($address_cnt == 0 && $email_list) { 243 if ($email) {
235 push(@email_to, "linux-kernel\@vger.kernel.org"); 244 @to = (@to, @email_to);
236 } 245 }
237 246 if ($email_list) {
238#Don't sort email address list, but do remove duplicates 247 @to = (@to, @list_to);
239 @email_to = uniq(@email_to); 248 }
240 output(@email_to); 249 output(uniq(@to));
241} 250}
242 251
243if ($scm) { 252if ($scm) {
@@ -307,10 +316,10 @@ Output type options:
307 --multiline => print 1 entry per line 316 --multiline => print 1 entry per line
308 317
309Default options: 318Default options:
310 [--email --git --m --l --multiline] 319 [--email --git --m --n --l --multiline]
311 320
312Other options: 321Other options:
313 --version -> show version 322 --version => show version
314 --help => show this help information 323 --help => show this help information
315 324
316EOT 325EOT
@@ -347,6 +356,7 @@ sub format_email {
347 my ($name, $email) = @_; 356 my ($name, $email) = @_;
348 357
349 $name =~ s/^\s+|\s+$//g; 358 $name =~ s/^\s+|\s+$//g;
359 $name =~ s/^\"|\"$//g;
350 $email =~ s/^\s+|\s+$//g; 360 $email =~ s/^\s+|\s+$//g;
351 361
352 my $formatted_email = ""; 362 my $formatted_email = "";
@@ -366,36 +376,41 @@ sub add_categories {
366 $index = $index - 1; 376 $index = $index - 1;
367 while ($index >= 0) { 377 while ($index >= 0) {
368 my $tv = $typevalue[$index]; 378 my $tv = $typevalue[$index];
369 if ($tv =~ m/^(\C):(.*)/) { 379 if ($tv =~ m/^(\C):\s*(.*)/) {
370 my $ptype = $1; 380 my $ptype = $1;
371 my $pvalue = $2; 381 my $pvalue = $2;
372 if ($ptype eq "L") { 382 if ($ptype eq "L") {
373 my $subscr = $pvalue; 383 my $list_address = $pvalue;
374 if ($subscr =~ m/\s*\(subscribers-only\)/) { 384 my $list_additional = "";
385 if ($list_address =~ m/([^\s]+)\s+(.*)$/) {
386 $list_address = $1;
387 $list_additional = $2;
388 }
389 if ($list_additional =~ m/subscribers-only/) {
375 if ($email_subscriber_list) { 390 if ($email_subscriber_list) {
376 $subscr =~ s/\s*\(subscribers-only\)//g; 391 push(@list_to, $list_address);
377 push(@email_to, $subscr);
378 } 392 }
379 } else { 393 } else {
380 if ($email_list) { 394 if ($email_list) {
381 push(@email_to, $pvalue); 395 push(@list_to, $list_address);
382 } 396 }
383 } 397 }
384 } elsif ($ptype eq "M") { 398 } elsif ($ptype eq "M") {
385 if ($email_maintainer) { 399 my $p_used = 0;
386 if ($index >= 0) { 400 if ($index >= 0) {
387 my $tv = $typevalue[$index - 1]; 401 my $tv = $typevalue[$index - 1];
388 if ($tv =~ m/^(\C):(.*)/) { 402 if ($tv =~ m/^(\C):\s*(.*)/) {
389 if ($1 eq "P" && $email_usename) { 403 if ($1 eq "P") {
390 push(@email_to, format_email($2, $pvalue)); 404 if ($email_usename) {
391 } else { 405 push_email_address(format_email($2, $pvalue));
392 push(@email_to, $pvalue); 406 $p_used = 1;
393 } 407 }
394 } 408 }
395 } else {
396 push(@email_to, $pvalue);
397 } 409 }
398 } 410 }
411 if (!$p_used) {
412 push_email_addresses($pvalue);
413 }
399 } elsif ($ptype eq "T") { 414 } elsif ($ptype eq "T") {
400 push(@scm, $pvalue); 415 push(@scm, $pvalue);
401 } elsif ($ptype eq "W") { 416 } elsif ($ptype eq "W") {
@@ -412,10 +427,45 @@ sub add_categories {
412 } 427 }
413} 428}
414 429
430sub push_email_address {
431 my ($email_address) = @_;
432
433 my $email_name = "";
434 if ($email_address =~ m/([^<]+)<(.*\@.*)>$/) {
435 $email_name = $1;
436 $email_address = $2;
437 }
438
439 if ($email_maintainer) {
440 if ($email_usename && $email_name) {
441 push(@email_to, format_email($email_name, $email_address));
442 } else {
443 push(@email_to, $email_address);
444 }
445 }
446}
447
448sub push_email_addresses {
449 my ($address) = @_;
450
451 my @address_list = ();
452
453 if (rfc822_valid($address)) {
454 push_email_address($address);
455 } elsif (@address_list = rfc822_validlist($address)) {
456 my $array_count = shift(@address_list);
457 while (my $entry = shift(@address_list)) {
458 push_email_address($entry);
459 }
460 } else {
461 warn("Invalid MAINTAINERS address: '" . $address . "'\n");
462 }
463}
464
415sub which { 465sub which {
416 my ($bin) = @_; 466 my ($bin) = @_;
417 467
418 foreach my $path (split /:/, $ENV{PATH}) { 468 foreach my $path (split(/:/, $ENV{PATH})) {
419 if (-e "$path/$bin") { 469 if (-e "$path/$bin") {
420 return "$path/$bin"; 470 return "$path/$bin";
421 } 471 }
@@ -434,16 +484,21 @@ sub recent_git_signoffs {
434 my @lines = (); 484 my @lines = ();
435 485
436 if (which("git") eq "") { 486 if (which("git") eq "") {
437 die("$P: git not found. Add --nogit to options?\n"); 487 warn("$P: git not found. Add --nogit to options?\n");
488 return;
489 }
490 if (!(-d ".git")) {
491 warn("$P: .git directory not found. Use a git repository for better results.\n");
492 warn("$P: perhaps 'git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git'\n");
493 return;
438 } 494 }
439 495
440 $cmd = "git log --since=${email_git_since} -- ${file}"; 496 $cmd = "git log --since=${email_git_since} -- ${file}";
441 $cmd .= " | grep -Pi \"^[-_ a-z]+by:.*\\\@\""; 497 $cmd .= " | grep -Ei \"^[-_ a-z]+by:.*\\\@.*\$\"";
442 if (!$email_git_penguin_chiefs) { 498 if (!$email_git_penguin_chiefs) {
443 $cmd .= " | grep -Pv \"${penguin_chiefs}\""; 499 $cmd .= " | grep -Ev \"${penguin_chiefs}\"";
444 } 500 }
445 $cmd .= " | cut -f2- -d\":\""; 501 $cmd .= " | cut -f2- -d\":\"";
446 $cmd .= " | sed -e \"s/^\\s+//g\"";
447 $cmd .= " | sort | uniq -c | sort -rn"; 502 $cmd .= " | sort | uniq -c | sort -rn";
448 503
449 $output = `${cmd}`; 504 $output = `${cmd}`;
@@ -465,10 +520,6 @@ sub recent_git_signoffs {
465 if ($line =~ m/(.+)<(.+)>/) { 520 if ($line =~ m/(.+)<(.+)>/) {
466 my $git_name = $1; 521 my $git_name = $1;
467 my $git_addr = $2; 522 my $git_addr = $2;
468 $git_name =~ tr/^\"//;
469 $git_name =~ tr/^\\s*//;
470 $git_name =~ tr/\"$//;
471 $git_name =~ tr/\\s*$//;
472 if ($email_usename) { 523 if ($email_usename) {
473 push(@email_to, format_email($git_name, $git_addr)); 524 push(@email_to, format_email($git_name, $git_addr));
474 } else { 525 } else {
@@ -481,7 +532,6 @@ sub recent_git_signoffs {
481 push(@email_to, $line); 532 push(@email_to, $line);
482 } 533 }
483 } 534 }
484 return $output;
485} 535}
486 536
487sub uniq { 537sub uniq {
@@ -513,3 +563,97 @@ sub output {
513 print("\n"); 563 print("\n");
514 } 564 }
515} 565}
566
567my $rfc822re;
568
569sub make_rfc822re {
570# Basic lexical tokens are specials, domain_literal, quoted_string, atom, and
571# comment. We must allow for rfc822_lwsp (or comments) after each of these.
572# This regexp will only work on addresses which have had comments stripped
573# and replaced with rfc822_lwsp.
574
575 my $specials = '()<>@,;:\\\\".\\[\\]';
576 my $controls = '\\000-\\037\\177';
577
578 my $dtext = "[^\\[\\]\\r\\\\]";
579 my $domain_literal = "\\[(?:$dtext|\\\\.)*\\]$rfc822_lwsp*";
580
581 my $quoted_string = "\"(?:[^\\\"\\r\\\\]|\\\\.|$rfc822_lwsp)*\"$rfc822_lwsp*";
582
583# Use zero-width assertion to spot the limit of an atom. A simple
584# $rfc822_lwsp* causes the regexp engine to hang occasionally.
585 my $atom = "[^$specials $controls]+(?:$rfc822_lwsp+|\\Z|(?=[\\[\"$specials]))";
586 my $word = "(?:$atom|$quoted_string)";
587 my $localpart = "$word(?:\\.$rfc822_lwsp*$word)*";
588
589 my $sub_domain = "(?:$atom|$domain_literal)";
590 my $domain = "$sub_domain(?:\\.$rfc822_lwsp*$sub_domain)*";
591
592 my $addr_spec = "$localpart\@$rfc822_lwsp*$domain";
593
594 my $phrase = "$word*";
595 my $route = "(?:\@$domain(?:,\@$rfc822_lwsp*$domain)*:$rfc822_lwsp*)";
596 my $route_addr = "\\<$rfc822_lwsp*$route?$addr_spec\\>$rfc822_lwsp*";
597 my $mailbox = "(?:$addr_spec|$phrase$route_addr)";
598
599 my $group = "$phrase:$rfc822_lwsp*(?:$mailbox(?:,\\s*$mailbox)*)?;\\s*";
600 my $address = "(?:$mailbox|$group)";
601
602 return "$rfc822_lwsp*$address";
603}
604
605sub rfc822_strip_comments {
606 my $s = shift;
607# Recursively remove comments, and replace with a single space. The simpler
608# regexps in the Email Addressing FAQ are imperfect - they will miss escaped
609# chars in atoms, for example.
610
611 while ($s =~ s/^((?:[^"\\]|\\.)*
612 (?:"(?:[^"\\]|\\.)*"(?:[^"\\]|\\.)*)*)
613 \((?:[^()\\]|\\.)*\)/$1 /osx) {}
614 return $s;
615}
616
617# valid: returns true if the parameter is an RFC822 valid address
618#
619sub rfc822_valid ($) {
620 my $s = rfc822_strip_comments(shift);
621
622 if (!$rfc822re) {
623 $rfc822re = make_rfc822re();
624 }
625
626 return $s =~ m/^$rfc822re$/so && $s =~ m/^$rfc822_char*$/;
627}
628
629# validlist: In scalar context, returns true if the parameter is an RFC822
630# valid list of addresses.
631#
632# In list context, returns an empty list on failure (an invalid
633# address was found); otherwise a list whose first element is the
634# number of addresses found and whose remaining elements are the
635# addresses. This is needed to disambiguate failure (invalid)
636# from success with no addresses found, because an empty string is
637# a valid list.
638
639sub rfc822_validlist ($) {
640 my $s = rfc822_strip_comments(shift);
641
642 if (!$rfc822re) {
643 $rfc822re = make_rfc822re();
644 }
645 # * null list items are valid according to the RFC
646 # * the '1' business is to aid in distinguishing failure from no results
647
648 my @r;
649 if ($s =~ m/^(?:$rfc822re)?(?:,(?:$rfc822re)?)*$/so &&
650 $s =~ m/^$rfc822_char*$/) {
651 while ($s =~ m/(?:^|,$rfc822_lwsp*)($rfc822re)/gos) {
652 push @r, $1;
653 }
654 return wantarray ? (scalar(@r), @r) : 1;
655 }
656 else {
657 return wantarray ? () : 0;
658 }
659}
diff --git a/scripts/gfp-translate b/scripts/gfp-translate
new file mode 100644
index 000000000000..073cb6d152a0
--- /dev/null
+++ b/scripts/gfp-translate
@@ -0,0 +1,81 @@
1#!/bin/bash
2# Translate the bits making up a GFP mask
3# (c) 2009, Mel Gorman <mel@csn.ul.ie>
4# Licensed under the terms of the GNU GPL License version 2
5SOURCE=
6GFPMASK=none
7
8# Helper function to report failures and exit
9die() {
10 echo ERROR: $@
11 if [ "$TMPFILE" != "" ]; then
12 rm -f $TMPFILE
13 fi
14 exit -1
15}
16
17usage() {
18 echo "usage: gfp-translate [-h] [ --source DIRECTORY ] gfpmask"
19 exit 0
20}
21
22# Parse command-line arguements
23while [ $# -gt 0 ]; do
24 case $1 in
25 --source)
26 SOURCE=$2
27 shift 2
28 ;;
29 -h)
30 usage
31 ;;
32 --help)
33 usage
34 ;;
35 *)
36 GFPMASK=$1
37 shift
38 ;;
39 esac
40done
41
42# Guess the kernel source directory if it's not set. Preference is in order of
43# o current directory
44# o /usr/src/linux
45if [ "$SOURCE" = "" ]; then
46 if [ -r "/usr/src/linux/Makefile" ]; then
47 SOURCE=/usr/src/linux
48 fi
49 if [ -r "`pwd`/Makefile" ]; then
50 SOURCE=`pwd`
51 fi
52fi
53
54# Confirm that a source directory exists
55if [ ! -r "$SOURCE/Makefile" ]; then
56 die "Could not locate kernel source directory or it is invalid"
57fi
58
59# Confirm that a GFP mask has been specified
60if [ "$GFPMASK" = "none" ]; then
61 usage
62fi
63
64# Extract GFP flags from the kernel source
65TMPFILE=`mktemp -t gfptranslate-XXXXXX` || exit 1
66grep "^#define __GFP" $SOURCE/include/linux/gfp.h | sed -e 's/(__force gfp_t)//' | sed -e 's/u)/)/' | grep -v GFP_BITS | sed -e 's/)\//) \//' > $TMPFILE
67
68# Parse the flags
69IFS="
70"
71echo Source: $SOURCE
72echo Parsing: $GFPMASK
73for LINE in `cat $TMPFILE`; do
74 MASK=`echo $LINE | awk '{print $3}'`
75 if [ $(($GFPMASK&$MASK)) -ne 0 ]; then
76 echo $LINE
77 fi
78done
79
80rm -f $TMPFILE
81exit 0
diff --git a/scripts/headers.sh b/scripts/headers.sh
index d33426f866db..0308ecc10d5b 100755
--- a/scripts/headers.sh
+++ b/scripts/headers.sh
@@ -15,19 +15,12 @@ do_command()
15 fi 15 fi
16} 16}
17 17
18# Do not try this architecture
19drop="generic um ppc sparc64 cris"
20
21archs=$(ls ${srctree}/arch) 18archs=$(ls ${srctree}/arch)
22 19
23for arch in ${archs}; do 20for arch in ${archs}; do
24 case ${arch} in 21 case ${arch} in
25 um) # no userspace export 22 um) # no userspace export
26 ;; 23 ;;
27 ppc) # headers exported by powerpc
28 ;;
29 sparc64) # headers exported by sparc
30 ;;
31 cris) # headers export are known broken 24 cris) # headers export are known broken
32 ;; 25 ;;
33 *) 26 *)
diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl
index 56f90a480899..db1dd7a549f2 100644
--- a/scripts/headers_check.pl
+++ b/scripts/headers_check.pl
@@ -2,7 +2,7 @@
2# 2#
3# headers_check.pl execute a number of trivial consistency checks 3# headers_check.pl execute a number of trivial consistency checks
4# 4#
5# Usage: headers_check.pl dir [files...] 5# Usage: headers_check.pl dir arch [files...]
6# dir: dir to look for included files 6# dir: dir to look for included files
7# arch: architecture 7# arch: architecture
8# files: list of files to check 8# files: list of files to check
@@ -37,7 +37,7 @@ foreach my $file (@files) {
37 &check_include(); 37 &check_include();
38 &check_asm_types(); 38 &check_asm_types();
39 &check_sizetypes(); 39 &check_sizetypes();
40 &check_prototypes(); 40 &check_declarations();
41 # Dropped for now. Too much noise &check_config(); 41 # Dropped for now. Too much noise &check_config();
42 } 42 }
43 close FH; 43 close FH;
@@ -61,16 +61,18 @@ sub check_include
61 } 61 }
62} 62}
63 63
64sub check_prototypes 64sub check_declarations
65{ 65{
66 if ($line =~ m/^\s*extern\b/) { 66 if ($line =~m/^\s*extern\b/) {
67 printf STDERR "$filename:$lineno: extern's make no sense in userspace\n"; 67 printf STDERR "$filename:$lineno: " .
68 "userspace cannot call function or variable " .
69 "defined in the kernel\n";
68 } 70 }
69} 71}
70 72
71sub check_config 73sub check_config
72{ 74{
73 if ($line =~ m/[^a-zA-Z0-9_]+CONFIG_([a-zA-Z0-9]+)[^a-zA-Z0-9]/) { 75 if ($line =~ m/[^a-zA-Z0-9_]+CONFIG_([a-zA-Z0-9_]+)[^a-zA-Z0-9_]/) {
74 printf STDERR "$filename:$lineno: leaks CONFIG_$1 to userspace where it is not valid\n"; 76 printf STDERR "$filename:$lineno: leaks CONFIG_$1 to userspace where it is not valid\n";
75 } 77 }
76} 78}
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 6654cbed965b..64343cc084b4 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -23,6 +23,10 @@
23#include <string.h> 23#include <string.h>
24#include <ctype.h> 24#include <ctype.h>
25 25
26#ifndef ARRAY_SIZE
27#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
28#endif
29
26#define KSYM_NAME_LEN 128 30#define KSYM_NAME_LEN 128
27 31
28struct sym_entry { 32struct sym_entry {
@@ -32,9 +36,23 @@ struct sym_entry {
32 unsigned char *sym; 36 unsigned char *sym;
33}; 37};
34 38
39struct text_range {
40 const char *stext, *etext;
41 unsigned long long start, end;
42};
43
44static unsigned long long _text;
45static 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
35static struct sym_entry *table; 54static struct sym_entry *table;
36static unsigned int table_size, table_cnt; 55static unsigned int table_size, table_cnt;
37static unsigned long long _text, _stext, _etext, _sinittext, _einittext;
38static int all_symbols = 0; 56static int all_symbols = 0;
39static char symbol_prefix_char = '\0'; 57static char symbol_prefix_char = '\0';
40 58
@@ -61,6 +79,26 @@ static inline int is_arm_mapping_symbol(const char *str)
61 && (str[2] == '\0' || str[2] == '.'); 79 && (str[2] == '\0' || str[2] == '.');
62} 80}
63 81
82static 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
64static int read_symbol(FILE *in, struct sym_entry *s) 102static int read_symbol(FILE *in, struct sym_entry *s)
65{ 103{
66 char str[500]; 104 char str[500];
@@ -84,14 +122,8 @@ static int read_symbol(FILE *in, struct sym_entry *s)
84 /* Ignore most absolute/undefined (?) symbols. */ 122 /* Ignore most absolute/undefined (?) symbols. */
85 if (strcmp(sym, "_text") == 0) 123 if (strcmp(sym, "_text") == 0)
86 _text = s->addr; 124 _text = s->addr;
87 else if (strcmp(sym, "_stext") == 0) 125 else if (read_symbol_tr(sym, s->addr) == 0)
88 _stext = s->addr; 126 /* nothing to do */;
89 else if (strcmp(sym, "_etext") == 0)
90 _etext = s->addr;
91 else if (strcmp(sym, "_sinittext") == 0)
92 _sinittext = s->addr;
93 else if (strcmp(sym, "_einittext") == 0)
94 _einittext = s->addr;
95 else if (toupper(stype) == 'A') 127 else if (toupper(stype) == 'A')
96 { 128 {
97 /* Keep these useful absolute symbols */ 129 /* Keep these useful absolute symbols */
@@ -127,6 +159,21 @@ static int read_symbol(FILE *in, struct sym_entry *s)
127 return 0; 159 return 0;
128} 160}
129 161
162static 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 1;
172 }
173
174 return 0;
175}
176
130static int symbol_valid(struct sym_entry *s) 177static int symbol_valid(struct sym_entry *s)
131{ 178{
132 /* Symbols which vary between passes. Passes 1 and 2 must have 179 /* Symbols which vary between passes. Passes 1 and 2 must have
@@ -156,8 +203,7 @@ static int symbol_valid(struct sym_entry *s)
156 /* if --all-symbols is not specified, then symbols outside the text 203 /* if --all-symbols is not specified, then symbols outside the text
157 * and inittext sections are discarded */ 204 * and inittext sections are discarded */
158 if (!all_symbols) { 205 if (!all_symbols) {
159 if ((s->addr < _stext || s->addr > _etext) 206 if (symbol_valid_tr(s) == 0)
160 && (s->addr < _sinittext || s->addr > _einittext))
161 return 0; 207 return 0;
162 /* Corner case. Discard any symbols with the same value as 208 /* Corner case. Discard any symbols with the same value as
163 * _etext _einittext; they can move between pass 1 and 2 when 209 * _etext _einittext; they can move between pass 1 and 2 when
@@ -165,10 +211,10 @@ static int symbol_valid(struct sym_entry *s)
165 * they may get dropped in pass 2, which breaks the kallsyms 211 * they may get dropped in pass 2, which breaks the kallsyms
166 * rules. 212 * rules.
167 */ 213 */
168 if ((s->addr == _etext && 214 if ((s->addr == text_range_text->end &&
169 strcmp((char *)s->sym + offset, "_etext")) || 215 strcmp((char *)s->sym + offset, text_range_text->etext)) ||
170 (s->addr == _einittext && 216 (s->addr == text_range_inittext->end &&
171 strcmp((char *)s->sym + offset, "_einittext"))) 217 strcmp((char *)s->sym + offset, text_range_inittext->etext)))
172 return 0; 218 return 0;
173 } 219 }
174 220
diff --git a/scripts/kconfig/.gitignore b/scripts/kconfig/.gitignore
index b49584c932cc..6a36a76e6606 100644
--- a/scripts/kconfig/.gitignore
+++ b/scripts/kconfig/.gitignore
@@ -8,6 +8,9 @@ lex.*.c
8zconf.hash.c 8zconf.hash.c
9*.moc 9*.moc
10lkc_defs.h 10lkc_defs.h
11gconf.glade.h
12*.pot
13*.mo
11 14
12# 15#
13# configuration programs 16# configuration programs
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index fa8c2dd9c983..5ddf8becd7a2 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -83,7 +83,7 @@ help:
83 @echo ' xconfig - Update current config utilising a QT based front-end' 83 @echo ' xconfig - Update current config utilising a QT based front-end'
84 @echo ' gconfig - Update current config utilising a GTK based front-end' 84 @echo ' gconfig - Update current config utilising a GTK based front-end'
85 @echo ' oldconfig - Update current config utilising a provided .config as base' 85 @echo ' oldconfig - Update current config utilising a provided .config as base'
86 @echo ' silentoldconfig - Same as oldconfig, but quietly' 86 @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps'
87 @echo ' randconfig - New config with random answer to all options' 87 @echo ' randconfig - New config with random answer to all options'
88 @echo ' defconfig - New config with default answer to all options' 88 @echo ' defconfig - New config with default answer to all options'
89 @echo ' allmodconfig - New config selecting modules when possible' 89 @echo ' allmodconfig - New config selecting modules when possible'
@@ -104,7 +104,7 @@ HOST_EXTRACFLAGS += -DLOCALE
104# =========================================================================== 104# ===========================================================================
105# Shared Makefile for the various kconfig executables: 105# Shared Makefile for the various kconfig executables:
106# conf: Used for defconfig, oldconfig and related targets 106# conf: Used for defconfig, oldconfig and related targets
107# mconf: Used for the mconfig target. 107# mconf: Used for the menuconfig target
108# Utilizes the lxdialog package 108# Utilizes the lxdialog package
109# qconf: Used for the xconfig target 109# qconf: Used for the xconfig target
110# Based on QT which needs to be installed to compile it 110# Based on QT which needs to be installed to compile it
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index d190092c3b6e..3baaaecd6b13 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -498,14 +498,15 @@ int main(int ac, char **av)
498 conf_parse(name); 498 conf_parse(name);
499 //zconfdump(stdout); 499 //zconfdump(stdout);
500 if (sync_kconfig) { 500 if (sync_kconfig) {
501 if (stat(".config", &tmpstat)) { 501 name = conf_get_configname();
502 if (stat(name, &tmpstat)) {
502 fprintf(stderr, _("***\n" 503 fprintf(stderr, _("***\n"
503 "*** You have not yet configured your kernel!\n" 504 "*** You have not yet configured your kernel!\n"
504 "*** (missing kernel .config file)\n" 505 "*** (missing kernel config file \"%s\")\n"
505 "***\n" 506 "***\n"
506 "*** Please run some configurator (e.g. \"make oldconfig\" or\n" 507 "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
507 "*** \"make menuconfig\" or \"make xconfig\").\n" 508 "*** \"make menuconfig\" or \"make xconfig\").\n"
508 "***\n")); 509 "***\n"), name);
509 exit(1); 510 exit(1);
510 } 511 }
511 } 512 }
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 273d73888f9d..a04da3459f0f 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -41,6 +41,13 @@ const char *conf_get_configname(void)
41 return name ? name : ".config"; 41 return name ? name : ".config";
42} 42}
43 43
44const char *conf_get_autoconfig_name(void)
45{
46 char *name = getenv("KCONFIG_AUTOCONFIG");
47
48 return name ? name : "include/config/auto.conf";
49}
50
44static char *conf_expand_value(const char *in) 51static char *conf_expand_value(const char *in)
45{ 52{
46 struct symbol *sym; 53 struct symbol *sym;
@@ -555,15 +562,14 @@ int conf_write(const char *name)
555 562
556int conf_split_config(void) 563int conf_split_config(void)
557{ 564{
558 char *name, path[128]; 565 const char *name;
566 char path[128];
559 char *s, *d, c; 567 char *s, *d, c;
560 struct symbol *sym; 568 struct symbol *sym;
561 struct stat sb; 569 struct stat sb;
562 int res, i, fd; 570 int res, i, fd;
563 571
564 name = getenv("KCONFIG_AUTOCONFIG"); 572 name = conf_get_autoconfig_name();
565 if (!name)
566 name = "include/config/auto.conf";
567 conf_read_simple(name, S_DEF_AUTO); 573 conf_read_simple(name, S_DEF_AUTO);
568 574
569 if (chdir("include/config")) 575 if (chdir("include/config"))
@@ -670,7 +676,7 @@ int conf_write_autoconf(void)
670{ 676{
671 struct symbol *sym; 677 struct symbol *sym;
672 const char *str; 678 const char *str;
673 char *name; 679 const char *name;
674 FILE *out, *out_h; 680 FILE *out, *out_h;
675 time_t now; 681 time_t now;
676 int i, l; 682 int i, l;
@@ -773,9 +779,7 @@ int conf_write_autoconf(void)
773 name = "include/linux/autoconf.h"; 779 name = "include/linux/autoconf.h";
774 if (rename(".tmpconfig.h", name)) 780 if (rename(".tmpconfig.h", name))
775 return 1; 781 return 1;
776 name = getenv("KCONFIG_AUTOCONFIG"); 782 name = conf_get_autoconfig_name();
777 if (!name)
778 name = "include/config/auto.conf";
779 /* 783 /*
780 * This must be the last step, kbuild has a dependency on auto.conf 784 * This must be the last step, kbuild has a dependency on auto.conf
781 * and this marks the successful completion of the previous steps. 785 * and this marks the successful completion of the previous steps.
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 4a9af6f7886b..f379b0bf8c9e 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -74,6 +74,7 @@ char *zconf_curname(void);
74 74
75/* confdata.c */ 75/* confdata.c */
76const char *conf_get_configname(void); 76const char *conf_get_configname(void);
77const char *conf_get_autoconfig_name(void);
77char *conf_get_default_confname(void); 78char *conf_get_default_confname(void);
78void sym_set_change_count(int count); 79void sym_set_change_count(int count);
79void sym_add_change_count(int count); 80void sym_add_change_count(int count);
diff --git a/scripts/kconfig/lxdialog/checklist.c b/scripts/kconfig/lxdialog/checklist.c
index b2a878c936d6..bcc6f19c3a35 100644
--- a/scripts/kconfig/lxdialog/checklist.c
+++ b/scripts/kconfig/lxdialog/checklist.c
@@ -41,7 +41,8 @@ static void print_item(WINDOW * win, int choice, int selected)
41 wmove(win, choice, check_x); 41 wmove(win, choice, check_x);
42 wattrset(win, selected ? dlg.check_selected.atr 42 wattrset(win, selected ? dlg.check_selected.atr
43 : dlg.check.atr); 43 : dlg.check.atr);
44 wprintw(win, "(%c)", item_is_tag('X') ? 'X' : ' '); 44 if (!item_is_tag(':'))
45 wprintw(win, "(%c)", item_is_tag('X') ? 'X' : ' ');
45 46
46 wattrset(win, selected ? dlg.tag_selected.atr : dlg.tag.atr); 47 wattrset(win, selected ? dlg.tag_selected.atr : dlg.tag.atr);
47 mvwaddch(win, choice, item_x, item_str()[0]); 48 mvwaddch(win, choice, item_x, item_str()[0]);
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 6841e95c0989..3bcacb4bfd3a 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -732,7 +732,12 @@ static void conf_choice(struct menu *menu)
732 for (child = menu->list; child; child = child->next) { 732 for (child = menu->list; child; child = child->next) {
733 if (!menu_is_visible(child)) 733 if (!menu_is_visible(child))
734 continue; 734 continue;
735 item_make("%s", _(menu_get_prompt(child))); 735 if (child->sym)
736 item_make("%s", _(menu_get_prompt(child)));
737 else {
738 item_make("*** %s ***", _(menu_get_prompt(child)));
739 item_set_tag(':');
740 }
736 item_set_data(child); 741 item_set_data(child);
737 if (child->sym == active) 742 if (child->sym == active)
738 item_set_selected(1); 743 item_set_selected(1);
@@ -748,6 +753,9 @@ static void conf_choice(struct menu *menu)
748 case 0: 753 case 0:
749 if (selected) { 754 if (selected) {
750 child = item_data(); 755 child = item_data();
756 if (!child->sym)
757 break;
758
751 sym_set_tristate_value(child->sym, yes); 759 sym_set_tristate_value(child->sym, yes);
752 } 760 }
753 return; 761 return;
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 5d0fd38b089b..ce7d508c7520 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -5,6 +5,7 @@
5 5
6#include <qapplication.h> 6#include <qapplication.h>
7#include <qmainwindow.h> 7#include <qmainwindow.h>
8#include <qdesktopwidget.h>
8#include <qtoolbar.h> 9#include <qtoolbar.h>
9#include <qlayout.h> 10#include <qlayout.h>
10#include <qvbox.h> 11#include <qvbox.h>
@@ -297,10 +298,10 @@ void ConfigLineEdit::show(ConfigItem* i)
297void ConfigLineEdit::keyPressEvent(QKeyEvent* e) 298void ConfigLineEdit::keyPressEvent(QKeyEvent* e)
298{ 299{
299 switch (e->key()) { 300 switch (e->key()) {
300 case Key_Escape: 301 case Qt::Key_Escape:
301 break; 302 break;
302 case Key_Return: 303 case Qt::Key_Return:
303 case Key_Enter: 304 case Qt::Key_Enter:
304 sym_set_string_value(item->menu->sym, text().latin1()); 305 sym_set_string_value(item->menu->sym, text().latin1());
305 parent()->updateList(item); 306 parent()->updateList(item);
306 break; 307 break;
@@ -639,7 +640,7 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
639 struct menu *menu; 640 struct menu *menu;
640 enum prop_type type; 641 enum prop_type type;
641 642
642 if (ev->key() == Key_Escape && mode != fullMode && mode != listMode) { 643 if (ev->key() == Qt::Key_Escape && mode != fullMode && mode != listMode) {
643 emit parentSelected(); 644 emit parentSelected();
644 ev->accept(); 645 ev->accept();
645 return; 646 return;
@@ -652,8 +653,8 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
652 item = (ConfigItem*)i; 653 item = (ConfigItem*)i;
653 654
654 switch (ev->key()) { 655 switch (ev->key()) {
655 case Key_Return: 656 case Qt::Key_Return:
656 case Key_Enter: 657 case Qt::Key_Enter:
657 if (item->goParent) { 658 if (item->goParent) {
658 emit parentSelected(); 659 emit parentSelected();
659 break; 660 break;
@@ -667,16 +668,16 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
667 emit menuSelected(menu); 668 emit menuSelected(menu);
668 break; 669 break;
669 } 670 }
670 case Key_Space: 671 case Qt::Key_Space:
671 changeValue(item); 672 changeValue(item);
672 break; 673 break;
673 case Key_N: 674 case Qt::Key_N:
674 setValue(item, no); 675 setValue(item, no);
675 break; 676 break;
676 case Key_M: 677 case Qt::Key_M:
677 setValue(item, mod); 678 setValue(item, mod);
678 break; 679 break;
679 case Key_Y: 680 case Qt::Key_Y:
680 setValue(item, yes); 681 setValue(item, yes);
681 break; 682 break;
682 default: 683 default:
@@ -920,7 +921,7 @@ void ConfigView::updateListAll(void)
920} 921}
921 922
922ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) 923ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
923 : Parent(parent, name), menu(0), sym(0) 924 : Parent(parent, name), sym(0), menu(0)
924{ 925{
925 if (name) { 926 if (name) {
926 configSettings->beginGroup(name); 927 configSettings->beginGroup(name);
@@ -1199,7 +1200,7 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam
1199 layout1->addLayout(layout2); 1200 layout1->addLayout(layout2);
1200 1201
1201 split = new QSplitter(this); 1202 split = new QSplitter(this);
1202 split->setOrientation(QSplitter::Vertical); 1203 split->setOrientation(Qt::Vertical);
1203 list = new ConfigView(split, name); 1204 list = new ConfigView(split, name);
1204 list->list->mode = listMode; 1205 list->list->mode = listMode;
1205 info = new ConfigInfoView(split, name); 1206 info = new ConfigInfoView(split, name);
@@ -1275,7 +1276,7 @@ ConfigMainWindow::ConfigMainWindow(void)
1275 int x, y, width, height; 1276 int x, y, width, height;
1276 char title[256]; 1277 char title[256];
1277 1278
1278 QWidget *d = configApp->desktop(); 1279 QDesktopWidget *d = configApp->desktop();
1279 snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration"), 1280 snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration"),
1280 getenv("KERNELVERSION")); 1281 getenv("KERNELVERSION"));
1281 setCaption(title); 1282 setCaption(title);
@@ -1290,14 +1291,14 @@ ConfigMainWindow::ConfigMainWindow(void)
1290 move(x, y); 1291 move(x, y);
1291 1292
1292 split1 = new QSplitter(this); 1293 split1 = new QSplitter(this);
1293 split1->setOrientation(QSplitter::Horizontal); 1294 split1->setOrientation(Qt::Horizontal);
1294 setCentralWidget(split1); 1295 setCentralWidget(split1);
1295 1296
1296 menuView = new ConfigView(split1, "menu"); 1297 menuView = new ConfigView(split1, "menu");
1297 menuList = menuView->list; 1298 menuList = menuView->list;
1298 1299
1299 split2 = new QSplitter(split1); 1300 split2 = new QSplitter(split1);
1300 split2->setOrientation(QSplitter::Vertical); 1301 split2->setOrientation(Qt::Vertical);
1301 1302
1302 // create config tree 1303 // create config tree
1303 configView = new ConfigView(split2, "config"); 1304 configView = new ConfigView(split2, "config");
@@ -1315,18 +1316,18 @@ ConfigMainWindow::ConfigMainWindow(void)
1315 backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this); 1316 backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this);
1316 connect(backAction, SIGNAL(activated()), SLOT(goBack())); 1317 connect(backAction, SIGNAL(activated()), SLOT(goBack()));
1317 backAction->setEnabled(FALSE); 1318 backAction->setEnabled(FALSE);
1318 QAction *quitAction = new QAction("Quit", _("&Quit"), CTRL+Key_Q, this); 1319 QAction *quitAction = new QAction("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this);
1319 connect(quitAction, SIGNAL(activated()), SLOT(close())); 1320 connect(quitAction, SIGNAL(activated()), SLOT(close()));
1320 QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), CTRL+Key_L, this); 1321 QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this);
1321 connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); 1322 connect(loadAction, SIGNAL(activated()), SLOT(loadConfig()));
1322 saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), CTRL+Key_S, this); 1323 saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this);
1323 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); 1324 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));
1324 conf_set_changed_callback(conf_changed); 1325 conf_set_changed_callback(conf_changed);
1325 // Set saveAction's initial state 1326 // Set saveAction's initial state
1326 conf_changed(); 1327 conf_changed();
1327 QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this); 1328 QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this);
1328 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); 1329 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs()));
1329 QAction *searchAction = new QAction("Find", _("&Find"), CTRL+Key_F, this); 1330 QAction *searchAction = new QAction("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this);
1330 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); 1331 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));
1331 QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this); 1332 QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this);
1332 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView())); 1333 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));
@@ -1447,7 +1448,7 @@ ConfigMainWindow::ConfigMainWindow(void)
1447 1448
1448void ConfigMainWindow::loadConfig(void) 1449void ConfigMainWindow::loadConfig(void)
1449{ 1450{
1450 QString s = QFileDialog::getOpenFileName(".config", NULL, this); 1451 QString s = QFileDialog::getOpenFileName(conf_get_configname(), NULL, this);
1451 if (s.isNull()) 1452 if (s.isNull())
1452 return; 1453 return;
1453 if (conf_read(QFile::encodeName(s))) 1454 if (conf_read(QFile::encodeName(s)))
@@ -1463,7 +1464,7 @@ void ConfigMainWindow::saveConfig(void)
1463 1464
1464void ConfigMainWindow::saveConfigAs(void) 1465void ConfigMainWindow::saveConfigAs(void)
1465{ 1466{
1466 QString s = QFileDialog::getSaveFileName(".config", NULL, this); 1467 QString s = QFileDialog::getSaveFileName(conf_get_configname(), NULL, this);
1467 if (s.isNull()) 1468 if (s.isNull())
1468 return; 1469 return;
1469 if (conf_write(QFile::encodeName(s))) 1470 if (conf_write(QFile::encodeName(s)))
@@ -1524,6 +1525,8 @@ void ConfigMainWindow::setMenuLink(struct menu *menu)
1524 case fullMode: 1525 case fullMode:
1525 list = configList; 1526 list = configList;
1526 break; 1527 break;
1528 default:
1529 break;
1527 } 1530 }
1528 1531
1529 if (list) { 1532 if (list) {
@@ -1673,6 +1676,9 @@ void ConfigMainWindow::saveSettings(void)
1673 case fullMode : 1676 case fullMode :
1674 entry = "full"; 1677 entry = "full";
1675 break; 1678 break;
1679
1680 default:
1681 break;
1676 } 1682 }
1677 configSettings->writeEntry("/listMode", entry); 1683 configSettings->writeEntry("/listMode", entry);
1678 1684
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index 3cc9f9369036..b6b2a46af14c 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -46,8 +46,8 @@ int file_write_dep(const char *name)
46 else 46 else
47 fprintf(out, "\t%s\n", file->name); 47 fprintf(out, "\t%s\n", file->name);
48 } 48 }
49 fprintf(out, "\ninclude/config/auto.conf: \\\n" 49 fprintf(out, "\n%s: \\\n"
50 "\t$(deps_config)\n\n"); 50 "\t$(deps_config)\n\n", conf_get_autoconfig_name());
51 51
52 expr_list_for_each_sym(sym_env_list, e, sym) { 52 expr_list_for_each_sym(sym_env_list, e, sym) {
53 struct property *prop; 53 struct property *prop;
@@ -61,7 +61,7 @@ int file_write_dep(const char *name)
61 if (!value) 61 if (!value)
62 value = ""; 62 value = "";
63 fprintf(out, "ifneq \"$(%s)\" \"%s\"\n", env_sym->name, value); 63 fprintf(out, "ifneq \"$(%s)\" \"%s\"\n", env_sym->name, value);
64 fprintf(out, "include/config/auto.conf: FORCE\n"); 64 fprintf(out, "%s: FORCE\n", conf_get_autoconfig_name());
65 fprintf(out, "endif\n"); 65 fprintf(out, "endif\n");
66 } 66 }
67 67
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 3208a3a7e7fe..ed591e9b7d1d 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -5,7 +5,7 @@ use strict;
5## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## 5## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
6## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ## 6## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ##
7## Copyright (C) 2001 Simon Huggins ## 7## Copyright (C) 2001 Simon Huggins ##
8## Copyright (C) 2005-2008 Randy Dunlap ## 8## Copyright (C) 2005-2009 Randy Dunlap ##
9## ## 9## ##
10## #define enhancements by Armin Kuster <akuster@mvista.com> ## 10## #define enhancements by Armin Kuster <akuster@mvista.com> ##
11## Copyright (c) 2000 MontaVista Software, Inc. ## 11## Copyright (c) 2000 MontaVista Software, Inc. ##
@@ -85,7 +85,7 @@ use strict;
85# 85#
86# /** 86# /**
87# * my_function 87# * my_function
88# **/ 88# */
89# 89#
90# If the Description: header tag is omitted, then there must be a blank line 90# If the Description: header tag is omitted, then there must be a blank line
91# after the last parameter specification. 91# after the last parameter specification.
@@ -105,7 +105,7 @@ use strict;
105# */ 105# */
106# etc. 106# etc.
107# 107#
108# Beside functions you can also write documentation for structs, unions, 108# Besides functions you can also write documentation for structs, unions,
109# enums and typedefs. Instead of the function name you must write the name 109# enums and typedefs. Instead of the function name you must write the name
110# of the declaration; the struct/union/enum/typedef must always precede 110# of the declaration; the struct/union/enum/typedef must always precede
111# the name. Nesting of declarations is not supported. 111# the name. Nesting of declarations is not supported.
@@ -223,7 +223,7 @@ sub usage {
223} 223}
224 224
225# read arguments 225# read arguments
226if ($#ARGV==-1) { 226if ($#ARGV == -1) {
227 usage(); 227 usage();
228} 228}
229 229
@@ -240,12 +240,12 @@ my $man_date = ('January', 'February', 'March', 'April', 'May', 'June',
240 " " . ((localtime)[5]+1900); 240 " " . ((localtime)[5]+1900);
241 241
242# Essentially these are globals 242# Essentially these are globals
243# They probably want to be tidied up made more localised or summat. 243# They probably want to be tidied up, made more localised or something.
244# CAVEAT EMPTOR! Some of the others I localised may not want to be which 244# CAVEAT EMPTOR! Some of the others I localised may not want to be, which
245# could cause "use of undefined value" or other bugs. 245# could cause "use of undefined value" or other bugs.
246my ($function, %function_table,%parametertypes,$declaration_purpose); 246my ($function, %function_table, %parametertypes, $declaration_purpose);
247my ($type,$declaration_name,$return_type); 247my ($type, $declaration_name, $return_type);
248my ($newsection,$newcontents,$prototype,$filelist, $brcount, %source_map); 248my ($newsection, $newcontents, $prototype, $filelist, $brcount, %source_map);
249 249
250if (defined($ENV{'KBUILD_VERBOSE'})) { 250if (defined($ENV{'KBUILD_VERBOSE'})) {
251 $verbose = "$ENV{'KBUILD_VERBOSE'}"; 251 $verbose = "$ENV{'KBUILD_VERBOSE'}";
@@ -279,10 +279,10 @@ my $doc_special = "\@\%\$\&";
279my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start. 279my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start.
280my $doc_end = '\*/'; 280my $doc_end = '\*/';
281my $doc_com = '\s*\*\s*'; 281my $doc_com = '\s*\*\s*';
282my $doc_decl = $doc_com.'(\w+)'; 282my $doc_decl = $doc_com . '(\w+)';
283my $doc_sect = $doc_com.'(['.$doc_special.']?[\w\s]+):(.*)'; 283my $doc_sect = $doc_com . '([' . $doc_special . ']?[\w\s]+):(.*)';
284my $doc_content = $doc_com.'(.*)'; 284my $doc_content = $doc_com . '(.*)';
285my $doc_block = $doc_com.'DOC:\s*(.*)?'; 285my $doc_block = $doc_com . 'DOC:\s*(.*)?';
286 286
287my %constants; 287my %constants;
288my %parameterdescs; 288my %parameterdescs;
@@ -485,12 +485,12 @@ sub output_enum_html(%) {
485 my %args = %{$_[0]}; 485 my %args = %{$_[0]};
486 my ($parameter); 486 my ($parameter);
487 my $count; 487 my $count;
488 print "<h2>enum ".$args{'enum'}."</h2>\n"; 488 print "<h2>enum " . $args{'enum'} . "</h2>\n";
489 489
490 print "<b>enum ".$args{'enum'}."</b> {<br>\n"; 490 print "<b>enum " . $args{'enum'} . "</b> {<br>\n";
491 $count = 0; 491 $count = 0;
492 foreach $parameter (@{$args{'parameterlist'}}) { 492 foreach $parameter (@{$args{'parameterlist'}}) {
493 print " <b>".$parameter."</b>"; 493 print " <b>" . $parameter . "</b>";
494 if ($count != $#{$args{'parameterlist'}}) { 494 if ($count != $#{$args{'parameterlist'}}) {
495 $count++; 495 $count++;
496 print ",\n"; 496 print ",\n";
@@ -502,7 +502,7 @@ sub output_enum_html(%) {
502 print "<h3>Constants</h3>\n"; 502 print "<h3>Constants</h3>\n";
503 print "<dl>\n"; 503 print "<dl>\n";
504 foreach $parameter (@{$args{'parameterlist'}}) { 504 foreach $parameter (@{$args{'parameterlist'}}) {
505 print "<dt><b>".$parameter."</b>\n"; 505 print "<dt><b>" . $parameter . "</b>\n";
506 print "<dd>"; 506 print "<dd>";
507 output_highlight($args{'parameterdescs'}{$parameter}); 507 output_highlight($args{'parameterdescs'}{$parameter});
508 } 508 }
@@ -516,9 +516,9 @@ sub output_typedef_html(%) {
516 my %args = %{$_[0]}; 516 my %args = %{$_[0]};
517 my ($parameter); 517 my ($parameter);
518 my $count; 518 my $count;
519 print "<h2>typedef ".$args{'typedef'}."</h2>\n"; 519 print "<h2>typedef " . $args{'typedef'} . "</h2>\n";
520 520
521 print "<b>typedef ".$args{'typedef'}."</b>\n"; 521 print "<b>typedef " . $args{'typedef'} . "</b>\n";
522 output_section_html(@_); 522 output_section_html(@_);
523 print "<hr>\n"; 523 print "<hr>\n";
524} 524}
@@ -528,8 +528,8 @@ sub output_struct_html(%) {
528 my %args = %{$_[0]}; 528 my %args = %{$_[0]};
529 my ($parameter); 529 my ($parameter);
530 530
531 print "<h2>".$args{'type'}." ".$args{'struct'}. " - " .$args{'purpose'}."</h2>\n"; 531 print "<h2>" . $args{'type'} . " " . $args{'struct'} . " - " . $args{'purpose'} . "</h2>\n";
532 print "<b>".$args{'type'}." ".$args{'struct'}."</b> {<br>\n"; 532 print "<b>" . $args{'type'} . " " . $args{'struct'} . "</b> {<br>\n";
533 foreach $parameter (@{$args{'parameterlist'}}) { 533 foreach $parameter (@{$args{'parameterlist'}}) {
534 if ($parameter =~ /^#/) { 534 if ($parameter =~ /^#/) {
535 print "$parameter<br>\n"; 535 print "$parameter<br>\n";
@@ -561,7 +561,7 @@ sub output_struct_html(%) {
561 $parameter_name =~ s/\[.*//; 561 $parameter_name =~ s/\[.*//;
562 562
563 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 563 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
564 print "<dt><b>".$parameter."</b>\n"; 564 print "<dt><b>" . $parameter . "</b>\n";
565 print "<dd>"; 565 print "<dd>";
566 output_highlight($args{'parameterdescs'}{$parameter_name}); 566 output_highlight($args{'parameterdescs'}{$parameter_name});
567 } 567 }
@@ -576,9 +576,9 @@ sub output_function_html(%) {
576 my ($parameter, $section); 576 my ($parameter, $section);
577 my $count; 577 my $count;
578 578
579 print "<h2>" .$args{'function'}." - ".$args{'purpose'}."</h2>\n"; 579 print "<h2>" . $args{'function'} . " - " . $args{'purpose'} . "</h2>\n";
580 print "<i>".$args{'functiontype'}."</i>\n"; 580 print "<i>" . $args{'functiontype'} . "</i>\n";
581 print "<b>".$args{'function'}."</b>\n"; 581 print "<b>" . $args{'function'} . "</b>\n";
582 print "("; 582 print "(";
583 $count = 0; 583 $count = 0;
584 foreach $parameter (@{$args{'parameterlist'}}) { 584 foreach $parameter (@{$args{'parameterlist'}}) {
@@ -587,7 +587,7 @@ sub output_function_html(%) {
587 # pointer-to-function 587 # pointer-to-function
588 print "<i>$1</i><b>$parameter</b>) <i>($2)</i>"; 588 print "<i>$1</i><b>$parameter</b>) <i>($2)</i>";
589 } else { 589 } else {
590 print "<i>".$type."</i> <b>".$parameter."</b>"; 590 print "<i>" . $type . "</i> <b>" . $parameter . "</b>";
591 } 591 }
592 if ($count != $#{$args{'parameterlist'}}) { 592 if ($count != $#{$args{'parameterlist'}}) {
593 $count++; 593 $count++;
@@ -603,7 +603,7 @@ sub output_function_html(%) {
603 $parameter_name =~ s/\[.*//; 603 $parameter_name =~ s/\[.*//;
604 604
605 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 605 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
606 print "<dt><b>".$parameter."</b>\n"; 606 print "<dt><b>" . $parameter . "</b>\n";
607 print "<dd>"; 607 print "<dd>";
608 output_highlight($args{'parameterdescs'}{$parameter_name}); 608 output_highlight($args{'parameterdescs'}{$parameter_name});
609 } 609 }
@@ -657,7 +657,7 @@ sub output_function_xml(%) {
657 my $count; 657 my $count;
658 my $id; 658 my $id;
659 659
660 $id = "API-".$args{'function'}; 660 $id = "API-" . $args{'function'};
661 $id =~ s/[^A-Za-z0-9]/-/g; 661 $id =~ s/[^A-Za-z0-9]/-/g;
662 662
663 print "<refentry id=\"$id\">\n"; 663 print "<refentry id=\"$id\">\n";
@@ -667,12 +667,12 @@ sub output_function_xml(%) {
667 print " <date>$man_date</date>\n"; 667 print " <date>$man_date</date>\n";
668 print "</refentryinfo>\n"; 668 print "</refentryinfo>\n";
669 print "<refmeta>\n"; 669 print "<refmeta>\n";
670 print " <refentrytitle><phrase>".$args{'function'}."</phrase></refentrytitle>\n"; 670 print " <refentrytitle><phrase>" . $args{'function'} . "</phrase></refentrytitle>\n";
671 print " <manvolnum>9</manvolnum>\n"; 671 print " <manvolnum>9</manvolnum>\n";
672 print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; 672 print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n";
673 print "</refmeta>\n"; 673 print "</refmeta>\n";
674 print "<refnamediv>\n"; 674 print "<refnamediv>\n";
675 print " <refname>".$args{'function'}."</refname>\n"; 675 print " <refname>" . $args{'function'} . "</refname>\n";
676 print " <refpurpose>\n"; 676 print " <refpurpose>\n";
677 print " "; 677 print " ";
678 output_highlight ($args{'purpose'}); 678 output_highlight ($args{'purpose'});
@@ -682,8 +682,8 @@ sub output_function_xml(%) {
682 print "<refsynopsisdiv>\n"; 682 print "<refsynopsisdiv>\n";
683 print " <title>Synopsis</title>\n"; 683 print " <title>Synopsis</title>\n";
684 print " <funcsynopsis><funcprototype>\n"; 684 print " <funcsynopsis><funcprototype>\n";
685 print " <funcdef>".$args{'functiontype'}." "; 685 print " <funcdef>" . $args{'functiontype'} . " ";
686 print "<function>".$args{'function'}." </function></funcdef>\n"; 686 print "<function>" . $args{'function'} . " </function></funcdef>\n";
687 687
688 $count = 0; 688 $count = 0;
689 if ($#{$args{'parameterlist'}} >= 0) { 689 if ($#{$args{'parameterlist'}} >= 0) {
@@ -694,7 +694,7 @@ sub output_function_xml(%) {
694 print " <paramdef>$1<parameter>$parameter</parameter>)\n"; 694 print " <paramdef>$1<parameter>$parameter</parameter>)\n";
695 print " <funcparams>$2</funcparams></paramdef>\n"; 695 print " <funcparams>$2</funcparams></paramdef>\n";
696 } else { 696 } else {
697 print " <paramdef>".$type; 697 print " <paramdef>" . $type;
698 print " <parameter>$parameter</parameter></paramdef>\n"; 698 print " <parameter>$parameter</parameter></paramdef>\n";
699 } 699 }
700 } 700 }
@@ -734,7 +734,7 @@ sub output_struct_xml(%) {
734 my ($parameter, $section); 734 my ($parameter, $section);
735 my $id; 735 my $id;
736 736
737 $id = "API-struct-".$args{'struct'}; 737 $id = "API-struct-" . $args{'struct'};
738 $id =~ s/[^A-Za-z0-9]/-/g; 738 $id =~ s/[^A-Za-z0-9]/-/g;
739 739
740 print "<refentry id=\"$id\">\n"; 740 print "<refentry id=\"$id\">\n";
@@ -744,12 +744,12 @@ sub output_struct_xml(%) {
744 print " <date>$man_date</date>\n"; 744 print " <date>$man_date</date>\n";
745 print "</refentryinfo>\n"; 745 print "</refentryinfo>\n";
746 print "<refmeta>\n"; 746 print "<refmeta>\n";
747 print " <refentrytitle><phrase>".$args{'type'}." ".$args{'struct'}."</phrase></refentrytitle>\n"; 747 print " <refentrytitle><phrase>" . $args{'type'} . " " . $args{'struct'} . "</phrase></refentrytitle>\n";
748 print " <manvolnum>9</manvolnum>\n"; 748 print " <manvolnum>9</manvolnum>\n";
749 print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; 749 print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n";
750 print "</refmeta>\n"; 750 print "</refmeta>\n";
751 print "<refnamediv>\n"; 751 print "<refnamediv>\n";
752 print " <refname>".$args{'type'}." ".$args{'struct'}."</refname>\n"; 752 print " <refname>" . $args{'type'} . " " . $args{'struct'} . "</refname>\n";
753 print " <refpurpose>\n"; 753 print " <refpurpose>\n";
754 print " "; 754 print " ";
755 output_highlight ($args{'purpose'}); 755 output_highlight ($args{'purpose'});
@@ -759,7 +759,7 @@ sub output_struct_xml(%) {
759 print "<refsynopsisdiv>\n"; 759 print "<refsynopsisdiv>\n";
760 print " <title>Synopsis</title>\n"; 760 print " <title>Synopsis</title>\n";
761 print " <programlisting>\n"; 761 print " <programlisting>\n";
762 print $args{'type'}." ".$args{'struct'}." {\n"; 762 print $args{'type'} . " " . $args{'struct'} . " {\n";
763 foreach $parameter (@{$args{'parameterlist'}}) { 763 foreach $parameter (@{$args{'parameterlist'}}) {
764 if ($parameter =~ /^#/) { 764 if ($parameter =~ /^#/) {
765 print "$parameter\n"; 765 print "$parameter\n";
@@ -779,7 +779,7 @@ sub output_struct_xml(%) {
779 # bitfield 779 # bitfield
780 print " $1 $parameter$2;\n"; 780 print " $1 $parameter$2;\n";
781 } else { 781 } else {
782 print " ".$type." ".$parameter.";\n"; 782 print " " . $type . " " . $parameter . ";\n";
783 } 783 }
784 } 784 }
785 print "};"; 785 print "};";
@@ -824,7 +824,7 @@ sub output_enum_xml(%) {
824 my $count; 824 my $count;
825 my $id; 825 my $id;
826 826
827 $id = "API-enum-".$args{'enum'}; 827 $id = "API-enum-" . $args{'enum'};
828 $id =~ s/[^A-Za-z0-9]/-/g; 828 $id =~ s/[^A-Za-z0-9]/-/g;
829 829
830 print "<refentry id=\"$id\">\n"; 830 print "<refentry id=\"$id\">\n";
@@ -834,12 +834,12 @@ sub output_enum_xml(%) {
834 print " <date>$man_date</date>\n"; 834 print " <date>$man_date</date>\n";
835 print "</refentryinfo>\n"; 835 print "</refentryinfo>\n";
836 print "<refmeta>\n"; 836 print "<refmeta>\n";
837 print " <refentrytitle><phrase>enum ".$args{'enum'}."</phrase></refentrytitle>\n"; 837 print " <refentrytitle><phrase>enum " . $args{'enum'} . "</phrase></refentrytitle>\n";
838 print " <manvolnum>9</manvolnum>\n"; 838 print " <manvolnum>9</manvolnum>\n";
839 print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; 839 print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n";
840 print "</refmeta>\n"; 840 print "</refmeta>\n";
841 print "<refnamediv>\n"; 841 print "<refnamediv>\n";
842 print " <refname>enum ".$args{'enum'}."</refname>\n"; 842 print " <refname>enum " . $args{'enum'} . "</refname>\n";
843 print " <refpurpose>\n"; 843 print " <refpurpose>\n";
844 print " "; 844 print " ";
845 output_highlight ($args{'purpose'}); 845 output_highlight ($args{'purpose'});
@@ -849,7 +849,7 @@ sub output_enum_xml(%) {
849 print "<refsynopsisdiv>\n"; 849 print "<refsynopsisdiv>\n";
850 print " <title>Synopsis</title>\n"; 850 print " <title>Synopsis</title>\n";
851 print " <programlisting>\n"; 851 print " <programlisting>\n";
852 print "enum ".$args{'enum'}." {\n"; 852 print "enum " . $args{'enum'} . " {\n";
853 $count = 0; 853 $count = 0;
854 foreach $parameter (@{$args{'parameterlist'}}) { 854 foreach $parameter (@{$args{'parameterlist'}}) {
855 print " $parameter"; 855 print " $parameter";
@@ -891,7 +891,7 @@ sub output_typedef_xml(%) {
891 my ($parameter, $section); 891 my ($parameter, $section);
892 my $id; 892 my $id;
893 893
894 $id = "API-typedef-".$args{'typedef'}; 894 $id = "API-typedef-" . $args{'typedef'};
895 $id =~ s/[^A-Za-z0-9]/-/g; 895 $id =~ s/[^A-Za-z0-9]/-/g;
896 896
897 print "<refentry id=\"$id\">\n"; 897 print "<refentry id=\"$id\">\n";
@@ -901,11 +901,11 @@ sub output_typedef_xml(%) {
901 print " <date>$man_date</date>\n"; 901 print " <date>$man_date</date>\n";
902 print "</refentryinfo>\n"; 902 print "</refentryinfo>\n";
903 print "<refmeta>\n"; 903 print "<refmeta>\n";
904 print " <refentrytitle><phrase>typedef ".$args{'typedef'}."</phrase></refentrytitle>\n"; 904 print " <refentrytitle><phrase>typedef " . $args{'typedef'} . "</phrase></refentrytitle>\n";
905 print " <manvolnum>9</manvolnum>\n"; 905 print " <manvolnum>9</manvolnum>\n";
906 print "</refmeta>\n"; 906 print "</refmeta>\n";
907 print "<refnamediv>\n"; 907 print "<refnamediv>\n";
908 print " <refname>typedef ".$args{'typedef'}."</refname>\n"; 908 print " <refname>typedef " . $args{'typedef'} . "</refname>\n";
909 print " <refpurpose>\n"; 909 print " <refpurpose>\n";
910 print " "; 910 print " ";
911 output_highlight ($args{'purpose'}); 911 output_highlight ($args{'purpose'});
@@ -914,7 +914,7 @@ sub output_typedef_xml(%) {
914 914
915 print "<refsynopsisdiv>\n"; 915 print "<refsynopsisdiv>\n";
916 print " <title>Synopsis</title>\n"; 916 print " <title>Synopsis</title>\n";
917 print " <synopsis>typedef ".$args{'typedef'}.";</synopsis>\n"; 917 print " <synopsis>typedef " . $args{'typedef'} . ";</synopsis>\n";
918 print "</refsynopsisdiv>\n"; 918 print "</refsynopsisdiv>\n";
919 919
920 output_section_xml(@_); 920 output_section_xml(@_);
@@ -963,15 +963,15 @@ sub output_function_gnome {
963 my $count; 963 my $count;
964 my $id; 964 my $id;
965 965
966 $id = $args{'module'}."-".$args{'function'}; 966 $id = $args{'module'} . "-" . $args{'function'};
967 $id =~ s/[^A-Za-z0-9]/-/g; 967 $id =~ s/[^A-Za-z0-9]/-/g;
968 968
969 print "<sect2>\n"; 969 print "<sect2>\n";
970 print " <title id=\"$id\">".$args{'function'}."</title>\n"; 970 print " <title id=\"$id\">" . $args{'function'} . "</title>\n";
971 971
972 print " <funcsynopsis>\n"; 972 print " <funcsynopsis>\n";
973 print " <funcdef>".$args{'functiontype'}." "; 973 print " <funcdef>" . $args{'functiontype'} . " ";
974 print "<function>".$args{'function'}." "; 974 print "<function>" . $args{'function'} . " ";
975 print "</function></funcdef>\n"; 975 print "</function></funcdef>\n";
976 976
977 $count = 0; 977 $count = 0;
@@ -983,7 +983,7 @@ sub output_function_gnome {
983 print " <paramdef>$1 <parameter>$parameter</parameter>)\n"; 983 print " <paramdef>$1 <parameter>$parameter</parameter>)\n";
984 print " <funcparams>$2</funcparams></paramdef>\n"; 984 print " <funcparams>$2</funcparams></paramdef>\n";
985 } else { 985 } else {
986 print " <paramdef>".$type; 986 print " <paramdef>" . $type;
987 print " <parameter>$parameter</parameter></paramdef>\n"; 987 print " <parameter>$parameter</parameter></paramdef>\n";
988 } 988 }
989 } 989 }
@@ -1043,13 +1043,13 @@ sub output_function_man(%) {
1043 print ".TH \"$args{'function'}\" 9 \"$args{'function'}\" \"$man_date\" \"Kernel Hacker's Manual\" LINUX\n"; 1043 print ".TH \"$args{'function'}\" 9 \"$args{'function'}\" \"$man_date\" \"Kernel Hacker's Manual\" LINUX\n";
1044 1044
1045 print ".SH NAME\n"; 1045 print ".SH NAME\n";
1046 print $args{'function'}." \\- ".$args{'purpose'}."\n"; 1046 print $args{'function'} . " \\- " . $args{'purpose'} . "\n";
1047 1047
1048 print ".SH SYNOPSIS\n"; 1048 print ".SH SYNOPSIS\n";
1049 if ($args{'functiontype'} ne "") { 1049 if ($args{'functiontype'} ne "") {
1050 print ".B \"".$args{'functiontype'}."\" ".$args{'function'}."\n"; 1050 print ".B \"" . $args{'functiontype'} . "\" " . $args{'function'} . "\n";
1051 } else { 1051 } else {
1052 print ".B \"".$args{'function'}."\n"; 1052 print ".B \"" . $args{'function'} . "\n";
1053 } 1053 }
1054 $count = 0; 1054 $count = 0;
1055 my $parenth = "("; 1055 my $parenth = "(";
@@ -1061,10 +1061,10 @@ sub output_function_man(%) {
1061 $type = $args{'parametertypes'}{$parameter}; 1061 $type = $args{'parametertypes'}{$parameter};
1062 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 1062 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
1063 # pointer-to-function 1063 # pointer-to-function
1064 print ".BI \"".$parenth.$1."\" ".$parameter." \") (".$2.")".$post."\"\n"; 1064 print ".BI \"" . $parenth . $1 . "\" " . $parameter . " \") (" . $2 . ")" . $post . "\"\n";
1065 } else { 1065 } else {
1066 $type =~ s/([^\*])$/$1 /; 1066 $type =~ s/([^\*])$/$1 /;
1067 print ".BI \"".$parenth.$type."\" ".$parameter." \"".$post."\"\n"; 1067 print ".BI \"" . $parenth . $type . "\" " . $parameter . " \"" . $post . "\"\n";
1068 } 1068 }
1069 $count++; 1069 $count++;
1070 $parenth = ""; 1070 $parenth = "";
@@ -1075,7 +1075,7 @@ sub output_function_man(%) {
1075 my $parameter_name = $parameter; 1075 my $parameter_name = $parameter;
1076 $parameter_name =~ s/\[.*//; 1076 $parameter_name =~ s/\[.*//;
1077 1077
1078 print ".IP \"".$parameter."\" 12\n"; 1078 print ".IP \"" . $parameter . "\" 12\n";
1079 output_highlight($args{'parameterdescs'}{$parameter_name}); 1079 output_highlight($args{'parameterdescs'}{$parameter_name});
1080 } 1080 }
1081 foreach $section (@{$args{'sectionlist'}}) { 1081 foreach $section (@{$args{'sectionlist'}}) {
@@ -1094,10 +1094,10 @@ sub output_enum_man(%) {
1094 print ".TH \"$args{'module'}\" 9 \"enum $args{'enum'}\" \"$man_date\" \"API Manual\" LINUX\n"; 1094 print ".TH \"$args{'module'}\" 9 \"enum $args{'enum'}\" \"$man_date\" \"API Manual\" LINUX\n";
1095 1095
1096 print ".SH NAME\n"; 1096 print ".SH NAME\n";
1097 print "enum ".$args{'enum'}." \\- ".$args{'purpose'}."\n"; 1097 print "enum " . $args{'enum'} . " \\- " . $args{'purpose'} . "\n";
1098 1098
1099 print ".SH SYNOPSIS\n"; 1099 print ".SH SYNOPSIS\n";
1100 print "enum ".$args{'enum'}." {\n"; 1100 print "enum " . $args{'enum'} . " {\n";
1101 $count = 0; 1101 $count = 0;
1102 foreach my $parameter (@{$args{'parameterlist'}}) { 1102 foreach my $parameter (@{$args{'parameterlist'}}) {
1103 print ".br\n.BI \" $parameter\"\n"; 1103 print ".br\n.BI \" $parameter\"\n";
@@ -1116,7 +1116,7 @@ sub output_enum_man(%) {
1116 my $parameter_name = $parameter; 1116 my $parameter_name = $parameter;
1117 $parameter_name =~ s/\[.*//; 1117 $parameter_name =~ s/\[.*//;
1118 1118
1119 print ".IP \"".$parameter."\" 12\n"; 1119 print ".IP \"" . $parameter . "\" 12\n";
1120 output_highlight($args{'parameterdescs'}{$parameter_name}); 1120 output_highlight($args{'parameterdescs'}{$parameter_name});
1121 } 1121 }
1122 foreach $section (@{$args{'sectionlist'}}) { 1122 foreach $section (@{$args{'sectionlist'}}) {
@@ -1131,13 +1131,13 @@ sub output_struct_man(%) {
1131 my %args = %{$_[0]}; 1131 my %args = %{$_[0]};
1132 my ($parameter, $section); 1132 my ($parameter, $section);
1133 1133
1134 print ".TH \"$args{'module'}\" 9 \"".$args{'type'}." ".$args{'struct'}."\" \"$man_date\" \"API Manual\" LINUX\n"; 1134 print ".TH \"$args{'module'}\" 9 \"" . $args{'type'} . " " . $args{'struct'} . "\" \"$man_date\" \"API Manual\" LINUX\n";
1135 1135
1136 print ".SH NAME\n"; 1136 print ".SH NAME\n";
1137 print $args{'type'}." ".$args{'struct'}." \\- ".$args{'purpose'}."\n"; 1137 print $args{'type'} . " " . $args{'struct'} . " \\- " . $args{'purpose'} . "\n";
1138 1138
1139 print ".SH SYNOPSIS\n"; 1139 print ".SH SYNOPSIS\n";
1140 print $args{'type'}." ".$args{'struct'}." {\n.br\n"; 1140 print $args{'type'} . " " . $args{'struct'} . " {\n.br\n";
1141 1141
1142 foreach my $parameter (@{$args{'parameterlist'}}) { 1142 foreach my $parameter (@{$args{'parameterlist'}}) {
1143 if ($parameter =~ /^#/) { 1143 if ($parameter =~ /^#/) {
@@ -1151,13 +1151,13 @@ sub output_struct_man(%) {
1151 $type = $args{'parametertypes'}{$parameter}; 1151 $type = $args{'parametertypes'}{$parameter};
1152 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 1152 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
1153 # pointer-to-function 1153 # pointer-to-function
1154 print ".BI \" ".$1."\" ".$parameter." \") (".$2.")"."\"\n;\n"; 1154 print ".BI \" " . $1 . "\" " . $parameter . " \") (" . $2 . ")" . "\"\n;\n";
1155 } elsif ($type =~ m/^(.*?)\s*(:.*)/) { 1155 } elsif ($type =~ m/^(.*?)\s*(:.*)/) {
1156 # bitfield 1156 # bitfield
1157 print ".BI \" ".$1."\ \" ".$parameter.$2." \""."\"\n;\n"; 1157 print ".BI \" " . $1 . "\ \" " . $parameter . $2 . " \"" . "\"\n;\n";
1158 } else { 1158 } else {
1159 $type =~ s/([^\*])$/$1 /; 1159 $type =~ s/([^\*])$/$1 /;
1160 print ".BI \" ".$type."\" ".$parameter." \""."\"\n;\n"; 1160 print ".BI \" " . $type . "\" " . $parameter . " \"" . "\"\n;\n";
1161 } 1161 }
1162 print "\n.br\n"; 1162 print "\n.br\n";
1163 } 1163 }
@@ -1171,7 +1171,7 @@ sub output_struct_man(%) {
1171 $parameter_name =~ s/\[.*//; 1171 $parameter_name =~ s/\[.*//;
1172 1172
1173 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 1173 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
1174 print ".IP \"".$parameter."\" 12\n"; 1174 print ".IP \"" . $parameter . "\" 12\n";
1175 output_highlight($args{'parameterdescs'}{$parameter_name}); 1175 output_highlight($args{'parameterdescs'}{$parameter_name});
1176 } 1176 }
1177 foreach $section (@{$args{'sectionlist'}}) { 1177 foreach $section (@{$args{'sectionlist'}}) {
@@ -1189,7 +1189,7 @@ sub output_typedef_man(%) {
1189 print ".TH \"$args{'module'}\" 9 \"$args{'typedef'}\" \"$man_date\" \"API Manual\" LINUX\n"; 1189 print ".TH \"$args{'module'}\" 9 \"$args{'typedef'}\" \"$man_date\" \"API Manual\" LINUX\n";
1190 1190
1191 print ".SH NAME\n"; 1191 print ".SH NAME\n";
1192 print "typedef ".$args{'typedef'}." \\- ".$args{'purpose'}."\n"; 1192 print "typedef " . $args{'typedef'} . " \\- " . $args{'purpose'} . "\n";
1193 1193
1194 foreach $section (@{$args{'sectionlist'}}) { 1194 foreach $section (@{$args{'sectionlist'}}) {
1195 print ".SH \"$section\"\n"; 1195 print ".SH \"$section\"\n";
@@ -1218,13 +1218,13 @@ sub output_function_text(%) {
1218 my $start; 1218 my $start;
1219 1219
1220 print "Name:\n\n"; 1220 print "Name:\n\n";
1221 print $args{'function'}." - ".$args{'purpose'}."\n"; 1221 print $args{'function'} . " - " . $args{'purpose'} . "\n";
1222 1222
1223 print "\nSynopsis:\n\n"; 1223 print "\nSynopsis:\n\n";
1224 if ($args{'functiontype'} ne "") { 1224 if ($args{'functiontype'} ne "") {
1225 $start = $args{'functiontype'}." ".$args{'function'}." ("; 1225 $start = $args{'functiontype'} . " " . $args{'function'} . " (";
1226 } else { 1226 } else {
1227 $start = $args{'function'}." ("; 1227 $start = $args{'function'} . " (";
1228 } 1228 }
1229 print $start; 1229 print $start;
1230 1230
@@ -1233,9 +1233,9 @@ sub output_function_text(%) {
1233 $type = $args{'parametertypes'}{$parameter}; 1233 $type = $args{'parametertypes'}{$parameter};
1234 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 1234 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
1235 # pointer-to-function 1235 # pointer-to-function
1236 print $1.$parameter.") (".$2; 1236 print $1 . $parameter . ") (" . $2;
1237 } else { 1237 } else {
1238 print $type." ".$parameter; 1238 print $type . " " . $parameter;
1239 } 1239 }
1240 if ($count != $#{$args{'parameterlist'}}) { 1240 if ($count != $#{$args{'parameterlist'}}) {
1241 $count++; 1241 $count++;
@@ -1251,7 +1251,7 @@ sub output_function_text(%) {
1251 my $parameter_name = $parameter; 1251 my $parameter_name = $parameter;
1252 $parameter_name =~ s/\[.*//; 1252 $parameter_name =~ s/\[.*//;
1253 1253
1254 print $parameter."\n\t".$args{'parameterdescs'}{$parameter_name}."\n"; 1254 print $parameter . "\n\t" . $args{'parameterdescs'}{$parameter_name} . "\n";
1255 } 1255 }
1256 output_section_text(@_); 1256 output_section_text(@_);
1257} 1257}
@@ -1276,8 +1276,8 @@ sub output_enum_text(%) {
1276 my $count; 1276 my $count;
1277 print "Enum:\n\n"; 1277 print "Enum:\n\n";
1278 1278
1279 print "enum ".$args{'enum'}." - ".$args{'purpose'}."\n\n"; 1279 print "enum " . $args{'enum'} . " - " . $args{'purpose'} . "\n\n";
1280 print "enum ".$args{'enum'}." {\n"; 1280 print "enum " . $args{'enum'} . " {\n";
1281 $count = 0; 1281 $count = 0;
1282 foreach $parameter (@{$args{'parameterlist'}}) { 1282 foreach $parameter (@{$args{'parameterlist'}}) {
1283 print "\t$parameter"; 1283 print "\t$parameter";
@@ -1292,7 +1292,7 @@ sub output_enum_text(%) {
1292 print "Constants:\n\n"; 1292 print "Constants:\n\n";
1293 foreach $parameter (@{$args{'parameterlist'}}) { 1293 foreach $parameter (@{$args{'parameterlist'}}) {
1294 print "$parameter\n\t"; 1294 print "$parameter\n\t";
1295 print $args{'parameterdescs'}{$parameter}."\n"; 1295 print $args{'parameterdescs'}{$parameter} . "\n";
1296 } 1296 }
1297 1297
1298 output_section_text(@_); 1298 output_section_text(@_);
@@ -1305,7 +1305,7 @@ sub output_typedef_text(%) {
1305 my $count; 1305 my $count;
1306 print "Typedef:\n\n"; 1306 print "Typedef:\n\n";
1307 1307
1308 print "typedef ".$args{'typedef'}." - ".$args{'purpose'}."\n"; 1308 print "typedef " . $args{'typedef'} . " - " . $args{'purpose'} . "\n";
1309 output_section_text(@_); 1309 output_section_text(@_);
1310} 1310}
1311 1311
@@ -1314,8 +1314,8 @@ sub output_struct_text(%) {
1314 my %args = %{$_[0]}; 1314 my %args = %{$_[0]};
1315 my ($parameter); 1315 my ($parameter);
1316 1316
1317 print $args{'type'}." ".$args{'struct'}." - ".$args{'purpose'}."\n\n"; 1317 print $args{'type'} . " " . $args{'struct'} . " - " . $args{'purpose'} . "\n\n";
1318 print $args{'type'}." ".$args{'struct'}." {\n"; 1318 print $args{'type'} . " " . $args{'struct'} . " {\n";
1319 foreach $parameter (@{$args{'parameterlist'}}) { 1319 foreach $parameter (@{$args{'parameterlist'}}) {
1320 if ($parameter =~ /^#/) { 1320 if ($parameter =~ /^#/) {
1321 print "$parameter\n"; 1321 print "$parameter\n";
@@ -1334,7 +1334,7 @@ sub output_struct_text(%) {
1334 # bitfield 1334 # bitfield
1335 print "\t$1 $parameter$2;\n"; 1335 print "\t$1 $parameter$2;\n";
1336 } else { 1336 } else {
1337 print "\t".$type." ".$parameter.";\n"; 1337 print "\t" . $type . " " . $parameter . ";\n";
1338 } 1338 }
1339 } 1339 }
1340 print "};\n\n"; 1340 print "};\n\n";
@@ -1348,7 +1348,7 @@ sub output_struct_text(%) {
1348 1348
1349 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 1349 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
1350 print "$parameter\n\t"; 1350 print "$parameter\n\t";
1351 print $args{'parameterdescs'}{$parameter_name}."\n"; 1351 print $args{'parameterdescs'}{$parameter_name} . "\n";
1352 } 1352 }
1353 print "\n"; 1353 print "\n";
1354 output_section_text(@_); 1354 output_section_text(@_);
@@ -1387,7 +1387,7 @@ sub output_declaration {
1387# generic output function - calls the right one based on current output mode. 1387# generic output function - calls the right one based on current output mode.
1388sub output_blockhead { 1388sub output_blockhead {
1389 no strict 'refs'; 1389 no strict 'refs';
1390 my $func = "output_blockhead_".$output_mode; 1390 my $func = "output_blockhead_" . $output_mode;
1391 &$func(@_); 1391 &$func(@_);
1392 $section_counter++; 1392 $section_counter++;
1393} 1393}
@@ -1398,7 +1398,7 @@ sub output_blockhead {
1398sub dump_declaration($$) { 1398sub dump_declaration($$) {
1399 no strict 'refs'; 1399 no strict 'refs';
1400 my ($prototype, $file) = @_; 1400 my ($prototype, $file) = @_;
1401 my $func = "dump_".$decl_type; 1401 my $func = "dump_" . $decl_type;
1402 &$func(@_); 1402 &$func(@_);
1403} 1403}
1404 1404
@@ -1468,6 +1468,8 @@ sub dump_enum($$) {
1468 } 1468 }
1469 1469
1470 } 1470 }
1471 # strip kmemcheck_bitfield_{begin,end}.*;
1472 $members =~ s/kmemcheck_bitfield_.*?;//gos;
1471 1473
1472 output_declaration($declaration_name, 1474 output_declaration($declaration_name,
1473 'enum', 1475 'enum',
@@ -1645,12 +1647,21 @@ sub push_parameter($$$) {
1645 "or member '$param' not " . 1647 "or member '$param' not " .
1646 "described in '$declaration_name'\n"; 1648 "described in '$declaration_name'\n";
1647 } 1649 }
1648 print STDERR "Warning(${file}:$.):". 1650 print STDERR "Warning(${file}:$.):" .
1649 " No description found for parameter '$param'\n"; 1651 " No description found for parameter '$param'\n";
1650 ++$warnings; 1652 ++$warnings;
1651 } 1653 }
1652 } 1654 }
1653 1655
1656 # strip spaces from $param so that it is one continous string
1657 # on @parameterlist;
1658 # this fixes a problem where check_sections() cannot find
1659 # a parameter like "addr[6 + 2]" because it actually appears
1660 # as "addr[6", "+", "2]" on the parameter list;
1661 # but it's better to maintain the param string unchanged for output,
1662 # so just weaken the string compare in check_sections() to ignore
1663 # "[blah" in a parameter string;
1664 ###$param =~ s/\s*//g;
1654 push @parameterlist, $param; 1665 push @parameterlist, $param;
1655 $parametertypes{$param} = $type; 1666 $parametertypes{$param} = $type;
1656} 1667}
@@ -1669,6 +1680,14 @@ sub check_sections($$$$$$) {
1669 $prm_clean = $prms[$px]; 1680 $prm_clean = $prms[$px];
1670 $prm_clean =~ s/\[.*\]//; 1681 $prm_clean =~ s/\[.*\]//;
1671 $prm_clean =~ s/__attribute__\s*\(\([a-z,_\*\s\(\)]*\)\)//; 1682 $prm_clean =~ s/__attribute__\s*\(\([a-z,_\*\s\(\)]*\)\)//;
1683 # ignore array size in a parameter string;
1684 # however, the original param string may contain
1685 # spaces, e.g.: addr[6 + 2]
1686 # and this appears in @prms as "addr[6" since the
1687 # parameter list is split at spaces;
1688 # hence just ignore "[..." for the sections check;
1689 $prm_clean =~ s/\[.*//;
1690
1672 ##$prm_clean =~ s/^\**//; 1691 ##$prm_clean =~ s/^\**//;
1673 if ($prm_clean eq $sects[$sx]) { 1692 if ($prm_clean eq $sects[$sx]) {
1674 $err = 0; 1693 $err = 0;
@@ -1828,6 +1847,25 @@ sub reset_state {
1828 $state = 0; 1847 $state = 0;
1829} 1848}
1830 1849
1850sub tracepoint_munge($) {
1851 my $file = shift;
1852 my $tracepointname = 0;
1853 my $tracepointargs = 0;
1854
1855 if($prototype =~ m/TRACE_EVENT\((.*?),/) {
1856 $tracepointname = $1;
1857 }
1858 if($prototype =~ m/TP_PROTO\((.*?)\)/) {
1859 $tracepointargs = $1;
1860 }
1861 if (($tracepointname eq 0) || ($tracepointargs eq 0)) {
1862 print STDERR "Warning(${file}:$.): Unrecognized tracepoint format: \n".
1863 "$prototype\n";
1864 } else {
1865 $prototype = "static inline void trace_$tracepointname($tracepointargs)";
1866 }
1867}
1868
1831sub syscall_munge() { 1869sub syscall_munge() {
1832 my $void = 0; 1870 my $void = 0;
1833 1871
@@ -1882,6 +1920,9 @@ sub process_state3_function($$) {
1882 if ($prototype =~ /SYSCALL_DEFINE/) { 1920 if ($prototype =~ /SYSCALL_DEFINE/) {
1883 syscall_munge(); 1921 syscall_munge();
1884 } 1922 }
1923 if ($prototype =~ /TRACE_EVENT/) {
1924 tracepoint_munge($file);
1925 }
1885 dump_function($prototype, $file); 1926 dump_function($prototype, $file);
1886 reset_state(); 1927 reset_state();
1887 } 1928 }
@@ -1907,7 +1948,7 @@ sub process_state3_type($$) {
1907 ($2 eq '{') && $brcount++; 1948 ($2 eq '{') && $brcount++;
1908 ($2 eq '}') && $brcount--; 1949 ($2 eq '}') && $brcount--;
1909 if (($2 eq ';') && ($brcount == 0)) { 1950 if (($2 eq ';') && ($brcount == 0)) {
1910 dump_declaration($prototype,$file); 1951 dump_declaration($prototype, $file);
1911 reset_state(); 1952 reset_state();
1912 last; 1953 last;
1913 } 1954 }
@@ -2084,7 +2125,7 @@ sub process_file($) {
2084 $section = $section_default; 2125 $section = $section_default;
2085 $contents = ""; 2126 $contents = "";
2086 } else { 2127 } else {
2087 $contents .= $1."\n"; 2128 $contents .= $1 . "\n";
2088 } 2129 }
2089 } else { 2130 } else {
2090 # i dont know - bad line? ignore. 2131 # i dont know - bad line? ignore.
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index a3344285ccf4..40e0045876ee 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -641,7 +641,7 @@ static int do_virtio_entry(const char *filename, struct virtio_device_id *id,
641 id->vendor = TO_NATIVE(id->vendor); 641 id->vendor = TO_NATIVE(id->vendor);
642 642
643 strcpy(alias, "virtio:"); 643 strcpy(alias, "virtio:");
644 ADD(alias, "d", 1, id->device); 644 ADD(alias, "d", id->device != VIRTIO_DEV_ANY_ID, id->device);
645 ADD(alias, "v", id->vendor != VIRTIO_DEV_ANY_ID, id->vendor); 645 ADD(alias, "v", id->vendor != VIRTIO_DEV_ANY_ID, id->vendor);
646 646
647 add_wildcard(alias); 647 add_wildcard(alias);
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 161b7846733e..4522948a012e 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -763,6 +763,8 @@ static void check_section(const char *modname, struct elf_info *elf,
763 763
764 764
765#define ALL_INIT_DATA_SECTIONS \ 765#define ALL_INIT_DATA_SECTIONS \
766 ".init.setup$", ".init.rodata$", \
767 ".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$" \
766 ".init.data$", ".devinit.data$", ".cpuinit.data$", ".meminit.data$" 768 ".init.data$", ".devinit.data$", ".cpuinit.data$", ".meminit.data$"
767#define ALL_EXIT_DATA_SECTIONS \ 769#define ALL_EXIT_DATA_SECTIONS \
768 ".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$" 770 ".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$"
@@ -772,21 +774,23 @@ static void check_section(const char *modname, struct elf_info *elf,
772#define ALL_EXIT_TEXT_SECTIONS \ 774#define ALL_EXIT_TEXT_SECTIONS \
773 ".exit.text$", ".devexit.text$", ".cpuexit.text$", ".memexit.text$" 775 ".exit.text$", ".devexit.text$", ".cpuexit.text$", ".memexit.text$"
774 776
775#define ALL_INIT_SECTIONS ALL_INIT_DATA_SECTIONS, ALL_INIT_TEXT_SECTIONS 777#define ALL_INIT_SECTIONS INIT_SECTIONS, DEV_INIT_SECTIONS, \
776#define ALL_EXIT_SECTIONS ALL_EXIT_DATA_SECTIONS, ALL_EXIT_TEXT_SECTIONS 778 CPU_INIT_SECTIONS, MEM_INIT_SECTIONS
779#define ALL_EXIT_SECTIONS EXIT_SECTIONS, DEV_EXIT_SECTIONS, \
780 CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS
777 781
778#define DATA_SECTIONS ".data$", ".data.rel$" 782#define DATA_SECTIONS ".data$", ".data.rel$"
779#define TEXT_SECTIONS ".text$" 783#define TEXT_SECTIONS ".text$"
780 784
781#define INIT_SECTIONS ".init.data$", ".init.text$" 785#define INIT_SECTIONS ".init.*"
782#define DEV_INIT_SECTIONS ".devinit.data$", ".devinit.text$" 786#define DEV_INIT_SECTIONS ".devinit.*"
783#define CPU_INIT_SECTIONS ".cpuinit.data$", ".cpuinit.text$" 787#define CPU_INIT_SECTIONS ".cpuinit.*"
784#define MEM_INIT_SECTIONS ".meminit.data$", ".meminit.text$" 788#define MEM_INIT_SECTIONS ".meminit.*"
785 789
786#define EXIT_SECTIONS ".exit.data$", ".exit.text$" 790#define EXIT_SECTIONS ".exit.*"
787#define DEV_EXIT_SECTIONS ".devexit.data$", ".devexit.text$" 791#define DEV_EXIT_SECTIONS ".devexit.*"
788#define CPU_EXIT_SECTIONS ".cpuexit.data$", ".cpuexit.text$" 792#define CPU_EXIT_SECTIONS ".cpuexit.*"
789#define MEM_EXIT_SECTIONS ".memexit.data$", ".memexit.text$" 793#define MEM_EXIT_SECTIONS ".memexit.*"
790 794
791/* init data sections */ 795/* init data sections */
792static const char *init_data_sections[] = { ALL_INIT_DATA_SECTIONS, NULL }; 796static const char *init_data_sections[] = { ALL_INIT_DATA_SECTIONS, NULL };
@@ -869,12 +873,36 @@ const struct sectioncheck sectioncheck[] = {
869 .tosec = { INIT_SECTIONS, NULL }, 873 .tosec = { INIT_SECTIONS, NULL },
870 .mismatch = XXXINIT_TO_INIT, 874 .mismatch = XXXINIT_TO_INIT,
871}, 875},
876/* Do not reference cpuinit code/data from meminit code/data */
877{
878 .fromsec = { MEM_INIT_SECTIONS, NULL },
879 .tosec = { CPU_INIT_SECTIONS, NULL },
880 .mismatch = XXXINIT_TO_INIT,
881},
882/* Do not reference meminit code/data from cpuinit code/data */
883{
884 .fromsec = { CPU_INIT_SECTIONS, NULL },
885 .tosec = { MEM_INIT_SECTIONS, NULL },
886 .mismatch = XXXINIT_TO_INIT,
887},
872/* Do not reference exit code/data from devexit/cpuexit/memexit code/data */ 888/* Do not reference exit code/data from devexit/cpuexit/memexit code/data */
873{ 889{
874 .fromsec = { DEV_EXIT_SECTIONS, CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS, NULL }, 890 .fromsec = { DEV_EXIT_SECTIONS, CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS, NULL },
875 .tosec = { EXIT_SECTIONS, NULL }, 891 .tosec = { EXIT_SECTIONS, NULL },
876 .mismatch = XXXEXIT_TO_EXIT, 892 .mismatch = XXXEXIT_TO_EXIT,
877}, 893},
894/* Do not reference cpuexit code/data from memexit code/data */
895{
896 .fromsec = { MEM_EXIT_SECTIONS, NULL },
897 .tosec = { CPU_EXIT_SECTIONS, NULL },
898 .mismatch = XXXEXIT_TO_EXIT,
899},
900/* Do not reference memexit code/data from cpuexit code/data */
901{
902 .fromsec = { CPU_EXIT_SECTIONS, NULL },
903 .tosec = { MEM_EXIT_SECTIONS, NULL },
904 .mismatch = XXXEXIT_TO_EXIT,
905},
878/* Do not use exit code/data from init code */ 906/* Do not use exit code/data from init code */
879{ 907{
880 .fromsec = { ALL_INIT_SECTIONS, NULL }, 908 .fromsec = { ALL_INIT_SECTIONS, NULL },
@@ -1168,7 +1196,7 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch,
1168 "The variable %s references\n" 1196 "The variable %s references\n"
1169 "the %s %s%s%s\n" 1197 "the %s %s%s%s\n"
1170 "If the reference is valid then annotate the\n" 1198 "If the reference is valid then annotate the\n"
1171 "variable with __init* (see linux/init.h) " 1199 "variable with __init* or __refdata (see linux/init.h) "
1172 "or name the variable:\n", 1200 "or name the variable:\n",
1173 fromsym, to, sec2annotation(tosec), tosym, to_p); 1201 fromsym, to, sec2annotation(tosec), tosym, to_p);
1174 while (*s) 1202 while (*s)
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 1264b8e2829d..01c2d13dd020 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -1,38 +1,58 @@
1#!/bin/sh 1#!/bin/sh
2# 2#
3# builddeb 1.2 3# builddeb 1.3
4# Copyright 2003 Wichert Akkerman <wichert@wiggy.net> 4# Copyright 2003 Wichert Akkerman <wichert@wiggy.net>
5# 5#
6# Simple script to generate a deb package for a Linux kernel. All the 6# Simple script to generate a deb package for a Linux kernel. All the
7# complexity of what to do with a kernel after it is installer or removed 7# complexity of what to do with a kernel after it is installed or removed
8# is left to other scripts and packages: they can install scripts in the 8# is left to other scripts and packages: they can install scripts in the
9# /etc/kernel/{pre,post}{inst,rm}.d/ directories that will be called on 9# /etc/kernel/{pre,post}{inst,rm}.d/ directories (or an alternative location
10# package install and removal. 10# specified in KDEB_HOOKDIR) that will be called on package install and
11# removal.
11 12
12set -e 13set -e
13 14
15create_package() {
16 local pname="$1" pdir="$2"
17
18 cp debian/copyright "$pdir/usr/share/doc/$pname/"
19
20 # Fix ownership and permissions
21 chown -R root:root "$pdir"
22 chmod -R go-w "$pdir"
23
24 # Create the package
25 dpkg-gencontrol -isp -p$pname -P"$pdir"
26 dpkg --build "$pdir" ..
27}
28
14# Some variables and settings used throughout the script 29# Some variables and settings used throughout the script
15version=$KERNELRELEASE 30version=$KERNELRELEASE
16revision=`cat .version` 31revision=$(cat .version)
32if [ -n "$KDEB_PKGVERSION" ]; then
33 packageversion=$KDEB_PKGVERSION
34else
35 packageversion=$version-$revision
36fi
17tmpdir="$objtree/debian/tmp" 37tmpdir="$objtree/debian/tmp"
18fwdir="$objtree/debian/fwtmp" 38fwdir="$objtree/debian/fwtmp"
19packagename=linux-$version 39packagename=linux-image-$version
20fwpackagename=linux-firmware-image 40fwpackagename=linux-firmware-image
21 41
22if [ "$ARCH" == "um" ] ; then 42if [ "$ARCH" = "um" ] ; then
23 packagename=user-mode-linux-$version 43 packagename=user-mode-linux-$version
24fi 44fi
25 45
26# Setup the directory structure 46# Setup the directory structure
27rm -rf "$tmpdir" "$fwdir" 47rm -rf "$tmpdir" "$fwdir"
28mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" 48mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" "$tmpdir/usr/share/doc/$packagename"
29mkdir -p "$fwdir/DEBIAN" "$fwdir/lib" 49mkdir -p "$fwdir/DEBIAN" "$fwdir/lib" "$fwdir/usr/share/doc/$fwpackagename"
30if [ "$ARCH" == "um" ] ; then 50if [ "$ARCH" = "um" ] ; then
31 mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/share/doc/$packagename" "$tmpdir/usr/bin" 51 mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/bin"
32fi 52fi
33 53
34# Build and install the kernel 54# Build and install the kernel
35if [ "$ARCH" == "um" ] ; then 55if [ "$ARCH" = "um" ] ; then
36 $MAKE linux 56 $MAKE linux
37 cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map" 57 cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map"
38 cp .config "$tmpdir/usr/share/doc/$packagename/config" 58 cp .config "$tmpdir/usr/share/doc/$packagename/config"
@@ -41,53 +61,100 @@ if [ "$ARCH" == "um" ] ; then
41else 61else
42 cp System.map "$tmpdir/boot/System.map-$version" 62 cp System.map "$tmpdir/boot/System.map-$version"
43 cp .config "$tmpdir/boot/config-$version" 63 cp .config "$tmpdir/boot/config-$version"
44 cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version" 64 # Not all arches include the boot path in KBUILD_IMAGE
65 if ! cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"; then
66 cp arch/$ARCH/boot/$KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"
67 fi
45fi 68fi
46 69
47if grep -q '^CONFIG_MODULES=y' .config ; then 70if grep -q '^CONFIG_MODULES=y' .config ; then
48 INSTALL_MOD_PATH="$tmpdir" make KBUILD_SRC= modules_install 71 INSTALL_MOD_PATH="$tmpdir" make KBUILD_SRC= modules_install
49 if [ "$ARCH" == "um" ] ; then 72 if [ "$ARCH" = "um" ] ; then
50 mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/" 73 mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/"
51 rmdir "$tmpdir/lib/modules/$version" 74 rmdir "$tmpdir/lib/modules/$version"
52 fi 75 fi
53fi 76fi
54 77
55# Install the maintainer scripts 78# Install the maintainer scripts
79# Note: hook scripts under /etc/kernel are also executed by official Debian
80# kernel packages, as well as kernel packages built using make-kpkg
81debhookdir=${KDEB_HOOKDIR:-/etc/kernel}
56for script in postinst postrm preinst prerm ; do 82for script in postinst postrm preinst prerm ; do
57 mkdir -p "$tmpdir/etc/kernel/$script.d" 83 mkdir -p "$tmpdir$debhookdir/$script.d"
58 cat <<EOF > "$tmpdir/DEBIAN/$script" 84 cat <<EOF > "$tmpdir/DEBIAN/$script"
59#!/bin/sh 85#!/bin/sh
60 86
61set -e 87set -e
62 88
63test -d /etc/kernel/$script.d && run-parts --arg="$version" /etc/kernel/$script.d 89# Pass maintainer script parameters to hook scripts
90export DEB_MAINT_PARAMS="\$@"
91
92test -d $debhookdir/$script.d && run-parts --arg="$version" $debhookdir/$script.d
64exit 0 93exit 0
65EOF 94EOF
66 chmod 755 "$tmpdir/DEBIAN/$script" 95 chmod 755 "$tmpdir/DEBIAN/$script"
67done 96done
68 97
69name="Kernel Compiler <$(id -nu)@$(hostname -f)>" 98# Try to determine maintainer and email values
99if [ -n "$DEBEMAIL" ]; then
100 email=$DEBEMAIL
101elif [ -n "$EMAIL" ]; then
102 email=$EMAIL
103else
104 email=$(id -nu)@$(hostname -f)
105fi
106if [ -n "$DEBFULLNAME" ]; then
107 name=$DEBFULLNAME
108elif [ -n "$NAME" ]; then
109 name=$NAME
110else
111 name="Anonymous"
112fi
113maintainer="$name <$email>"
114
70# Generate a simple changelog template 115# Generate a simple changelog template
71cat <<EOF > debian/changelog 116cat <<EOF > debian/changelog
72linux ($version-$revision) unstable; urgency=low 117linux-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)
77EOF 122EOF
78 123
79# Generate a control file 124# Generate copyright file
80if [ "$ARCH" == "um" ]; then 125cat <<EOF > debian/copyright
126This is a packacked upstream version of the Linux kernel.
127
128The sources may be found at most Linux ftp sites, including:
129ftp://ftp.kernel.org/pub/linux/kernel
81 130
131Copyright: 1991 - 2009 Linus Torvalds and others.
132
133The git repository for mainline kernel development is at:
134git://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
140On Debian GNU/Linux systems, the complete text of the GNU General Public
141License version 2 can be found in \`/usr/share/common-licenses/GPL-2'.
142EOF
143
144# Generate a control file
82cat <<EOF > debian/control 145cat <<EOF > debian/control
83Source: linux 146Source: linux-upstream
84Section: base 147Section: admin
85Priority: optional 148Priority: optional
86Maintainer: $name 149Maintainer: $maintainer
87Standards-Version: 3.6.1 150Standards-Version: 3.8.1
151EOF
152
153if [ "$ARCH" = "um" ]; then
154 cat <<EOF >> debian/control
88 155
89Package: $packagename 156Package: $packagename
90Provides: kernel-image-$version, linux-image-$version 157Provides: linux-image, linux-image-2.6, linux-modules-$version
91Architecture: any 158Architecture: any
92Description: User Mode Linux kernel, version $version 159Description: User Mode Linux kernel, version $version
93 User-mode Linux is a port of the Linux kernel to its own system call 160 User-mode Linux is a port of the Linux kernel to its own system call
@@ -97,30 +164,22 @@ Description: User Mode Linux kernel, version $version
97 many other things. 164 many other things.
98 . 165 .
99 This package contains the Linux kernel, modules and corresponding other 166 This package contains the Linux kernel, modules and corresponding other
100 files version $version 167 files, version: $version.
101EOF 168EOF
102 169
103else 170else
104cat <<EOF > debian/control 171 cat <<EOF >> debian/control
105Source: linux
106Section: base
107Priority: optional
108Maintainer: $name
109Standards-Version: 3.6.1
110 172
111Package: $packagename 173Package: $packagename
112Provides: kernel-image-$version, linux-image-$version 174Provides: linux-image, linux-image-2.6, linux-modules-$version
113Suggests: $fwpackagename 175Suggests: $fwpackagename
114Architecture: any 176Architecture: any
115Description: Linux kernel, version $version 177Description: Linux kernel, version $version
116 This package contains the Linux kernel, modules and corresponding other 178 This package contains the Linux kernel, modules and corresponding other
117 files version $version 179 files, version: $version.
118EOF 180EOF
119fi
120 181
121# Fix some ownership and permissions 182fi
122chown -R root:root "$tmpdir"
123chmod -R go-w "$tmpdir"
124 183
125# Do we have firmware? Move it out of the way and build it into a package. 184# Do we have firmware? Move it out of the way and build it into a package.
126if [ -e "$tmpdir/lib/firmware" ]; then 185if [ -e "$tmpdir/lib/firmware" ]; then
@@ -131,16 +190,12 @@ if [ -e "$tmpdir/lib/firmware" ]; then
131Package: $fwpackagename 190Package: $fwpackagename
132Architecture: all 191Architecture: all
133Description: Linux kernel firmware, version $version 192Description: 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.
135EOF 194EOF
136 195
137 dpkg-gencontrol -isp -p$fwpackagename -P"$fwdir" 196 create_package "$fwpackagename" "$fwdir"
138 dpkg --build "$fwdir" ..
139fi 197fi
140 198
141# Perform the final magic 199create_package "$packagename" "$tmpdir"
142dpkg-gencontrol -isp -p$packagename
143dpkg --build "$tmpdir" ..
144 200
145exit 0 201exit 0
146
diff --git a/scripts/pnmtologo.c b/scripts/pnmtologo.c
index 6aa2a2483f8d..64f5ddb09ea6 100644
--- a/scripts/pnmtologo.c
+++ b/scripts/pnmtologo.c
@@ -237,22 +237,22 @@ static void write_header(void)
237 fprintf(out, " * Linux logo %s\n", logoname); 237 fprintf(out, " * Linux logo %s\n", logoname);
238 fputs(" */\n\n", out); 238 fputs(" */\n\n", out);
239 fputs("#include <linux/linux_logo.h>\n\n", out); 239 fputs("#include <linux/linux_logo.h>\n\n", out);
240 fprintf(out, "static unsigned char %s_data[] __initdata = {\n", 240 fprintf(out, "static const unsigned char %s_data[] __initconst = {\n",
241 logoname); 241 logoname);
242} 242}
243 243
244static void write_footer(void) 244static void write_footer(void)
245{ 245{
246 fputs("\n};\n\n", out); 246 fputs("\n};\n\n", out);
247 fprintf(out, "struct linux_logo %s __initdata = {\n", logoname); 247 fprintf(out, "const struct linux_logo %s __initconst = {\n", logoname);
248 fprintf(out, " .type\t= %s,\n", logo_types[logo_type]); 248 fprintf(out, "\t.type\t\t= %s,\n", logo_types[logo_type]);
249 fprintf(out, " .width\t= %d,\n", logo_width); 249 fprintf(out, "\t.width\t\t= %d,\n", logo_width);
250 fprintf(out, " .height\t= %d,\n", logo_height); 250 fprintf(out, "\t.height\t\t= %d,\n", logo_height);
251 if (logo_type == LINUX_LOGO_CLUT224) { 251 if (logo_type == LINUX_LOGO_CLUT224) {
252 fprintf(out, " .clutsize\t= %d,\n", logo_clutsize); 252 fprintf(out, "\t.clutsize\t= %d,\n", logo_clutsize);
253 fprintf(out, " .clut\t= %s_clut,\n", logoname); 253 fprintf(out, "\t.clut\t\t= %s_clut,\n", logoname);
254 } 254 }
255 fprintf(out, " .data\t= %s_data\n", logoname); 255 fprintf(out, "\t.data\t\t= %s_data\n", logoname);
256 fputs("};\n\n", out); 256 fputs("};\n\n", out);
257 257
258 /* close logo file */ 258 /* close logo file */
@@ -374,7 +374,7 @@ static void write_logo_clut224(void)
374 fputs("\n};\n\n", out); 374 fputs("\n};\n\n", out);
375 375
376 /* write logo clut */ 376 /* write logo clut */
377 fprintf(out, "static unsigned char %s_clut[] __initdata = {\n", 377 fprintf(out, "static const unsigned char %s_clut[] __initconst = {\n",
378 logoname); 378 logoname);
379 write_hex_cnt = 0; 379 write_hex_cnt = 0;
380 for (i = 0; i < logo_clutsize; i++) { 380 for (i = 0; i < logo_clutsize; i++) {
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 409596eca124..7109e2b5bc0a 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -26,7 +26,7 @@
26# which will also be the location of that section after final link. 26# which will also be the location of that section after final link.
27# e.g. 27# e.g.
28# 28#
29# .section ".text.sched" 29# .section ".sched.text", "ax"
30# .globl my_func 30# .globl my_func
31# my_func: 31# my_func:
32# [...] 32# [...]
@@ -39,7 +39,7 @@
39# [...] 39# [...]
40# 40#
41# Both relocation offsets for the mcounts in the above example will be 41# Both relocation offsets for the mcounts in the above example will be
42# offset from .text.sched. If we make another file called tmp.s with: 42# offset from .sched.text. If we make another file called tmp.s with:
43# 43#
44# .section __mcount_loc 44# .section __mcount_loc
45# .quad my_func + 0x5 45# .quad my_func + 0x5
@@ -51,7 +51,7 @@
51# But this gets hard if my_func is not globl (a static function). 51# But this gets hard if my_func is not globl (a static function).
52# In such a case we have: 52# In such a case we have:
53# 53#
54# .section ".text.sched" 54# .section ".sched.text", "ax"
55# my_func: 55# my_func:
56# [...] 56# [...]
57# call mcount (offset: 0x5) 57# call mcount (offset: 0x5)
@@ -185,6 +185,19 @@ if ($arch eq "x86_64") {
185 $objcopy .= " -O elf32-i386"; 185 $objcopy .= " -O elf32-i386";
186 $cc .= " -m32"; 186 $cc .= " -m32";
187 187
188} elsif ($arch eq "s390" && $bits == 32) {
189 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_32\\s+_mcount\$";
190 $alignment = 4;
191 $ld .= " -m elf_s390";
192 $cc .= " -m31";
193
194} elsif ($arch eq "s390" && $bits == 64) {
195 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";
196 $alignment = 8;
197 $type = ".quad";
198 $ld .= " -m elf64_s390";
199 $cc .= " -m64";
200
188} elsif ($arch eq "sh") { 201} elsif ($arch eq "sh") {
189 $alignment = 2; 202 $alignment = 2;
190 203
@@ -213,6 +226,26 @@ if ($arch eq "x86_64") {
213 if ($is_module eq "0") { 226 if ($is_module eq "0") {
214 $cc .= " -mconstant-gp"; 227 $cc .= " -mconstant-gp";
215 } 228 }
229} elsif ($arch eq "sparc64") {
230 # In the objdump output there are giblets like:
231 # 0000000000000000 <igmp_net_exit-0x18>:
232 # As there's some data blobs that get emitted into the
233 # text section before the first instructions and the first
234 # real symbols. We don't want to match that, so to combat
235 # this we use '\w' so we'll match just plain symbol names,
236 # and not those that also include hex offsets inside of the
237 # '<>' brackets. Actually the generic function_regex setting
238 # could safely use this too.
239 $function_regex = "^([0-9a-fA-F]+)\\s+<(\\w*?)>:";
240
241 # Sparc64 calls '_mcount' instead of plain 'mcount'.
242 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$";
243
244 $alignment = 8;
245 $type = ".xword";
246 $ld .= " -m elf64_sparc";
247 $cc .= " -m64";
248 $objcopy .= " -O elf64-sparc";
216} else { 249} else {
217 die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD"; 250 die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD";
218} 251}
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 00790472f641..46989b88d734 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -39,8 +39,10 @@ if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
39 printf -- '-svn%s' "`git svn find-rev $head`" 39 printf -- '-svn%s' "`git svn find-rev $head`"
40 fi 40 fi
41 41
42 # Are there uncommitted changes? 42 # Update index only on r/w media
43 git update-index --refresh --unmerged > /dev/null 43 [ -w . ] && git update-index --refresh --unmerged > /dev/null
44
45 # Check for uncommitted changes
44 if git diff-index --name-only HEAD | grep -v "^scripts/package" \ 46 if git diff-index --name-only HEAD | grep -v "^scripts/package" \
45 | read dummy; then 47 | read dummy; then
46 printf '%s' -dirty 48 printf '%s' -dirty
diff --git a/scripts/tracing/draw_functrace.py b/scripts/tracing/draw_functrace.py
index 902f9a992620..db40fa04cd51 100644
--- a/scripts/tracing/draw_functrace.py
+++ b/scripts/tracing/draw_functrace.py
@@ -12,10 +12,9 @@ calls. Only the functions's names and the the call time are provided.
12 12
13Usage: 13Usage:
14 Be sure that you have CONFIG_FUNCTION_TRACER 14 Be sure that you have CONFIG_FUNCTION_TRACER
15 # mkdir /debugfs 15 # mount -t debugfs nodev /sys/kernel/debug
16 # mount -t debug debug /debug 16 # echo function > /sys/kernel/debug/tracing/current_tracer
17 # echo function > /debug/tracing/current_tracer 17 $ cat /sys/kernel/debug/tracing/trace_pipe > ~/raw_trace_func
18 $ cat /debug/tracing/trace_pipe > ~/raw_trace_func
19 Wait some times but not too much, the script is a bit slow. 18 Wait some times but not too much, the script is a bit slow.
20 Break the pipe (Ctrl + Z) 19 Break the pipe (Ctrl + Z)
21 $ scripts/draw_functrace.py < raw_trace_func > draw_functrace 20 $ scripts/draw_functrace.py < raw_trace_func > draw_functrace
diff --git a/scripts/unifdef.c b/scripts/unifdef.c
index 05a31a6c7e1b..30d459fb0709 100644
--- a/scripts/unifdef.c
+++ b/scripts/unifdef.c
@@ -678,8 +678,10 @@ eval_unary(const struct ops *ops, int *valp, const char **cpp)
678 if (*cp == '!') { 678 if (*cp == '!') {
679 debug("eval%d !", ops - eval_ops); 679 debug("eval%d !", ops - eval_ops);
680 cp++; 680 cp++;
681 if (eval_unary(ops, valp, &cp) == LT_IF) 681 if (eval_unary(ops, valp, &cp) == LT_IF) {
682 *cpp = cp;
682 return (LT_IF); 683 return (LT_IF);
684 }
683 *valp = !*valp; 685 *valp = !*valp;
684 } else if (*cp == '(') { 686 } else if (*cp == '(') {
685 cp++; 687 cp++;
@@ -700,13 +702,16 @@ eval_unary(const struct ops *ops, int *valp, const char **cpp)
700 return (LT_IF); 702 return (LT_IF);
701 cp = skipcomment(cp); 703 cp = skipcomment(cp);
702 sym = findsym(cp); 704 sym = findsym(cp);
703 if (sym < 0)
704 return (LT_IF);
705 *valp = (value[sym] != NULL);
706 cp = skipsym(cp); 705 cp = skipsym(cp);
707 cp = skipcomment(cp); 706 cp = skipcomment(cp);
708 if (*cp++ != ')') 707 if (*cp++ != ')')
709 return (LT_IF); 708 return (LT_IF);
709 if (sym >= 0)
710 *valp = (value[sym] != NULL);
711 else {
712 *cpp = cp;
713 return (LT_IF);
714 }
710 keepthis = false; 715 keepthis = false;
711 } else if (!endsym(*cp)) { 716 } else if (!endsym(*cp)) {
712 debug("eval%d symbol", ops - eval_ops); 717 debug("eval%d symbol", ops - eval_ops);
@@ -741,11 +746,11 @@ eval_table(const struct ops *ops, int *valp, const char **cpp)
741 const struct op *op; 746 const struct op *op;
742 const char *cp; 747 const char *cp;
743 int val; 748 int val;
749 Linetype lhs, rhs;
744 750
745 debug("eval%d", ops - eval_ops); 751 debug("eval%d", ops - eval_ops);
746 cp = *cpp; 752 cp = *cpp;
747 if (ops->inner(ops+1, valp, &cp) == LT_IF) 753 lhs = ops->inner(ops+1, valp, &cp);
748 return (LT_IF);
749 for (;;) { 754 for (;;) {
750 cp = skipcomment(cp); 755 cp = skipcomment(cp);
751 for (op = ops->op; op->str != NULL; op++) 756 for (op = ops->op; op->str != NULL; op++)
@@ -755,14 +760,32 @@ eval_table(const struct ops *ops, int *valp, const char **cpp)
755 break; 760 break;
756 cp += strlen(op->str); 761 cp += strlen(op->str);
757 debug("eval%d %s", ops - eval_ops, op->str); 762 debug("eval%d %s", ops - eval_ops, op->str);
758 if (ops->inner(ops+1, &val, &cp) == LT_IF) 763 rhs = ops->inner(ops+1, &val, &cp);
759 return (LT_IF); 764 if (op->fn == op_and && (lhs == LT_FALSE || rhs == LT_FALSE)) {
760 *valp = op->fn(*valp, val); 765 debug("eval%d: and always false", ops - eval_ops);
766 if (lhs == LT_IF)
767 *valp = val;
768 lhs = LT_FALSE;
769 continue;
770 }
771 if (op->fn == op_or && (lhs == LT_TRUE || rhs == LT_TRUE)) {
772 debug("eval%d: or always true", ops - eval_ops);
773 if (lhs == LT_IF)
774 *valp = val;
775 lhs = LT_TRUE;
776 continue;
777 }
778 if (rhs == LT_IF)
779 lhs = LT_IF;
780 if (lhs != LT_IF)
781 *valp = op->fn(*valp, val);
761 } 782 }
762 783
763 *cpp = cp; 784 *cpp = cp;
764 debug("eval%d = %d", ops - eval_ops, *valp); 785 debug("eval%d = %d", ops - eval_ops, *valp);
765 return (*valp ? LT_TRUE : LT_FALSE); 786 if (lhs != LT_IF)
787 lhs = (*valp ? LT_TRUE : LT_FALSE);
788 return lhs;
766} 789}
767 790
768/* 791/*
@@ -773,12 +796,15 @@ eval_table(const struct ops *ops, int *valp, const char **cpp)
773static Linetype 796static Linetype
774ifeval(const char **cpp) 797ifeval(const char **cpp)
775{ 798{
799 const char *cp = *cpp;
776 int ret; 800 int ret;
777 int val; 801 int val;
778 802
779 debug("eval %s", *cpp); 803 debug("eval %s", *cpp);
780 keepthis = killconsts ? false : true; 804 keepthis = killconsts ? false : true;
781 ret = eval_table(eval_ops, &val, cpp); 805 ret = eval_table(eval_ops, &val, &cp);
806 if (ret != LT_IF)
807 *cpp = cp;
782 debug("eval = %d", val); 808 debug("eval = %d", val);
783 return (keepthis ? LT_IF : ret); 809 return (keepthis ? LT_IF : ret);
784} 810}
diff --git a/scripts/ver_linux b/scripts/ver_linux
index dbb3037f1346..7de36df4eaa5 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -65,7 +65,7 @@ sed -n -e '/^.*\/libc-\([^/]*\)\.so$/{s//\1/;p;q}' < /proc/self/maps
65ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \ 65ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \
66'NR==1{print "Dynamic linker (ldd) ", $NF}' 66'NR==1{print "Dynamic linker (ldd) ", $NF}'
67 67
68ls -l /usr/lib/lib{g,stdc}++.so 2>/dev/null | awk -F. \ 68ls -l /usr/lib/libg++.so /usr/lib/libstdc++.so 2>/dev/null | awk -F. \
69 '{print "Linux C++ Library " $4"."$5"."$6}' 69 '{print "Linux C++ Library " $4"."$5"."$6}'
70 70
71ps --version 2>&1 | grep version | awk \ 71ps --version 2>&1 | grep version | awk \