aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2014-06-04 07:09:01 -0400
committerJiri Kosina <jkosina@suse.cz>2014-06-04 07:09:01 -0400
commitaf5666e0f76023d9c296016024297903a4c83108 (patch)
tree9397e7a41dd3eb0c0e14a6407a8e8f12abed4fc5 /scripts
parent1b15d2e5b8077670b1e6a33250a0d9577efff4a5 (diff)
parent368c96640d10a145da5f258f2d2833668d4f3629 (diff)
Merge branches 'for-3.15/upstream-fixes' and 'for-3.16/upstream' into for-linus
Conflicts: drivers/hid/hid-sensor-hub.c
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Kbuild.include1
-rw-r--r--scripts/Makefile6
-rw-r--r--scripts/Makefile.build12
-rw-r--r--scripts/Makefile.lib4
-rw-r--r--scripts/bootgraph.pl42
-rwxr-xr-xscripts/checkpatch.pl235
-rw-r--r--scripts/coccinelle/api/ptr_ret.cocci14
-rw-r--r--scripts/coccinelle/misc/memcpy-assign.cocci103
-rw-r--r--scripts/genksyms/keywords.gperf5
-rw-r--r--scripts/genksyms/keywords.hash.c_shipped133
-rw-r--r--scripts/genksyms/lex.l51
-rw-r--r--scripts/genksyms/lex.lex.c_shipped51
-rw-r--r--scripts/genksyms/parse.tab.c_shipped608
-rw-r--r--scripts/genksyms/parse.tab.h_shipped29
-rw-r--r--scripts/genksyms/parse.y5
-rw-r--r--scripts/kallsyms.c74
-rw-r--r--scripts/kconfig/confdata.c5
-rw-r--r--scripts/kconfig/expr.h3
-rw-r--r--scripts/kconfig/lkc.h1
-rw-r--r--scripts/kconfig/menu.c3
-rw-r--r--scripts/kconfig/zconf.gperf1
-rw-r--r--scripts/kconfig/zconf.hash.c_shipped13
-rw-r--r--scripts/link-vmlinux.sh4
-rwxr-xr-xscripts/mkcompile_h2
-rw-r--r--scripts/mod/file2alias.c14
-rwxr-xr-xscripts/objdiff141
-rwxr-xr-xscripts/tags.sh9
27 files changed, 971 insertions, 598 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 93a0da26582b..122f95c95869 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -3,6 +3,7 @@
3 3
4# Convenient variables 4# Convenient variables
5comma := , 5comma := ,
6quote := "
6squote := ' 7squote := '
7empty := 8empty :=
8space := $(empty) $(empty) 9space := $(empty) $(empty)
diff --git a/scripts/Makefile b/scripts/Makefile
index 01e7adb838d9..1d07860f6c42 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -27,10 +27,10 @@ always := $(hostprogs-y) $(hostprogs-m)
27hostprogs-y += unifdef docproc 27hostprogs-y += unifdef docproc
28 28
29# These targets are used internally to avoid "is up to date" messages 29# These targets are used internally to avoid "is up to date" messages
30PHONY += build_unifdef 30PHONY += build_unifdef build_docproc
31build_unifdef: scripts/unifdef FORCE 31build_unifdef: $(obj)/unifdef
32 @: 32 @:
33build_docproc: scripts/docproc FORCE 33build_docproc: $(obj)/docproc
34 @: 34 @:
35 35
36subdir-$(CONFIG_MODVERSIONS) += genksyms 36subdir-$(CONFIG_MODVERSIONS) += genksyms
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 9f0ee22b914f..003bc263105a 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -65,12 +65,22 @@ warning- := $(empty)
65warning-1 := -Wextra -Wunused -Wno-unused-parameter 65warning-1 := -Wextra -Wunused -Wno-unused-parameter
66warning-1 += -Wmissing-declarations 66warning-1 += -Wmissing-declarations
67warning-1 += -Wmissing-format-attribute 67warning-1 += -Wmissing-format-attribute
68warning-1 += -Wmissing-prototypes 68warning-1 += $(call cc-option, -Wmissing-prototypes)
69warning-1 += -Wold-style-definition 69warning-1 += -Wold-style-definition
70warning-1 += $(call cc-option, -Wmissing-include-dirs) 70warning-1 += $(call cc-option, -Wmissing-include-dirs)
71warning-1 += $(call cc-option, -Wunused-but-set-variable) 71warning-1 += $(call cc-option, -Wunused-but-set-variable)
72warning-1 += $(call cc-disable-warning, missing-field-initializers) 72warning-1 += $(call cc-disable-warning, missing-field-initializers)
73 73
74# Clang
75warning-1 += $(call cc-disable-warning, initializer-overrides)
76warning-1 += $(call cc-disable-warning, unused-value)
77warning-1 += $(call cc-disable-warning, format)
78warning-1 += $(call cc-disable-warning, unknown-warning-option)
79warning-1 += $(call cc-disable-warning, sign-compare)
80warning-1 += $(call cc-disable-warning, format-zero-length)
81warning-1 += $(call cc-disable-warning, uninitialized)
82warning-1 += $(call cc-option, -fcatch-undefined-behavior)
83
74warning-2 := -Waggregate-return 84warning-2 := -Waggregate-return
75warning-2 += -Wcast-align 85warning-2 += -Wcast-align
76warning-2 += -Wdisabled-optimization 86warning-2 += -Wdisabled-optimization
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 72105d104357..6a5b0decb797 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -380,7 +380,3 @@ quiet_cmd_xzmisc = XZMISC $@
380cmd_xzmisc = (cat $(filter-out FORCE,$^) | \ 380cmd_xzmisc = (cat $(filter-out FORCE,$^) | \
381 xz --check=crc32 --lzma2=dict=1MiB) > $@ || \ 381 xz --check=crc32 --lzma2=dict=1MiB) > $@ || \
382 (rm -f $@ ; false) 382 (rm -f $@ ; false)
383
384# misc stuff
385# ---------------------------------------------------------------------------
386quote:="
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl
index b78fca994a15..9ca667bcaee9 100644
--- a/scripts/bootgraph.pl
+++ b/scripts/bootgraph.pl
@@ -38,6 +38,31 @@
38# 38#
39 39
40use strict; 40use strict;
41use Getopt::Long;
42my $header = 0;
43
44sub help {
45 my $text = << "EOM";
46Usage:
471) dmesg | perl scripts/bootgraph.pl [OPTION] > output.svg
482) perl scripts/bootgraph.pl -h
49
50Options:
51 -header Insert kernel version and date
52EOM
53 my $std=shift;
54 if ($std == 1) {
55 print STDERR $text;
56 } else {
57 print $text;
58 }
59 exit;
60}
61
62GetOptions(
63 'h|help' =>\&help,
64 'header' =>\$header
65);
41 66
42my %start; 67my %start;
43my %end; 68my %end;
@@ -49,6 +74,11 @@ my $count = 0;
49my %pids; 74my %pids;
50my %pidctr; 75my %pidctr;
51 76
77my $headerstep = 20;
78my $xheader = 15;
79my $yheader = 25;
80my $cyheader = 0;
81
52while (<>) { 82while (<>) {
53 my $line = $_; 83 my $line = $_;
54 if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z0-9\_\.]+)\+/) { 84 if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z0-9\_\.]+)\+/) {
@@ -112,15 +142,23 @@ if ($count == 0) {
112 print STDERR <<END; 142 print STDERR <<END;
113No data found in the dmesg. Make sure that 'printk.time=1' and 143No data found in the dmesg. Make sure that 'printk.time=1' and
114'initcall_debug' are passed on the kernel command line. 144'initcall_debug' are passed on the kernel command line.
115Usage:
116 dmesg | perl scripts/bootgraph.pl > output.svg
117END 145END
146 help(1);
118 exit 1; 147 exit 1;
119} 148}
120 149
121print "<?xml version=\"1.0\" standalone=\"no\"?> \n"; 150print "<?xml version=\"1.0\" standalone=\"no\"?> \n";
122print "<svg width=\"2000\" height=\"100%\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n"; 151print "<svg width=\"2000\" height=\"100%\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n";
123 152
153
154if ($header) {
155 my $version = `uname -a`;
156 my $date = `date`;
157 print "<text transform=\"translate($xheader,$yheader)\">Kernel version: $version</text>\n";
158 $cyheader = $yheader+$headerstep;
159 print "<text transform=\"translate($xheader,$cyheader)\">Date: $date</text>\n";
160}
161
124my @styles; 162my @styles;
125 163
126$styles[0] = "fill:rgb(0,0,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)"; 164$styles[0] = "fill:rgb(0,0,255);fill-opacity:0.5;stroke-width:1;stroke:rgb(0,0,0)";
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 464dcef79b35..34eb2160489d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -281,7 +281,7 @@ our $Attribute = qr{
281 __weak 281 __weak
282 }x; 282 }x;
283our $Modifier; 283our $Modifier;
284our $Inline = qr{inline|__always_inline|noinline}; 284our $Inline = qr{inline|__always_inline|noinline|__inline|__inline__};
285our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]}; 285our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]};
286our $Lval = qr{$Ident(?:$Member)*}; 286our $Lval = qr{$Ident(?:$Member)*};
287 287
@@ -289,13 +289,14 @@ our $Int_type = qr{(?i)llu|ull|ll|lu|ul|l|u};
289our $Binary = qr{(?i)0b[01]+$Int_type?}; 289our $Binary = qr{(?i)0b[01]+$Int_type?};
290our $Hex = qr{(?i)0x[0-9a-f]+$Int_type?}; 290our $Hex = qr{(?i)0x[0-9a-f]+$Int_type?};
291our $Int = qr{[0-9]+$Int_type?}; 291our $Int = qr{[0-9]+$Int_type?};
292our $Octal = qr{0[0-7]+$Int_type?};
292our $Float_hex = qr{(?i)0x[0-9a-f]+p-?[0-9]+[fl]?}; 293our $Float_hex = qr{(?i)0x[0-9a-f]+p-?[0-9]+[fl]?};
293our $Float_dec = qr{(?i)(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?}; 294our $Float_dec = qr{(?i)(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?};
294our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?}; 295our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?};
295our $Float = qr{$Float_hex|$Float_dec|$Float_int}; 296our $Float = qr{$Float_hex|$Float_dec|$Float_int};
296our $Constant = qr{$Float|$Binary|$Hex|$Int}; 297our $Constant = qr{$Float|$Binary|$Octal|$Hex|$Int};
297our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=}; 298our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=};
298our $Compare = qr{<=|>=|==|!=|<|>}; 299our $Compare = qr{<=|>=|==|!=|<|(?<!-)>};
299our $Arithmetic = qr{\+|-|\*|\/|%}; 300our $Arithmetic = qr{\+|-|\*|\/|%};
300our $Operators = qr{ 301our $Operators = qr{
301 <=|>=|==|!=| 302 <=|>=|==|!=|
@@ -303,6 +304,8 @@ our $Operators = qr{
303 &&|\|\||,|\^|\+\+|--|&|\||$Arithmetic 304 &&|\|\||,|\^|\+\+|--|&|\||$Arithmetic
304 }x; 305 }x;
305 306
307our $c90_Keywords = qr{do|for|while|if|else|return|goto|continue|switch|default|case|break}x;
308
306our $NonptrType; 309our $NonptrType;
307our $NonptrTypeWithAttr; 310our $NonptrTypeWithAttr;
308our $Type; 311our $Type;
@@ -378,6 +381,22 @@ our @modifierList = (
378 qr{fastcall}, 381 qr{fastcall},
379); 382);
380 383
384our @mode_permission_funcs = (
385 ["module_param", 3],
386 ["module_param_(?:array|named|string)", 4],
387 ["module_param_array_named", 5],
388 ["debugfs_create_(?:file|u8|u16|u32|u64|x8|x16|x32|x64|size_t|atomic_t|bool|blob|regset32|u32_array)", 2],
389 ["proc_create(?:_data|)", 2],
390 ["(?:CLASS|DEVICE|SENSOR)_ATTR", 2],
391);
392
393#Create a search pattern for all these functions to speed up a loop below
394our $mode_perms_search = "";
395foreach my $entry (@mode_permission_funcs) {
396 $mode_perms_search .= '|' if ($mode_perms_search ne "");
397 $mode_perms_search .= $entry->[0];
398}
399
381our $allowed_asm_includes = qr{(?x: 400our $allowed_asm_includes = qr{(?x:
382 irq| 401 irq|
383 memory 402 memory
@@ -412,7 +431,7 @@ sub build_types {
412 (?:(?:\s|\*|\[\])+\s*const|(?:\s|\*|\[\])+|(?:\s*\[\s*\])+)? 431 (?:(?:\s|\*|\[\])+\s*const|(?:\s|\*|\[\])+|(?:\s*\[\s*\])+)?
413 (?:\s+$Inline|\s+$Modifier)* 432 (?:\s+$Inline|\s+$Modifier)*
414 }x; 433 }x;
415 $Declare = qr{(?:$Storage\s+)?$Type}; 434 $Declare = qr{(?:$Storage\s+(?:$Inline\s+)?)?$Type};
416} 435}
417build_types(); 436build_types();
418 437
@@ -423,15 +442,20 @@ our $Typecast = qr{\s*(\(\s*$NonptrType\s*\)){0,1}\s*};
423# Any use must be runtime checked with $^V 442# Any use must be runtime checked with $^V
424 443
425our $balanced_parens = qr/(\((?:[^\(\)]++|(?-1))*\))/; 444our $balanced_parens = qr/(\((?:[^\(\)]++|(?-1))*\))/;
426our $LvalOrFunc = qr{($Lval)\s*($balanced_parens{0,1})\s*}; 445our $LvalOrFunc = qr{((?:[\&\*]\s*)?$Lval)\s*($balanced_parens{0,1})\s*};
427our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant)}; 446our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant)};
428 447
429sub deparenthesize { 448sub deparenthesize {
430 my ($string) = @_; 449 my ($string) = @_;
431 return "" if (!defined($string)); 450 return "" if (!defined($string));
432 $string =~ s@^\s*\(\s*@@g; 451
433 $string =~ s@\s*\)\s*$@@g; 452 while ($string =~ /^\s*\(.*\)\s*$/) {
453 $string =~ s@^\s*\(\s*@@;
454 $string =~ s@\s*\)\s*$@@;
455 }
456
434 $string =~ s@\s+@ @g; 457 $string =~ s@\s+@ @g;
458
435 return $string; 459 return $string;
436} 460}
437 461
@@ -1421,21 +1445,25 @@ sub possible {
1421my $prefix = ''; 1445my $prefix = '';
1422 1446
1423sub show_type { 1447sub show_type {
1424 return defined $use_type{$_[0]} if (scalar keys %use_type > 0); 1448 my ($type) = @_;
1449
1450 return defined $use_type{$type} if (scalar keys %use_type > 0);
1425 1451
1426 return !defined $ignore_type{$_[0]}; 1452 return !defined $ignore_type{$type};
1427} 1453}
1428 1454
1429sub report { 1455sub report {
1430 if (!show_type($_[1]) || 1456 my ($level, $type, $msg) = @_;
1431 (defined $tst_only && $_[2] !~ /\Q$tst_only\E/)) { 1457
1458 if (!show_type($type) ||
1459 (defined $tst_only && $msg !~ /\Q$tst_only\E/)) {
1432 return 0; 1460 return 0;
1433 } 1461 }
1434 my $line; 1462 my $line;
1435 if ($show_types) { 1463 if ($show_types) {
1436 $line = "$prefix$_[0]:$_[1]: $_[2]\n"; 1464 $line = "$prefix$level:$type: $msg\n";
1437 } else { 1465 } else {
1438 $line = "$prefix$_[0]: $_[2]\n"; 1466 $line = "$prefix$level: $msg\n";
1439 } 1467 }
1440 $line = (split('\n', $line))[0] . "\n" if ($terse); 1468 $line = (split('\n', $line))[0] . "\n" if ($terse);
1441 1469
@@ -1443,12 +1471,15 @@ sub report {
1443 1471
1444 return 1; 1472 return 1;
1445} 1473}
1474
1446sub report_dump { 1475sub report_dump {
1447 our @report; 1476 our @report;
1448} 1477}
1449 1478
1450sub ERROR { 1479sub ERROR {
1451 if (report("ERROR", $_[0], $_[1])) { 1480 my ($type, $msg) = @_;
1481
1482 if (report("ERROR", $type, $msg)) {
1452 our $clean = 0; 1483 our $clean = 0;
1453 our $cnt_error++; 1484 our $cnt_error++;
1454 return 1; 1485 return 1;
@@ -1456,7 +1487,9 @@ sub ERROR {
1456 return 0; 1487 return 0;
1457} 1488}
1458sub WARN { 1489sub WARN {
1459 if (report("WARNING", $_[0], $_[1])) { 1490 my ($type, $msg) = @_;
1491
1492 if (report("WARNING", $type, $msg)) {
1460 our $clean = 0; 1493 our $clean = 0;
1461 our $cnt_warn++; 1494 our $cnt_warn++;
1462 return 1; 1495 return 1;
@@ -1464,7 +1497,9 @@ sub WARN {
1464 return 0; 1497 return 0;
1465} 1498}
1466sub CHK { 1499sub CHK {
1467 if ($check && report("CHECK", $_[0], $_[1])) { 1500 my ($type, $msg) = @_;
1501
1502 if ($check && report("CHECK", $type, $msg)) {
1468 our $clean = 0; 1503 our $clean = 0;
1469 our $cnt_chk++; 1504 our $cnt_chk++;
1470 return 1; 1505 return 1;
@@ -1574,7 +1609,7 @@ sub pos_last_openparen {
1574 } 1609 }
1575 } 1610 }
1576 1611
1577 return $last_openparen + 1; 1612 return length(expand_tabs(substr($line, 0, $last_openparen))) + 1;
1578} 1613}
1579 1614
1580sub process { 1615sub process {
@@ -1891,6 +1926,12 @@ sub process {
1891 } 1926 }
1892 } 1927 }
1893 1928
1929# Check for unwanted Gerrit info
1930 if ($in_commit_log && $line =~ /^\s*change-id:/i) {
1931 ERROR("GERRIT_CHANGE_ID",
1932 "Remove Gerrit Change-Id's before submitting upstream.\n" . $herecurr);
1933 }
1934
1894# Check for wrappage within a valid hunk of the file 1935# Check for wrappage within a valid hunk of the file
1895 if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) { 1936 if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) {
1896 ERROR("CORRUPTED_PATCH", 1937 ERROR("CORRUPTED_PATCH",
@@ -2041,13 +2082,17 @@ sub process {
2041 } 2082 }
2042 2083
2043# check for DT compatible documentation 2084# check for DT compatible documentation
2044 if (defined $root && $realfile =~ /\.dts/ && 2085 if (defined $root &&
2045 $rawline =~ /^\+\s*compatible\s*=/) { 2086 (($realfile =~ /\.dtsi?$/ && $line =~ /^\+\s*compatible\s*=\s*\"/) ||
2087 ($realfile =~ /\.[ch]$/ && $line =~ /^\+.*\.compatible\s*=\s*\"/))) {
2088
2046 my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,\.\+_]+)\"/g; 2089 my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,\.\+_]+)\"/g;
2047 2090
2091 my $dt_path = $root . "/Documentation/devicetree/bindings/";
2092 my $vp_file = $dt_path . "vendor-prefixes.txt";
2093
2048 foreach my $compat (@compats) { 2094 foreach my $compat (@compats) {
2049 my $compat2 = $compat; 2095 my $compat2 = $compat;
2050 my $dt_path = $root . "/Documentation/devicetree/bindings/";
2051 $compat2 =~ s/\,[a-z]*\-/\,<\.\*>\-/; 2096 $compat2 =~ s/\,[a-z]*\-/\,<\.\*>\-/;
2052 `grep -Erq "$compat|$compat2" $dt_path`; 2097 `grep -Erq "$compat|$compat2" $dt_path`;
2053 if ( $? >> 8 ) { 2098 if ( $? >> 8 ) {
@@ -2055,14 +2100,12 @@ sub process {
2055 "DT compatible string \"$compat\" appears un-documented -- check $dt_path\n" . $herecurr); 2100 "DT compatible string \"$compat\" appears un-documented -- check $dt_path\n" . $herecurr);
2056 } 2101 }
2057 2102
2058 my $vendor = $compat; 2103 next if $compat !~ /^([a-zA-Z0-9\-]+)\,/;
2059 my $vendor_path = $dt_path . "vendor-prefixes.txt"; 2104 my $vendor = $1;
2060 next if (! -f $vendor_path); 2105 `grep -Eq "^$vendor\\b" $vp_file`;
2061 $vendor =~ s/^([a-zA-Z0-9]+)\,.*/$1/;
2062 `grep -Eq "$vendor" $vendor_path`;
2063 if ( $? >> 8 ) { 2106 if ( $? >> 8 ) {
2064 WARN("UNDOCUMENTED_DT_STRING", 2107 WARN("UNDOCUMENTED_DT_STRING",
2065 "DT compatible string vendor \"$vendor\" appears un-documented -- check $vendor_path\n" . $herecurr); 2108 "DT compatible string vendor \"$vendor\" appears un-documented -- check $vp_file\n" . $herecurr);
2066 } 2109 }
2067 } 2110 }
2068 } 2111 }
@@ -2159,7 +2202,7 @@ sub process {
2159 2202
2160# check multi-line statement indentation matches previous line 2203# check multi-line statement indentation matches previous line
2161 if ($^V && $^V ge 5.10.0 && 2204 if ($^V && $^V ge 5.10.0 &&
2162 $prevline =~ /^\+(\t*)(if \(|$Ident\().*(\&\&|\|\||,)\s*$/) { 2205 $prevline =~ /^\+([ \t]*)((?:$c90_Keywords(?:\s+if)\s*)|(?:$Declare\s*)?(?:$Ident|\(\s*\*\s*$Ident\s*\))\s*|$Ident\s*=\s*$Ident\s*)\(.*(\&\&|\|\||,)\s*$/) {
2163 $prevline =~ /^\+(\t*)(.*)$/; 2206 $prevline =~ /^\+(\t*)(.*)$/;
2164 my $oldindent = $1; 2207 my $oldindent = $1;
2165 my $rest = $2; 2208 my $rest = $2;
@@ -2198,7 +2241,8 @@ sub process {
2198 2241
2199 if ($realfile =~ m@^(drivers/net/|net/)@ && 2242 if ($realfile =~ m@^(drivers/net/|net/)@ &&
2200 $prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ && 2243 $prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
2201 $rawline =~ /^\+[ \t]*\*/) { 2244 $rawline =~ /^\+[ \t]*\*/ &&
2245 $realline > 2) {
2202 WARN("NETWORKING_BLOCK_COMMENT_STYLE", 2246 WARN("NETWORKING_BLOCK_COMMENT_STYLE",
2203 "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev); 2247 "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);
2204 } 2248 }
@@ -2221,6 +2265,21 @@ sub process {
2221 "networking block comments put the trailing */ on a separate line\n" . $herecurr); 2265 "networking block comments put the trailing */ on a separate line\n" . $herecurr);
2222 } 2266 }
2223 2267
2268# check for missing blank lines after declarations
2269 if ($realfile =~ m@^(drivers/net/|net/)@ &&
2270 $prevline =~ /^\+\s+$Declare\s+$Ident/ &&
2271 !($prevline =~ /(?:$Compare|$Assignment|$Operators)\s*$/ ||
2272 $prevline =~ /(?:\{\s*|\\)$/) && #extended lines
2273 $sline =~ /^\+\s+/ && #Not at char 1
2274 !($sline =~ /^\+\s+$Declare/ ||
2275 $sline =~ /^\+\s+$Ident\s+$Ident/ || #eg: typedef foo
2276 $sline =~ /^\+\s+(?:union|struct|enum|typedef)\b/ ||
2277 $sline =~ /^\+\s+(?:$|[\{\}\.\#\"\?\:\(])/ ||
2278 $sline =~ /^\+\s+\(?\s*(?:$Compare|$Assignment|$Operators)/)) {
2279 WARN("SPACING",
2280 "networking uses a blank line after declarations\n" . $hereprev);
2281 }
2282
2224# check for spaces at the beginning of a line. 2283# check for spaces at the beginning of a line.
2225# Exceptions: 2284# Exceptions:
2226# 1) within comments 2285# 1) within comments
@@ -2665,6 +2724,13 @@ sub process {
2665 $herecurr); 2724 $herecurr);
2666 } 2725 }
2667 2726
2727# check for non-global char *foo[] = {"bar", ...} declarations.
2728 if ($line =~ /^.\s+(?:static\s+|const\s+)?char\s+\*\s*\w+\s*\[\s*\]\s*=\s*\{/) {
2729 WARN("STATIC_CONST_CHAR_ARRAY",
2730 "char * array declaration might be better as static const\n" .
2731 $herecurr);
2732 }
2733
2668# check for function declarations without arguments like "int foo()" 2734# check for function declarations without arguments like "int foo()"
2669 if ($line =~ /(\b$Type\s+$Ident)\s*\(\s*\)/) { 2735 if ($line =~ /(\b$Type\s+$Ident)\s*\(\s*\)/) {
2670 if (ERROR("FUNCTION_WITHOUT_ARGS", 2736 if (ERROR("FUNCTION_WITHOUT_ARGS",
@@ -2799,7 +2865,7 @@ sub process {
2799 my $level2 = $level; 2865 my $level2 = $level;
2800 $level2 = "dbg" if ($level eq "debug"); 2866 $level2 = "dbg" if ($level eq "debug");
2801 WARN("PREFER_PR_LEVEL", 2867 WARN("PREFER_PR_LEVEL",
2802 "Prefer netdev_$level2(netdev, ... then dev_$level2(dev, ... then pr_$level(... to printk(KERN_$orig ...\n" . $herecurr); 2868 "Prefer [subsystem eg: netdev]_$level2([subsystem]dev, ... then dev_$level2(dev, ... then pr_$level(... to printk(KERN_$orig ...\n" . $herecurr);
2803 } 2869 }
2804 2870
2805 if ($line =~ /\bpr_warning\s*\(/) { 2871 if ($line =~ /\bpr_warning\s*\(/) {
@@ -2848,10 +2914,7 @@ sub process {
2848# Function pointer declarations 2914# Function pointer declarations
2849# check spacing between type, funcptr, and args 2915# check spacing between type, funcptr, and args
2850# canonical declaration is "type (*funcptr)(args...)" 2916# canonical declaration is "type (*funcptr)(args...)"
2851# 2917 if ($line =~ /^.\s*($Declare)\((\s*)\*(\s*)($Ident)(\s*)\)(\s*)\(/) {
2852# the $Declare variable will capture all spaces after the type
2853# so check it for trailing missing spaces or multiple spaces
2854 if ($line =~ /^.\s*($Declare)\((\s*)\*(\s*)$Ident(\s*)\)(\s*)\(/) {
2855 my $declare = $1; 2918 my $declare = $1;
2856 my $pre_pointer_space = $2; 2919 my $pre_pointer_space = $2;
2857 my $post_pointer_space = $3; 2920 my $post_pointer_space = $3;
@@ -2859,16 +2922,30 @@ sub process {
2859 my $post_funcname_space = $5; 2922 my $post_funcname_space = $5;
2860 my $pre_args_space = $6; 2923 my $pre_args_space = $6;
2861 2924
2862 if ($declare !~ /\s$/) { 2925# the $Declare variable will capture all spaces after the type
2926# so check it for a missing trailing missing space but pointer return types
2927# don't need a space so don't warn for those.
2928 my $post_declare_space = "";
2929 if ($declare =~ /(\s+)$/) {
2930 $post_declare_space = $1;
2931 $declare = rtrim($declare);
2932 }
2933 if ($declare !~ /\*$/ && $post_declare_space =~ /^$/) {
2863 WARN("SPACING", 2934 WARN("SPACING",
2864 "missing space after return type\n" . $herecurr); 2935 "missing space after return type\n" . $herecurr);
2936 $post_declare_space = " ";
2865 } 2937 }
2866 2938
2867# unnecessary space "type (*funcptr)(args...)" 2939# unnecessary space "type (*funcptr)(args...)"
2868 elsif ($declare =~ /\s{2,}$/) { 2940# This test is not currently implemented because these declarations are
2869 WARN("SPACING", 2941# equivalent to
2870 "Multiple spaces after return type\n" . $herecurr); 2942# int foo(int bar, ...)
2871 } 2943# and this is form shouldn't/doesn't generate a checkpatch warning.
2944#
2945# elsif ($declare =~ /\s{2,}$/) {
2946# WARN("SPACING",
2947# "Multiple spaces after return type\n" . $herecurr);
2948# }
2872 2949
2873# unnecessary space "type ( *funcptr)(args...)" 2950# unnecessary space "type ( *funcptr)(args...)"
2874 if (defined $pre_pointer_space && 2951 if (defined $pre_pointer_space &&
@@ -2900,7 +2977,7 @@ sub process {
2900 2977
2901 if (show_type("SPACING") && $fix) { 2978 if (show_type("SPACING") && $fix) {
2902 $fixed[$linenr - 1] =~ 2979 $fixed[$linenr - 1] =~
2903 s/^(.\s*$Declare)\(\s*\*\s*($Ident)\s*\)\s*\(/rtrim($1) . " " . "\(\*$2\)\("/ex; 2980 s/^(.\s*)$Declare\s*\(\s*\*\s*$Ident\s*\)\s*\(/$1 . $declare . $post_declare_space . '(*' . $funcname . ')('/ex;
2904 } 2981 }
2905 } 2982 }
2906 2983
@@ -3061,10 +3138,13 @@ sub process {
3061 # // is a comment 3138 # // is a comment
3062 } elsif ($op eq '//') { 3139 } elsif ($op eq '//') {
3063 3140
3141 # : when part of a bitfield
3142 } elsif ($opv eq ':B') {
3143 # skip the bitfield test for now
3144
3064 # No spaces for: 3145 # No spaces for:
3065 # -> 3146 # ->
3066 # : when part of a bitfield 3147 } elsif ($op eq '->') {
3067 } elsif ($op eq '->' || $opv eq ':B') {
3068 if ($ctx =~ /Wx.|.xW/) { 3148 if ($ctx =~ /Wx.|.xW/) {
3069 if (ERROR("SPACING", 3149 if (ERROR("SPACING",
3070 "spaces prohibited around that '$op' $at\n" . $hereptr)) { 3150 "spaces prohibited around that '$op' $at\n" . $hereptr)) {
@@ -3334,14 +3414,17 @@ sub process {
3334 } 3414 }
3335 } 3415 }
3336 3416
3337# Return is not a function. 3417# return is not a function
3338 if (defined($stat) && $stat =~ /^.\s*return(\s*)\(/s) { 3418 if (defined($stat) && $stat =~ /^.\s*return(\s*)\(/s) {
3339 my $spacing = $1; 3419 my $spacing = $1;
3340 if ($^V && $^V ge 5.10.0 && 3420 if ($^V && $^V ge 5.10.0 &&
3341 $stat =~ /^.\s*return\s*$balanced_parens\s*;\s*$/) { 3421 $stat =~ /^.\s*return\s*($balanced_parens)\s*;\s*$/) {
3342 ERROR("RETURN_PARENTHESES", 3422 my $value = $1;
3343 "return is not a function, parentheses are not required\n" . $herecurr); 3423 $value = deparenthesize($value);
3344 3424 if ($value =~ m/^\s*$FuncArg\s*(?:\?|$)/) {
3425 ERROR("RETURN_PARENTHESES",
3426 "return is not a function, parentheses are not required\n" . $herecurr);
3427 }
3345 } elsif ($spacing !~ /\s+/) { 3428 } elsif ($spacing !~ /\s+/) {
3346 ERROR("SPACING", 3429 ERROR("SPACING",
3347 "space required before the open parenthesis '('\n" . $herecurr); 3430 "space required before the open parenthesis '('\n" . $herecurr);
@@ -3910,12 +3993,30 @@ sub process {
3910 } 3993 }
3911 } 3994 }
3912 3995
3996# don't use __constant_<foo> functions outside of include/uapi/
3997 if ($realfile !~ m@^include/uapi/@ &&
3998 $line =~ /(__constant_(?:htons|ntohs|[bl]e(?:16|32|64)_to_cpu|cpu_to_[bl]e(?:16|32|64)))\s*\(/) {
3999 my $constant_func = $1;
4000 my $func = $constant_func;
4001 $func =~ s/^__constant_//;
4002 if (WARN("CONSTANT_CONVERSION",
4003 "$constant_func should be $func\n" . $herecurr) &&
4004 $fix) {
4005 $fixed[$linenr - 1] =~ s/\b$constant_func\b/$func/g;
4006 }
4007 }
4008
3913# prefer usleep_range over udelay 4009# prefer usleep_range over udelay
3914 if ($line =~ /\budelay\s*\(\s*(\d+)\s*\)/) { 4010 if ($line =~ /\budelay\s*\(\s*(\d+)\s*\)/) {
4011 my $delay = $1;
3915 # ignore udelay's < 10, however 4012 # ignore udelay's < 10, however
3916 if (! ($1 < 10) ) { 4013 if (! ($delay < 10) ) {
3917 CHK("USLEEP_RANGE", 4014 CHK("USLEEP_RANGE",
3918 "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt\n" . $line); 4015 "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt\n" . $herecurr);
4016 }
4017 if ($delay > 2000) {
4018 WARN("LONG_UDELAY",
4019 "long udelay - prefer mdelay; see arch/arm/include/asm/delay.h\n" . $herecurr);
3919 } 4020 }
3920 } 4021 }
3921 4022
@@ -3923,7 +4024,7 @@ sub process {
3923 if ($line =~ /\bmsleep\s*\((\d+)\);/) { 4024 if ($line =~ /\bmsleep\s*\((\d+)\);/) {
3924 if ($1 < 20) { 4025 if ($1 < 20) {
3925 WARN("MSLEEP", 4026 WARN("MSLEEP",
3926 "msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt\n" . $line); 4027 "msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt\n" . $herecurr);
3927 } 4028 }
3928 } 4029 }
3929 4030
@@ -4149,7 +4250,7 @@ sub process {
4149# check for naked sscanf 4250# check for naked sscanf
4150 if ($^V && $^V ge 5.10.0 && 4251 if ($^V && $^V ge 5.10.0 &&
4151 defined $stat && 4252 defined $stat &&
4152 $stat =~ /\bsscanf\b/ && 4253 $line =~ /\bsscanf\b/ &&
4153 ($stat !~ /$Ident\s*=\s*sscanf\s*$balanced_parens/ && 4254 ($stat !~ /$Ident\s*=\s*sscanf\s*$balanced_parens/ &&
4154 $stat !~ /\bsscanf\s*$balanced_parens\s*(?:$Compare)/ && 4255 $stat !~ /\bsscanf\s*$balanced_parens\s*(?:$Compare)/ &&
4155 $stat !~ /(?:$Compare)\s*\bsscanf\s*$balanced_parens/)) { 4256 $stat !~ /(?:$Compare)\s*\bsscanf\s*$balanced_parens/)) {
@@ -4240,12 +4341,6 @@ sub process {
4240 "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr); 4341 "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr);
4241 } 4342 }
4242 4343
4243# check for GFP_NOWAIT use
4244 if ($line =~ /\b__GFP_NOFAIL\b/) {
4245 WARN("__GFP_NOFAIL",
4246 "Use of __GFP_NOFAIL is deprecated, no new users should be added\n" . $herecurr);
4247 }
4248
4249# check for multiple semicolons 4344# check for multiple semicolons
4250 if ($line =~ /;\s*;\s*$/) { 4345 if ($line =~ /;\s*;\s*$/) {
4251 if (WARN("ONE_SEMICOLON", 4346 if (WARN("ONE_SEMICOLON",
@@ -4457,6 +4552,34 @@ sub process {
4457 WARN("EXPORTED_WORLD_WRITABLE", 4552 WARN("EXPORTED_WORLD_WRITABLE",
4458 "Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr); 4553 "Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr);
4459 } 4554 }
4555
4556# Mode permission misuses where it seems decimal should be octal
4557# This uses a shortcut match to avoid unnecessary uses of a slow foreach loop
4558 if ($^V && $^V ge 5.10.0 &&
4559 $line =~ /$mode_perms_search/) {
4560 foreach my $entry (@mode_permission_funcs) {
4561 my $func = $entry->[0];
4562 my $arg_pos = $entry->[1];
4563
4564 my $skip_args = "";
4565 if ($arg_pos > 1) {
4566 $arg_pos--;
4567 $skip_args = "(?:\\s*$FuncArg\\s*,\\s*){$arg_pos,$arg_pos}";
4568 }
4569 my $test = "\\b$func\\s*\\(${skip_args}([\\d]+)\\s*[,\\)]";
4570 if ($line =~ /$test/) {
4571 my $val = $1;
4572 $val = $6 if ($skip_args ne "");
4573
4574 if ($val !~ /^0$/ &&
4575 (($val =~ /^$Int$/ && $val !~ /^$Octal$/) ||
4576 length($val) ne 4)) {
4577 ERROR("NON_OCTAL_PERMISSIONS",
4578 "Use 4 digit octal (0777) not decimal permissions\n" . $herecurr);
4579 }
4580 }
4581 }
4582 }
4460 } 4583 }
4461 4584
4462 # If we have no input at all, then there is nothing to report on 4585 # If we have no input at all, then there is nothing to report on
diff --git a/scripts/coccinelle/api/ptr_ret.cocci b/scripts/coccinelle/api/ptr_ret.cocci
index e18f8402e37c..dd58dab5d411 100644
--- a/scripts/coccinelle/api/ptr_ret.cocci
+++ b/scripts/coccinelle/api/ptr_ret.cocci
@@ -7,7 +7,7 @@
7// URL: http://coccinelle.lip6.fr/ 7// URL: http://coccinelle.lip6.fr/
8// Options: --no-includes --include-headers 8// Options: --no-includes --include-headers
9// 9//
10// Keywords: ERR_PTR, PTR_ERR, PTR_RET, PTR_ERR_OR_ZERO 10// Keywords: ERR_PTR, PTR_ERR, PTR_ERR_OR_ZERO
11// Version min: 2.6.39 11// Version min: 2.6.39
12// 12//
13 13
@@ -62,35 +62,35 @@ position p3;
62p << r1.p1; 62p << r1.p1;
63@@ 63@@
64 64
65coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used") 65coccilib.org.print_todo(p[0], "WARNING: PTR_ERR_OR_ZERO can be used")
66 66
67 67
68@script:python depends on org@ 68@script:python depends on org@
69p << r2.p2; 69p << r2.p2;
70@@ 70@@
71 71
72coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used") 72coccilib.org.print_todo(p[0], "WARNING: PTR_ERR_OR_ZERO can be used")
73 73
74@script:python depends on org@ 74@script:python depends on org@
75p << r3.p3; 75p << r3.p3;
76@@ 76@@
77 77
78coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used") 78coccilib.org.print_todo(p[0], "WARNING: PTR_ERR_OR_ZERO can be used")
79 79
80@script:python depends on report@ 80@script:python depends on report@
81p << r1.p1; 81p << r1.p1;
82@@ 82@@
83 83
84coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used") 84coccilib.report.print_report(p[0], "WARNING: PTR_ERR_OR_ZERO can be used")
85 85
86@script:python depends on report@ 86@script:python depends on report@
87p << r2.p2; 87p << r2.p2;
88@@ 88@@
89 89
90coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used") 90coccilib.report.print_report(p[0], "WARNING: PTR_ERR_OR_ZERO can be used")
91 91
92@script:python depends on report@ 92@script:python depends on report@
93p << r3.p3; 93p << r3.p3;
94@@ 94@@
95 95
96coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used") 96coccilib.report.print_report(p[0], "WARNING: PTR_ERR_OR_ZERO can be used")
diff --git a/scripts/coccinelle/misc/memcpy-assign.cocci b/scripts/coccinelle/misc/memcpy-assign.cocci
deleted file mode 100644
index afd058be497f..000000000000
--- a/scripts/coccinelle/misc/memcpy-assign.cocci
+++ /dev/null
@@ -1,103 +0,0 @@
1//
2// Replace memcpy with struct assignment.
3//
4// Confidence: High
5// Copyright: (C) 2012 Peter Senna Tschudin, INRIA/LIP6. GPLv2.
6// URL: http://coccinelle.lip6.fr/
7// Comments:
8// Options: --no-includes --include-headers
9
10virtual patch
11virtual report
12virtual context
13virtual org
14
15@r1 depends on !patch@
16identifier struct_name;
17struct struct_name to;
18struct struct_name from;
19struct struct_name *top;
20struct struct_name *fromp;
21position p;
22@@
23memcpy@p(\(&(to)\|top\), \(&(from)\|fromp\), \(sizeof(to)\|sizeof(from)\|sizeof(struct struct_name)\|sizeof(*top)\|sizeof(*fromp)\))
24
25@script:python depends on report@
26p << r1.p;
27@@
28coccilib.report.print_report(p[0],"Replace memcpy with struct assignment")
29
30@depends on context@
31position r1.p;
32@@
33*memcpy@p(...);
34
35@script:python depends on org@
36p << r1.p;
37@@
38cocci.print_main("Replace memcpy with struct assignment",p)
39
40@depends on patch@
41identifier struct_name;
42struct struct_name to;
43struct struct_name from;
44@@
45(
46-memcpy(&(to), &(from), sizeof(to));
47+to = from;
48|
49-memcpy(&(to), &(from), sizeof(from));
50+to = from;
51|
52-memcpy(&(to), &(from), sizeof(struct struct_name));
53+to = from;
54)
55
56@depends on patch@
57identifier struct_name;
58struct struct_name to;
59struct struct_name *from;
60@@
61(
62-memcpy(&(to), from, sizeof(to));
63+to = *from;
64|
65-memcpy(&(to), from, sizeof(*from));
66+to = *from;
67|
68-memcpy(&(to), from, sizeof(struct struct_name));
69+to = *from;
70)
71
72@depends on patch@
73identifier struct_name;
74struct struct_name *to;
75struct struct_name from;
76@@
77(
78-memcpy(to, &(from), sizeof(*to));
79+ *to = from;
80|
81-memcpy(to, &(from), sizeof(from));
82+ *to = from;
83|
84-memcpy(to, &(from), sizeof(struct struct_name));
85+ *to = from;
86)
87
88@depends on patch@
89identifier struct_name;
90struct struct_name *to;
91struct struct_name *from;
92@@
93(
94-memcpy(to, from, sizeof(*to));
95+ *to = *from;
96|
97-memcpy(to, from, sizeof(*from));
98+ *to = *from;
99|
100-memcpy(to, from, sizeof(struct struct_name));
101+ *to = *from;
102)
103
diff --git a/scripts/genksyms/keywords.gperf b/scripts/genksyms/keywords.gperf
index 3e77a943e7b7..a9096d993172 100644
--- a/scripts/genksyms/keywords.gperf
+++ b/scripts/genksyms/keywords.gperf
@@ -23,6 +23,8 @@ __inline, INLINE_KEYW
23__inline__, INLINE_KEYW 23__inline__, INLINE_KEYW
24__signed, SIGNED_KEYW 24__signed, SIGNED_KEYW
25__signed__, SIGNED_KEYW 25__signed__, SIGNED_KEYW
26__typeof, TYPEOF_KEYW
27__typeof__, TYPEOF_KEYW
26__volatile, VOLATILE_KEYW 28__volatile, VOLATILE_KEYW
27__volatile__, VOLATILE_KEYW 29__volatile__, VOLATILE_KEYW
28# According to rth, c99 defines _Bool, __restrict, __restrict__, restrict. KAO 30# According to rth, c99 defines _Bool, __restrict, __restrict__, restrict. KAO
@@ -51,9 +53,8 @@ signed, SIGNED_KEYW
51static, STATIC_KEYW 53static, STATIC_KEYW
52struct, STRUCT_KEYW 54struct, STRUCT_KEYW
53typedef, TYPEDEF_KEYW 55typedef, TYPEDEF_KEYW
56typeof, TYPEOF_KEYW
54union, UNION_KEYW 57union, UNION_KEYW
55unsigned, UNSIGNED_KEYW 58unsigned, UNSIGNED_KEYW
56void, VOID_KEYW 59void, VOID_KEYW
57volatile, VOLATILE_KEYW 60volatile, VOLATILE_KEYW
58typeof, TYPEOF_KEYW
59__typeof__, TYPEOF_KEYW
diff --git a/scripts/genksyms/keywords.hash.c_shipped b/scripts/genksyms/keywords.hash.c_shipped
index 82062607e8c0..e9452482e198 100644
--- a/scripts/genksyms/keywords.hash.c_shipped
+++ b/scripts/genksyms/keywords.hash.c_shipped
@@ -34,7 +34,7 @@ struct resword;
34static const struct resword *is_reserved_word(register const char *str, register unsigned int len); 34static const struct resword *is_reserved_word(register const char *str, register unsigned int len);
35#line 8 "scripts/genksyms/keywords.gperf" 35#line 8 "scripts/genksyms/keywords.gperf"
36struct resword { const char *name; int token; }; 36struct resword { const char *name; int token; };
37/* maximum key range = 64, duplicates = 0 */ 37/* maximum key range = 98, duplicates = 0 */
38 38
39#ifdef __GNUC__ 39#ifdef __GNUC__
40__inline 40__inline
@@ -48,32 +48,32 @@ is_reserved_hash (register const char *str, register unsigned int len)
48{ 48{
49 static const unsigned char asso_values[] = 49 static const unsigned char asso_values[] =
50 { 50 {
51 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 51 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
52 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 52 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
53 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 53 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
54 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 54 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
55 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 55 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
56 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 56 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
57 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 57 101, 101, 101, 101, 101, 101, 101, 101, 101, 0,
58 67, 67, 67, 67, 67, 67, 15, 67, 67, 67, 58 101, 101, 101, 101, 101, 101, 15, 101, 101, 101,
59 0, 67, 67, 67, 67, 67, 67, 67, 67, 67, 59 0, 101, 101, 101, 101, 101, 101, 101, 101, 101,
60 67, 67, 67, 67, 67, 0, 67, 0, 67, 5, 60 101, 101, 101, 101, 101, 0, 101, 0, 101, 5,
61 25, 20, 15, 30, 67, 15, 67, 67, 10, 0, 61 25, 20, 55, 30, 101, 15, 101, 101, 10, 0,
62 10, 40, 20, 67, 10, 5, 0, 10, 15, 67, 62 10, 40, 10, 101, 10, 5, 0, 10, 15, 101,
63 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 63 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
64 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 64 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
65 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 65 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
66 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 66 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
67 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
68 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 68 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
69 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 69 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
70 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 70 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
71 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 71 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
72 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 72 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
73 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 73 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
74 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 74 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
75 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 75 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
76 67, 67, 67, 67, 67, 67 76 101, 101, 101, 101, 101, 101
77 }; 77 };
78 return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values[(unsigned char)str[len - 1]]; 78 return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values[(unsigned char)str[len - 1]];
79} 79}
@@ -89,17 +89,17 @@ is_reserved_word (register const char *str, register unsigned int len)
89{ 89{
90 enum 90 enum
91 { 91 {
92 TOTAL_KEYWORDS = 45, 92 TOTAL_KEYWORDS = 46,
93 MIN_WORD_LENGTH = 3, 93 MIN_WORD_LENGTH = 3,
94 MAX_WORD_LENGTH = 24, 94 MAX_WORD_LENGTH = 24,
95 MIN_HASH_VALUE = 3, 95 MIN_HASH_VALUE = 3,
96 MAX_HASH_VALUE = 66 96 MAX_HASH_VALUE = 100
97 }; 97 };
98 98
99 static const struct resword wordlist[] = 99 static const struct resword wordlist[] =
100 { 100 {
101 {""}, {""}, {""}, 101 {""}, {""}, {""},
102#line 33 "scripts/genksyms/keywords.gperf" 102#line 35 "scripts/genksyms/keywords.gperf"
103 {"asm", ASM_KEYW}, 103 {"asm", ASM_KEYW},
104 {""}, 104 {""},
105#line 15 "scripts/genksyms/keywords.gperf" 105#line 15 "scripts/genksyms/keywords.gperf"
@@ -108,7 +108,7 @@ is_reserved_word (register const char *str, register unsigned int len)
108#line 16 "scripts/genksyms/keywords.gperf" 108#line 16 "scripts/genksyms/keywords.gperf"
109 {"__asm__", ASM_KEYW}, 109 {"__asm__", ASM_KEYW},
110 {""}, {""}, 110 {""}, {""},
111#line 59 "scripts/genksyms/keywords.gperf" 111#line 27 "scripts/genksyms/keywords.gperf"
112 {"__typeof__", TYPEOF_KEYW}, 112 {"__typeof__", TYPEOF_KEYW},
113 {""}, 113 {""},
114#line 19 "scripts/genksyms/keywords.gperf" 114#line 19 "scripts/genksyms/keywords.gperf"
@@ -119,31 +119,31 @@ is_reserved_word (register const char *str, register unsigned int len)
119 {"__const__", CONST_KEYW}, 119 {"__const__", CONST_KEYW},
120#line 25 "scripts/genksyms/keywords.gperf" 120#line 25 "scripts/genksyms/keywords.gperf"
121 {"__signed__", SIGNED_KEYW}, 121 {"__signed__", SIGNED_KEYW},
122#line 51 "scripts/genksyms/keywords.gperf" 122#line 53 "scripts/genksyms/keywords.gperf"
123 {"static", STATIC_KEYW}, 123 {"static", STATIC_KEYW},
124 {""}, 124 {""},
125#line 46 "scripts/genksyms/keywords.gperf" 125#line 48 "scripts/genksyms/keywords.gperf"
126 {"int", INT_KEYW}, 126 {"int", INT_KEYW},
127#line 39 "scripts/genksyms/keywords.gperf" 127#line 41 "scripts/genksyms/keywords.gperf"
128 {"char", CHAR_KEYW}, 128 {"char", CHAR_KEYW},
129#line 40 "scripts/genksyms/keywords.gperf" 129#line 42 "scripts/genksyms/keywords.gperf"
130 {"const", CONST_KEYW}, 130 {"const", CONST_KEYW},
131#line 52 "scripts/genksyms/keywords.gperf" 131#line 54 "scripts/genksyms/keywords.gperf"
132 {"struct", STRUCT_KEYW}, 132 {"struct", STRUCT_KEYW},
133#line 31 "scripts/genksyms/keywords.gperf" 133#line 33 "scripts/genksyms/keywords.gperf"
134 {"__restrict__", RESTRICT_KEYW}, 134 {"__restrict__", RESTRICT_KEYW},
135#line 32 "scripts/genksyms/keywords.gperf" 135#line 34 "scripts/genksyms/keywords.gperf"
136 {"restrict", RESTRICT_KEYW}, 136 {"restrict", RESTRICT_KEYW},
137#line 12 "scripts/genksyms/keywords.gperf" 137#line 12 "scripts/genksyms/keywords.gperf"
138 {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW}, 138 {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW},
139#line 23 "scripts/genksyms/keywords.gperf" 139#line 23 "scripts/genksyms/keywords.gperf"
140 {"__inline__", INLINE_KEYW}, 140 {"__inline__", INLINE_KEYW},
141 {""}, 141 {""},
142#line 27 "scripts/genksyms/keywords.gperf" 142#line 29 "scripts/genksyms/keywords.gperf"
143 {"__volatile__", VOLATILE_KEYW}, 143 {"__volatile__", VOLATILE_KEYW},
144#line 10 "scripts/genksyms/keywords.gperf" 144#line 10 "scripts/genksyms/keywords.gperf"
145 {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW}, 145 {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW},
146#line 30 "scripts/genksyms/keywords.gperf" 146#line 32 "scripts/genksyms/keywords.gperf"
147 {"_restrict", RESTRICT_KEYW}, 147 {"_restrict", RESTRICT_KEYW},
148 {""}, 148 {""},
149#line 17 "scripts/genksyms/keywords.gperf" 149#line 17 "scripts/genksyms/keywords.gperf"
@@ -152,56 +152,65 @@ is_reserved_word (register const char *str, register unsigned int len)
152 {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, 152 {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW},
153#line 21 "scripts/genksyms/keywords.gperf" 153#line 21 "scripts/genksyms/keywords.gperf"
154 {"__extension__", EXTENSION_KEYW}, 154 {"__extension__", EXTENSION_KEYW},
155#line 42 "scripts/genksyms/keywords.gperf" 155#line 44 "scripts/genksyms/keywords.gperf"
156 {"enum", ENUM_KEYW}, 156 {"enum", ENUM_KEYW},
157#line 13 "scripts/genksyms/keywords.gperf" 157#line 13 "scripts/genksyms/keywords.gperf"
158 {"EXPORT_UNUSED_SYMBOL", EXPORT_SYMBOL_KEYW}, 158 {"EXPORT_UNUSED_SYMBOL", EXPORT_SYMBOL_KEYW},
159#line 43 "scripts/genksyms/keywords.gperf" 159#line 45 "scripts/genksyms/keywords.gperf"
160 {"extern", EXTERN_KEYW}, 160 {"extern", EXTERN_KEYW},
161 {""}, 161 {""},
162#line 24 "scripts/genksyms/keywords.gperf" 162#line 24 "scripts/genksyms/keywords.gperf"
163 {"__signed", SIGNED_KEYW}, 163 {"__signed", SIGNED_KEYW},
164#line 14 "scripts/genksyms/keywords.gperf" 164#line 14 "scripts/genksyms/keywords.gperf"
165 {"EXPORT_UNUSED_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, 165 {"EXPORT_UNUSED_SYMBOL_GPL", EXPORT_SYMBOL_KEYW},
166#line 54 "scripts/genksyms/keywords.gperf" 166#line 57 "scripts/genksyms/keywords.gperf"
167 {"union", UNION_KEYW}, 167 {"union", UNION_KEYW},
168#line 58 "scripts/genksyms/keywords.gperf" 168 {""}, {""},
169 {"typeof", TYPEOF_KEYW},
170#line 53 "scripts/genksyms/keywords.gperf"
171 {"typedef", TYPEDEF_KEYW},
172#line 22 "scripts/genksyms/keywords.gperf" 169#line 22 "scripts/genksyms/keywords.gperf"
173 {"__inline", INLINE_KEYW}, 170 {"__inline", INLINE_KEYW},
174#line 38 "scripts/genksyms/keywords.gperf" 171#line 40 "scripts/genksyms/keywords.gperf"
175 {"auto", AUTO_KEYW}, 172 {"auto", AUTO_KEYW},
176#line 26 "scripts/genksyms/keywords.gperf" 173#line 28 "scripts/genksyms/keywords.gperf"
177 {"__volatile", VOLATILE_KEYW}, 174 {"__volatile", VOLATILE_KEYW},
178 {""}, {""}, 175 {""}, {""},
179#line 55 "scripts/genksyms/keywords.gperf" 176#line 58 "scripts/genksyms/keywords.gperf"
180 {"unsigned", UNSIGNED_KEYW}, 177 {"unsigned", UNSIGNED_KEYW},
181 {""}, 178 {""},
182#line 49 "scripts/genksyms/keywords.gperf" 179#line 51 "scripts/genksyms/keywords.gperf"
183 {"short", SHORT_KEYW}, 180 {"short", SHORT_KEYW},
184#line 45 "scripts/genksyms/keywords.gperf" 181#line 47 "scripts/genksyms/keywords.gperf"
185 {"inline", INLINE_KEYW}, 182 {"inline", INLINE_KEYW},
186 {""}, 183 {""},
187#line 57 "scripts/genksyms/keywords.gperf" 184#line 60 "scripts/genksyms/keywords.gperf"
188 {"volatile", VOLATILE_KEYW}, 185 {"volatile", VOLATILE_KEYW},
189#line 47 "scripts/genksyms/keywords.gperf" 186#line 49 "scripts/genksyms/keywords.gperf"
190 {"long", LONG_KEYW}, 187 {"long", LONG_KEYW},
191#line 29 "scripts/genksyms/keywords.gperf" 188#line 31 "scripts/genksyms/keywords.gperf"
192 {"_Bool", BOOL_KEYW}, 189 {"_Bool", BOOL_KEYW},
193 {""}, {""}, 190 {""}, {""},
194#line 48 "scripts/genksyms/keywords.gperf" 191#line 50 "scripts/genksyms/keywords.gperf"
195 {"register", REGISTER_KEYW}, 192 {"register", REGISTER_KEYW},
196#line 56 "scripts/genksyms/keywords.gperf" 193#line 59 "scripts/genksyms/keywords.gperf"
197 {"void", VOID_KEYW}, 194 {"void", VOID_KEYW},
198#line 44 "scripts/genksyms/keywords.gperf" 195 {""},
199 {"float", FLOAT_KEYW}, 196#line 43 "scripts/genksyms/keywords.gperf"
200#line 41 "scripts/genksyms/keywords.gperf"
201 {"double", DOUBLE_KEYW}, 197 {"double", DOUBLE_KEYW},
198 {""},
199#line 26 "scripts/genksyms/keywords.gperf"
200 {"__typeof", TYPEOF_KEYW},
201 {""}, {""},
202#line 52 "scripts/genksyms/keywords.gperf"
203 {"signed", SIGNED_KEYW},
202 {""}, {""}, {""}, {""}, 204 {""}, {""}, {""}, {""},
203#line 50 "scripts/genksyms/keywords.gperf" 205#line 56 "scripts/genksyms/keywords.gperf"
204 {"signed", SIGNED_KEYW} 206 {"typeof", TYPEOF_KEYW},
207#line 55 "scripts/genksyms/keywords.gperf"
208 {"typedef", TYPEDEF_KEYW},
209 {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
210 {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
211 {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
212#line 46 "scripts/genksyms/keywords.gperf"
213 {"float", FLOAT_KEYW}
205 }; 214 };
206 215
207 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) 216 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
diff --git a/scripts/genksyms/lex.l b/scripts/genksyms/lex.l
index f770071719cb..e583565f2011 100644
--- a/scripts/genksyms/lex.l
+++ b/scripts/genksyms/lex.l
@@ -129,8 +129,9 @@ int
129yylex(void) 129yylex(void)
130{ 130{
131 static enum { 131 static enum {
132 ST_NOTSTARTED, ST_NORMAL, ST_ATTRIBUTE, ST_ASM, ST_BRACKET, ST_BRACE, 132 ST_NOTSTARTED, ST_NORMAL, ST_ATTRIBUTE, ST_ASM, ST_TYPEOF, ST_TYPEOF_1,
133 ST_EXPRESSION, ST_TABLE_1, ST_TABLE_2, ST_TABLE_3, ST_TABLE_4, 133 ST_BRACKET, ST_BRACE, ST_EXPRESSION,
134 ST_TABLE_1, ST_TABLE_2, ST_TABLE_3, ST_TABLE_4,
134 ST_TABLE_5, ST_TABLE_6 135 ST_TABLE_5, ST_TABLE_6
135 } lexstate = ST_NOTSTARTED; 136 } lexstate = ST_NOTSTARTED;
136 137
@@ -198,6 +199,10 @@ repeat:
198 lexstate = ST_ASM; 199 lexstate = ST_ASM;
199 count = 0; 200 count = 0;
200 goto repeat; 201 goto repeat;
202 case TYPEOF_KEYW:
203 lexstate = ST_TYPEOF;
204 count = 0;
205 goto repeat;
201 206
202 case STRUCT_KEYW: 207 case STRUCT_KEYW:
203 case UNION_KEYW: 208 case UNION_KEYW:
@@ -284,6 +289,48 @@ repeat:
284 } 289 }
285 break; 290 break;
286 291
292 case ST_TYPEOF:
293 switch (token)
294 {
295 case '(':
296 if ( ++count == 1 )
297 lexstate = ST_TYPEOF_1;
298 else
299 APP;
300 goto repeat;
301 case ')':
302 APP;
303 if (--count == 0)
304 {
305 lexstate = ST_NORMAL;
306 token = TYPEOF_PHRASE;
307 break;
308 }
309 goto repeat;
310 default:
311 APP;
312 goto repeat;
313 }
314 break;
315
316 case ST_TYPEOF_1:
317 if (token == IDENT)
318 {
319 if (is_reserved_word(yytext, yyleng)
320 || find_symbol(yytext, SYM_TYPEDEF, 1))
321 {
322 yyless(0);
323 unput('(');
324 lexstate = ST_NORMAL;
325 token = TYPEOF_KEYW;
326 break;
327 }
328 _APP("(", 1);
329 }
330 APP;
331 lexstate = ST_TYPEOF;
332 goto repeat;
333
287 case ST_BRACKET: 334 case ST_BRACKET:
288 APP; 335 APP;
289 switch (token) 336 switch (token)
diff --git a/scripts/genksyms/lex.lex.c_shipped b/scripts/genksyms/lex.lex.c_shipped
index 0bf4157e6161..f82740a69b85 100644
--- a/scripts/genksyms/lex.lex.c_shipped
+++ b/scripts/genksyms/lex.lex.c_shipped
@@ -1938,8 +1938,9 @@ int
1938yylex(void) 1938yylex(void)
1939{ 1939{
1940 static enum { 1940 static enum {
1941 ST_NOTSTARTED, ST_NORMAL, ST_ATTRIBUTE, ST_ASM, ST_BRACKET, ST_BRACE, 1941 ST_NOTSTARTED, ST_NORMAL, ST_ATTRIBUTE, ST_ASM, ST_TYPEOF, ST_TYPEOF_1,
1942 ST_EXPRESSION, ST_TABLE_1, ST_TABLE_2, ST_TABLE_3, ST_TABLE_4, 1942 ST_BRACKET, ST_BRACE, ST_EXPRESSION,
1943 ST_TABLE_1, ST_TABLE_2, ST_TABLE_3, ST_TABLE_4,
1943 ST_TABLE_5, ST_TABLE_6 1944 ST_TABLE_5, ST_TABLE_6
1944 } lexstate = ST_NOTSTARTED; 1945 } lexstate = ST_NOTSTARTED;
1945 1946
@@ -2007,6 +2008,10 @@ repeat:
2007 lexstate = ST_ASM; 2008 lexstate = ST_ASM;
2008 count = 0; 2009 count = 0;
2009 goto repeat; 2010 goto repeat;
2011 case TYPEOF_KEYW:
2012 lexstate = ST_TYPEOF;
2013 count = 0;
2014 goto repeat;
2010 2015
2011 case STRUCT_KEYW: 2016 case STRUCT_KEYW:
2012 case UNION_KEYW: 2017 case UNION_KEYW:
@@ -2093,6 +2098,48 @@ repeat:
2093 } 2098 }
2094 break; 2099 break;
2095 2100
2101 case ST_TYPEOF:
2102 switch (token)
2103 {
2104 case '(':
2105 if ( ++count == 1 )
2106 lexstate = ST_TYPEOF_1;
2107 else
2108 APP;
2109 goto repeat;
2110 case ')':
2111 APP;
2112 if (--count == 0)
2113 {
2114 lexstate = ST_NORMAL;
2115 token = TYPEOF_PHRASE;
2116 break;
2117 }
2118 goto repeat;
2119 default:
2120 APP;
2121 goto repeat;
2122 }
2123 break;
2124
2125 case ST_TYPEOF_1:
2126 if (token == IDENT)
2127 {
2128 if (is_reserved_word(yytext, yyleng)
2129 || find_symbol(yytext, SYM_TYPEDEF, 1))
2130 {
2131 yyless(0);
2132 unput('(');
2133 lexstate = ST_NORMAL;
2134 token = TYPEOF_KEYW;
2135 break;
2136 }
2137 _APP("(", 1);
2138 }
2139 APP;
2140 lexstate = ST_TYPEOF;
2141 goto repeat;
2142
2096 case ST_BRACKET: 2143 case ST_BRACKET:
2097 APP; 2144 APP;
2098 switch (token) 2145 switch (token)
diff --git a/scripts/genksyms/parse.tab.c_shipped b/scripts/genksyms/parse.tab.c_shipped
index ece53c79bb59..c9f0f0ce82ff 100644
--- a/scripts/genksyms/parse.tab.c_shipped
+++ b/scripts/genksyms/parse.tab.c_shipped
@@ -1,8 +1,8 @@
1/* A Bison parser, made by GNU Bison 2.5. */ 1/* A Bison parser, made by GNU Bison 2.5.1. */
2 2
3/* Bison implementation for Yacc-like parsers in C 3/* Bison implementation for Yacc-like parsers in C
4 4
5 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. 5 Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
6 6
7 This program is free software: you can redistribute it and/or modify 7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
@@ -44,7 +44,7 @@
44#define YYBISON 1 44#define YYBISON 1
45 45
46/* Bison version. */ 46/* Bison version. */
47#define YYBISON_VERSION "2.5" 47#define YYBISON_VERSION "2.5.1"
48 48
49/* Skeleton name. */ 49/* Skeleton name. */
50#define YYSKELETON_NAME "yacc.c" 50#define YYSKELETON_NAME "yacc.c"
@@ -117,6 +117,14 @@ static void record_compound(struct string_list **keyw,
117 117
118 118
119 119
120# ifndef YY_NULL
121# if defined __cplusplus && 201103L <= __cplusplus
122# define YY_NULL nullptr
123# else
124# define YY_NULL 0
125# endif
126# endif
127
120/* Enabling traces. */ 128/* Enabling traces. */
121#ifndef YYDEBUG 129#ifndef YYDEBUG
122# define YYDEBUG 1 130# define YYDEBUG 1
@@ -171,18 +179,19 @@ static void record_compound(struct string_list **keyw,
171 EXPORT_SYMBOL_KEYW = 284, 179 EXPORT_SYMBOL_KEYW = 284,
172 ASM_PHRASE = 285, 180 ASM_PHRASE = 285,
173 ATTRIBUTE_PHRASE = 286, 181 ATTRIBUTE_PHRASE = 286,
174 BRACE_PHRASE = 287, 182 TYPEOF_PHRASE = 287,
175 BRACKET_PHRASE = 288, 183 BRACE_PHRASE = 288,
176 EXPRESSION_PHRASE = 289, 184 BRACKET_PHRASE = 289,
177 CHAR = 290, 185 EXPRESSION_PHRASE = 290,
178 DOTS = 291, 186 CHAR = 291,
179 IDENT = 292, 187 DOTS = 292,
180 INT = 293, 188 IDENT = 293,
181 REAL = 294, 189 INT = 294,
182 STRING = 295, 190 REAL = 295,
183 TYPE = 296, 191 STRING = 296,
184 OTHER = 297, 192 TYPE = 297,
185 FILENAME = 298 193 OTHER = 298,
194 FILENAME = 299
186 }; 195 };
187#endif 196#endif
188 197
@@ -304,6 +313,7 @@ YYID (yyi)
304# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 313# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
305 || defined __cplusplus || defined _MSC_VER) 314 || defined __cplusplus || defined _MSC_VER)
306# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 315# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
316 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
307# ifndef EXIT_SUCCESS 317# ifndef EXIT_SUCCESS
308# define EXIT_SUCCESS 0 318# define EXIT_SUCCESS 0
309# endif 319# endif
@@ -395,20 +405,20 @@ union yyalloc
395#endif 405#endif
396 406
397#if defined YYCOPY_NEEDED && YYCOPY_NEEDED 407#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
398/* Copy COUNT objects from FROM to TO. The source and destination do 408/* Copy COUNT objects from SRC to DST. The source and destination do
399 not overlap. */ 409 not overlap. */
400# ifndef YYCOPY 410# ifndef YYCOPY
401# if defined __GNUC__ && 1 < __GNUC__ 411# if defined __GNUC__ && 1 < __GNUC__
402# define YYCOPY(To, From, Count) \ 412# define YYCOPY(Dst, Src, Count) \
403 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 413 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
404# else 414# else
405# define YYCOPY(To, From, Count) \ 415# define YYCOPY(Dst, Src, Count) \
406 do \ 416 do \
407 { \ 417 { \
408 YYSIZE_T yyi; \ 418 YYSIZE_T yyi; \
409 for (yyi = 0; yyi < (Count); yyi++) \ 419 for (yyi = 0; yyi < (Count); yyi++) \
410 (To)[yyi] = (From)[yyi]; \ 420 (Dst)[yyi] = (Src)[yyi]; \
411 } \ 421 } \
412 while (YYID (0)) 422 while (YYID (0))
413# endif 423# endif
414# endif 424# endif
@@ -417,20 +427,20 @@ union yyalloc
417/* YYFINAL -- State number of the termination state. */ 427/* YYFINAL -- State number of the termination state. */
418#define YYFINAL 4 428#define YYFINAL 4
419/* YYLAST -- Last index in YYTABLE. */ 429/* YYLAST -- Last index in YYTABLE. */
420#define YYLAST 532 430#define YYLAST 514
421 431
422/* YYNTOKENS -- Number of terminals. */ 432/* YYNTOKENS -- Number of terminals. */
423#define YYNTOKENS 53 433#define YYNTOKENS 54
424/* YYNNTS -- Number of nonterminals. */ 434/* YYNNTS -- Number of nonterminals. */
425#define YYNNTS 49 435#define YYNNTS 49
426/* YYNRULES -- Number of rules. */ 436/* YYNRULES -- Number of rules. */
427#define YYNRULES 132 437#define YYNRULES 132
428/* YYNRULES -- Number of states. */ 438/* YYNRULES -- Number of states. */
429#define YYNSTATES 188 439#define YYNSTATES 187
430 440
431/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 441/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
432#define YYUNDEFTOK 2 442#define YYUNDEFTOK 2
433#define YYMAXUTOK 298 443#define YYMAXUTOK 299
434 444
435#define YYTRANSLATE(YYX) \ 445#define YYTRANSLATE(YYX) \
436 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 446 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -442,15 +452,15 @@ static const yytype_uint8 yytranslate[] =
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 47, 49, 48, 2, 46, 2, 2, 2, 2, 2, 455 48, 49, 50, 2, 47, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 52, 44, 456 2, 2, 2, 2, 2, 2, 2, 2, 53, 45,
447 2, 50, 2, 2, 2, 2, 2, 2, 2, 2, 457 2, 51, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 51, 2, 45, 2, 2, 2, 2, 463 2, 2, 2, 52, 2, 46, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -467,7 +477,7 @@ static const yytype_uint8 yytranslate[] =
467 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 477 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
468 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 478 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
469 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 479 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
470 35, 36, 37, 38, 39, 40, 41, 42, 43 480 35, 36, 37, 38, 39, 40, 41, 42, 43, 44
471}; 481};
472 482
473#if YYDEBUG 483#if YYDEBUG
@@ -478,78 +488,77 @@ static const yytype_uint16 yyprhs[] =
478 0, 0, 3, 5, 8, 9, 12, 13, 18, 19, 488 0, 0, 3, 5, 8, 9, 12, 13, 18, 19,
479 23, 25, 27, 29, 31, 34, 37, 41, 42, 44, 489 23, 25, 27, 29, 31, 34, 37, 41, 42, 44,
480 46, 50, 55, 56, 58, 60, 63, 65, 67, 69, 490 46, 50, 55, 56, 58, 60, 63, 65, 67, 69,
481 71, 73, 75, 77, 79, 81, 87, 92, 95, 98, 491 71, 73, 75, 77, 79, 81, 86, 88, 91, 94,
482 101, 105, 109, 113, 116, 119, 122, 124, 126, 128, 492 97, 101, 105, 109, 112, 115, 118, 120, 122, 124,
483 130, 132, 134, 136, 138, 140, 142, 144, 147, 148, 493 126, 128, 130, 132, 134, 136, 138, 140, 143, 144,
484 150, 152, 155, 157, 159, 161, 163, 166, 168, 170, 494 146, 148, 151, 153, 155, 157, 159, 162, 164, 166,
485 175, 180, 183, 187, 191, 194, 196, 198, 200, 205, 495 171, 176, 179, 183, 187, 190, 192, 194, 196, 201,
486 210, 213, 217, 221, 224, 226, 230, 231, 233, 235, 496 206, 209, 213, 217, 220, 222, 226, 227, 229, 231,
487 239, 242, 245, 247, 248, 250, 252, 257, 262, 265, 497 235, 238, 241, 243, 244, 246, 248, 253, 258, 261,
488 269, 273, 277, 278, 280, 283, 287, 291, 292, 294, 498 265, 269, 273, 274, 276, 279, 283, 287, 288, 290,
489 296, 299, 303, 306, 307, 309, 311, 315, 318, 321, 499 292, 295, 299, 302, 303, 305, 307, 311, 314, 317,
490 323, 326, 327, 330, 334, 339, 341, 345, 347, 351, 500 319, 322, 323, 326, 330, 335, 337, 341, 343, 347,
491 354, 355, 357 501 350, 351, 353
492}; 502};
493 503
494/* YYRHS -- A `-1'-separated list of the rules' RHS. */ 504/* YYRHS -- A `-1'-separated list of the rules' RHS. */
495static const yytype_int8 yyrhs[] = 505static const yytype_int8 yyrhs[] =
496{ 506{
497 54, 0, -1, 55, -1, 54, 55, -1, -1, 56, 507 55, 0, -1, 56, -1, 55, 56, -1, -1, 57,
498 57, -1, -1, 12, 23, 58, 60, -1, -1, 23, 508 58, -1, -1, 12, 23, 59, 61, -1, -1, 23,
499 59, 60, -1, 60, -1, 84, -1, 99, -1, 101, 509 60, 61, -1, 61, -1, 85, -1, 100, -1, 102,
500 -1, 1, 44, -1, 1, 45, -1, 64, 61, 44, 510 -1, 1, 45, -1, 1, 46, -1, 65, 62, 45,
501 -1, -1, 62, -1, 63, -1, 62, 46, 63, -1, 511 -1, -1, 63, -1, 64, -1, 63, 47, 64, -1,
502 74, 100, 95, 85, -1, -1, 65, -1, 66, -1, 512 75, 101, 96, 86, -1, -1, 66, -1, 67, -1,
503 65, 66, -1, 67, -1, 68, -1, 5, -1, 17, 513 66, 67, -1, 68, -1, 69, -1, 5, -1, 17,
504 -1, 21, -1, 11, -1, 14, -1, 69, -1, 73, 514 -1, 21, -1, 11, -1, 14, -1, 70, -1, 74,
505 -1, 28, 47, 65, 48, 49, -1, 28, 47, 65, 515 -1, 28, 48, 82, 49, -1, 32, -1, 22, 38,
506 49, -1, 22, 37, -1, 24, 37, -1, 10, 37, 516 -1, 24, 38, -1, 10, 38, -1, 22, 38, 88,
507 -1, 22, 37, 87, -1, 24, 37, 87, -1, 10, 517 -1, 24, 38, 88, -1, 10, 38, 97, -1, 10,
508 37, 96, -1, 10, 96, -1, 22, 87, -1, 24, 518 97, -1, 22, 88, -1, 24, 88, -1, 7, -1,
509 87, -1, 7, -1, 19, -1, 15, -1, 16, -1, 519 19, -1, 15, -1, 16, -1, 20, -1, 25, -1,
510 20, -1, 25, -1, 13, -1, 9, -1, 26, -1, 520 13, -1, 9, -1, 26, -1, 6, -1, 42, -1,
511 6, -1, 41, -1, 48, 71, -1, -1, 72, -1, 521 50, 72, -1, -1, 73, -1, 74, -1, 73, 74,
512 73, -1, 72, 73, -1, 8, -1, 27, -1, 31, 522 -1, 8, -1, 27, -1, 31, -1, 18, -1, 71,
513 -1, 18, -1, 70, 74, -1, 75, -1, 37, -1, 523 75, -1, 76, -1, 38, -1, 76, 48, 79, 49,
514 75, 47, 78, 49, -1, 75, 47, 1, 49, -1, 524 -1, 76, 48, 1, 49, -1, 76, 34, -1, 48,
515 75, 33, -1, 47, 74, 49, -1, 47, 1, 49, 525 75, 49, -1, 48, 1, 49, -1, 71, 77, -1,
516 -1, 70, 76, -1, 77, -1, 37, -1, 41, -1, 526 78, -1, 38, -1, 42, -1, 78, 48, 79, 49,
517 77, 47, 78, 49, -1, 77, 47, 1, 49, -1, 527 -1, 78, 48, 1, 49, -1, 78, 34, -1, 48,
518 77, 33, -1, 47, 76, 49, -1, 47, 1, 49, 528 77, 49, -1, 48, 1, 49, -1, 80, 37, -1,
519 -1, 79, 36, -1, 79, -1, 80, 46, 36, -1, 529 80, -1, 81, 47, 37, -1, -1, 81, -1, 82,
520 -1, 80, -1, 81, -1, 80, 46, 81, -1, 65, 530 -1, 81, 47, 82, -1, 66, 83, -1, 71, 83,
521 82, -1, 70, 82, -1, 83, -1, -1, 37, -1, 531 -1, 84, -1, -1, 38, -1, 42, -1, 84, 48,
522 41, -1, 83, 47, 78, 49, -1, 83, 47, 1, 532 79, 49, -1, 84, 48, 1, 49, -1, 84, 34,
523 49, -1, 83, 33, -1, 47, 82, 49, -1, 47, 533 -1, 48, 83, 49, -1, 48, 1, 49, -1, 65,
524 1, 49, -1, 64, 74, 32, -1, -1, 86, -1, 534 75, 33, -1, -1, 87, -1, 51, 35, -1, 52,
525 50, 34, -1, 51, 88, 45, -1, 51, 1, 45, 535 89, 46, -1, 52, 1, 46, -1, -1, 90, -1,
526 -1, -1, 89, -1, 90, -1, 89, 90, -1, 64, 536 91, -1, 90, 91, -1, 65, 92, 45, -1, 1,
527 91, 44, -1, 1, 44, -1, -1, 92, -1, 93, 537 45, -1, -1, 93, -1, 94, -1, 93, 47, 94,
528 -1, 92, 46, 93, -1, 76, 95, -1, 37, 94, 538 -1, 77, 96, -1, 38, 95, -1, 95, -1, 53,
529 -1, 94, -1, 52, 34, -1, -1, 95, 31, -1, 539 35, -1, -1, 96, 31, -1, 52, 98, 46, -1,
530 51, 97, 45, -1, 51, 97, 46, 45, -1, 98, 540 52, 98, 47, 46, -1, 99, -1, 98, 47, 99,
531 -1, 97, 46, 98, -1, 37, -1, 37, 50, 34, 541 -1, 38, -1, 38, 51, 35, -1, 30, 45, -1,
532 -1, 30, 44, -1, -1, 30, -1, 29, 47, 37, 542 -1, 30, -1, 29, 48, 38, 49, 45, -1
533 49, 44, -1
534}; 543};
535 544
536/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 545/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
537static const yytype_uint16 yyrline[] = 546static const yytype_uint16 yyrline[] =
538{ 547{
539 0, 123, 123, 124, 128, 128, 134, 134, 136, 136, 548 0, 124, 124, 125, 129, 129, 135, 135, 137, 137,
540 138, 139, 140, 141, 142, 143, 147, 161, 162, 166, 549 139, 140, 141, 142, 143, 144, 148, 162, 163, 167,
541 174, 187, 193, 194, 198, 199, 203, 209, 213, 214, 550 175, 188, 194, 195, 199, 200, 204, 210, 214, 215,
542 215, 216, 217, 221, 222, 223, 224, 228, 230, 232, 551 216, 217, 218, 222, 223, 224, 225, 229, 231, 233,
543 236, 238, 240, 245, 248, 249, 253, 254, 255, 256, 552 237, 239, 241, 246, 249, 250, 254, 255, 256, 257,
544 257, 258, 259, 260, 261, 262, 263, 267, 272, 273, 553 258, 259, 260, 261, 262, 263, 264, 268, 273, 274,
545 277, 278, 282, 282, 282, 283, 291, 292, 296, 305, 554 278, 279, 283, 283, 283, 284, 292, 293, 297, 306,
546 307, 309, 311, 313, 320, 321, 325, 326, 327, 329, 555 308, 310, 312, 314, 321, 322, 326, 327, 328, 330,
547 331, 333, 335, 340, 341, 342, 346, 347, 351, 352, 556 332, 334, 336, 341, 342, 343, 347, 348, 352, 353,
548 357, 362, 364, 368, 369, 377, 381, 383, 385, 387, 557 358, 363, 365, 369, 370, 378, 382, 384, 386, 388,
549 389, 394, 403, 404, 409, 414, 415, 419, 420, 424, 558 390, 395, 404, 405, 410, 415, 416, 420, 421, 425,
550 425, 429, 431, 436, 437, 441, 442, 446, 447, 448, 559 426, 430, 432, 437, 438, 442, 443, 447, 448, 449,
551 452, 456, 457, 461, 462, 466, 467, 470, 475, 483, 560 453, 457, 458, 462, 463, 467, 468, 471, 476, 484,
552 487, 488, 492 561 488, 489, 493
553}; 562};
554#endif 563#endif
555 564
@@ -565,9 +574,9 @@ static const char *const yytname[] =
565 "SHORT_KEYW", "SIGNED_KEYW", "STATIC_KEYW", "STRUCT_KEYW", 574 "SHORT_KEYW", "SIGNED_KEYW", "STATIC_KEYW", "STRUCT_KEYW",
566 "TYPEDEF_KEYW", "UNION_KEYW", "UNSIGNED_KEYW", "VOID_KEYW", 575 "TYPEDEF_KEYW", "UNION_KEYW", "UNSIGNED_KEYW", "VOID_KEYW",
567 "VOLATILE_KEYW", "TYPEOF_KEYW", "EXPORT_SYMBOL_KEYW", "ASM_PHRASE", 576 "VOLATILE_KEYW", "TYPEOF_KEYW", "EXPORT_SYMBOL_KEYW", "ASM_PHRASE",
568 "ATTRIBUTE_PHRASE", "BRACE_PHRASE", "BRACKET_PHRASE", 577 "ATTRIBUTE_PHRASE", "TYPEOF_PHRASE", "BRACE_PHRASE", "BRACKET_PHRASE",
569 "EXPRESSION_PHRASE", "CHAR", "DOTS", "IDENT", "INT", "REAL", "STRING", 578 "EXPRESSION_PHRASE", "CHAR", "DOTS", "IDENT", "INT", "REAL", "STRING",
570 "TYPE", "OTHER", "FILENAME", "';'", "'}'", "','", "'('", "'*'", "')'", 579 "TYPE", "OTHER", "FILENAME", "';'", "'}'", "','", "'('", "')'", "'*'",
571 "'='", "'{'", "':'", "$accept", "declaration_seq", "declaration", "$@1", 580 "'='", "'{'", "':'", "$accept", "declaration_seq", "declaration", "$@1",
572 "declaration1", "$@2", "$@3", "simple_declaration", 581 "declaration1", "$@2", "$@3", "simple_declaration",
573 "init_declarator_list_opt", "init_declarator_list", "init_declarator", 582 "init_declarator_list_opt", "init_declarator_list", "init_declarator",
@@ -584,7 +593,7 @@ static const char *const yytname[] =
584 "member_declarator_list_opt", "member_declarator_list", 593 "member_declarator_list_opt", "member_declarator_list",
585 "member_declarator", "member_bitfield_declarator", "attribute_opt", 594 "member_declarator", "member_bitfield_declarator", "attribute_opt",
586 "enum_body", "enumerator_list", "enumerator", "asm_definition", 595 "enum_body", "enumerator_list", "enumerator", "asm_definition",
587 "asm_phrase_opt", "export_definition", 0 596 "asm_phrase_opt", "export_definition", YY_NULL
588}; 597};
589#endif 598#endif
590 599
@@ -597,28 +606,28 @@ static const yytype_uint16 yytoknum[] =
597 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 606 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
598 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 607 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
599 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 608 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
600 295, 296, 297, 298, 59, 125, 44, 40, 42, 41, 609 295, 296, 297, 298, 299, 59, 125, 44, 40, 41,
601 61, 123, 58 610 42, 61, 123, 58
602}; 611};
603# endif 612# endif
604 613
605/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 614/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
606static const yytype_uint8 yyr1[] = 615static const yytype_uint8 yyr1[] =
607{ 616{
608 0, 53, 54, 54, 56, 55, 58, 57, 59, 57, 617 0, 54, 55, 55, 57, 56, 59, 58, 60, 58,
609 57, 57, 57, 57, 57, 57, 60, 61, 61, 62, 618 58, 58, 58, 58, 58, 58, 61, 62, 62, 63,
610 62, 63, 64, 64, 65, 65, 66, 66, 67, 67, 619 63, 64, 65, 65, 66, 66, 67, 67, 68, 68,
611 67, 67, 67, 68, 68, 68, 68, 68, 68, 68, 620 68, 68, 68, 69, 69, 69, 69, 69, 69, 69,
612 68, 68, 68, 68, 68, 68, 69, 69, 69, 69, 621 69, 69, 69, 69, 69, 69, 70, 70, 70, 70,
613 69, 69, 69, 69, 69, 69, 69, 70, 71, 71, 622 70, 70, 70, 70, 70, 70, 70, 71, 72, 72,
614 72, 72, 73, 73, 73, 73, 74, 74, 75, 75, 623 73, 73, 74, 74, 74, 74, 75, 75, 76, 76,
615 75, 75, 75, 75, 76, 76, 77, 77, 77, 77, 624 76, 76, 76, 76, 77, 77, 78, 78, 78, 78,
616 77, 77, 77, 78, 78, 78, 79, 79, 80, 80, 625 78, 78, 78, 79, 79, 79, 80, 80, 81, 81,
617 81, 82, 82, 83, 83, 83, 83, 83, 83, 83, 626 82, 83, 83, 84, 84, 84, 84, 84, 84, 84,
618 83, 84, 85, 85, 86, 87, 87, 88, 88, 89, 627 84, 85, 86, 86, 87, 88, 88, 89, 89, 90,
619 89, 90, 90, 91, 91, 92, 92, 93, 93, 93, 628 90, 91, 91, 92, 92, 93, 93, 94, 94, 94,
620 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 629 95, 96, 96, 97, 97, 98, 98, 99, 99, 100,
621 100, 100, 101 630 101, 101, 102
622}; 631};
623 632
624/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 633/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
@@ -627,7 +636,7 @@ static const yytype_uint8 yyr2[] =
627 0, 2, 1, 2, 0, 2, 0, 4, 0, 3, 636 0, 2, 1, 2, 0, 2, 0, 4, 0, 3,
628 1, 1, 1, 1, 2, 2, 3, 0, 1, 1, 637 1, 1, 1, 1, 2, 2, 3, 0, 1, 1,
629 3, 4, 0, 1, 1, 2, 1, 1, 1, 1, 638 3, 4, 0, 1, 1, 2, 1, 1, 1, 1,
630 1, 1, 1, 1, 1, 5, 4, 2, 2, 2, 639 1, 1, 1, 1, 1, 4, 1, 2, 2, 2,
631 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 640 3, 3, 3, 2, 2, 2, 1, 1, 1, 1,
632 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 641 1, 1, 1, 1, 1, 1, 1, 2, 0, 1,
633 1, 2, 1, 1, 1, 1, 2, 1, 1, 4, 642 1, 2, 1, 1, 1, 1, 2, 1, 1, 4,
@@ -648,68 +657,68 @@ static const yytype_uint8 yydefact[] =
648 4, 4, 2, 0, 1, 3, 0, 28, 55, 46, 657 4, 4, 2, 0, 1, 3, 0, 28, 55, 46,
649 62, 53, 0, 31, 0, 52, 32, 48, 49, 29, 658 62, 53, 0, 31, 0, 52, 32, 48, 49, 29,
650 65, 47, 50, 30, 0, 8, 0, 51, 54, 63, 659 65, 47, 50, 30, 0, 8, 0, 51, 54, 63,
651 0, 0, 0, 64, 56, 5, 10, 17, 23, 24, 660 0, 0, 0, 64, 36, 56, 5, 10, 17, 23,
652 26, 27, 33, 34, 11, 12, 13, 14, 15, 39, 661 24, 26, 27, 33, 34, 11, 12, 13, 14, 15,
653 0, 43, 6, 37, 0, 44, 22, 38, 45, 0, 662 39, 0, 43, 6, 37, 0, 44, 22, 38, 45,
654 0, 129, 68, 0, 58, 0, 18, 19, 0, 130, 663 0, 0, 129, 68, 0, 58, 0, 18, 19, 0,
655 67, 25, 42, 127, 0, 125, 22, 40, 0, 113, 664 130, 67, 25, 42, 127, 0, 125, 22, 40, 0,
656 0, 0, 109, 9, 17, 41, 0, 0, 0, 0, 665 113, 0, 0, 109, 9, 17, 41, 93, 0, 0,
657 57, 59, 60, 16, 0, 66, 131, 101, 121, 71, 666 0, 0, 57, 59, 60, 16, 0, 66, 131, 101,
658 0, 0, 123, 0, 7, 112, 106, 76, 77, 0, 667 121, 71, 0, 0, 123, 0, 7, 112, 106, 76,
659 0, 0, 121, 75, 0, 114, 115, 119, 105, 0, 668 77, 0, 0, 0, 121, 75, 0, 114, 115, 119,
660 110, 130, 0, 36, 0, 73, 72, 61, 20, 102, 669 105, 0, 110, 130, 94, 56, 0, 93, 90, 92,
661 0, 93, 0, 84, 87, 88, 128, 124, 126, 118, 670 35, 0, 73, 72, 61, 20, 102, 0, 0, 84,
662 0, 76, 0, 120, 74, 117, 80, 0, 111, 0, 671 87, 88, 128, 124, 126, 118, 0, 76, 0, 120,
663 35, 132, 122, 0, 21, 103, 70, 94, 56, 0, 672 74, 117, 80, 0, 111, 0, 0, 95, 0, 91,
664 93, 90, 92, 69, 83, 0, 82, 81, 0, 0, 673 98, 0, 132, 122, 0, 21, 103, 70, 69, 83,
665 116, 104, 0, 95, 0, 91, 98, 0, 85, 89, 674 0, 82, 81, 0, 0, 116, 100, 99, 0, 0,
666 79, 78, 100, 99, 0, 0, 97, 96 675 104, 85, 89, 79, 78, 97, 96
667}; 676};
668 677
669/* YYDEFGOTO[NTERM-NUM]. */ 678/* YYDEFGOTO[NTERM-NUM]. */
670static const yytype_int16 yydefgoto[] = 679static const yytype_int16 yydefgoto[] =
671{ 680{
672 -1, 1, 2, 3, 35, 76, 56, 36, 65, 66, 681 -1, 1, 2, 3, 36, 77, 57, 37, 66, 67,
673 67, 79, 38, 39, 40, 41, 42, 68, 90, 91, 682 68, 80, 39, 40, 41, 42, 43, 69, 92, 93,
674 43, 121, 70, 112, 113, 132, 133, 134, 135, 161, 683 44, 123, 71, 114, 115, 138, 139, 140, 141, 128,
675 162, 44, 154, 155, 55, 80, 81, 82, 114, 115, 684 129, 45, 165, 166, 56, 81, 82, 83, 116, 117,
676 116, 117, 129, 51, 74, 75, 45, 98, 46 685 118, 119, 136, 52, 75, 76, 46, 100, 47
677}; 686};
678 687
679/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 688/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
680 STATE-NUM. */ 689 STATE-NUM. */
681#define YYPACT_NINF -135 690#define YYPACT_NINF -140
682static const yytype_int16 yypact[] = 691static const yytype_int16 yypact[] =
683{ 692{
684 -135, 20, -135, 321, -135, -135, 30, -135, -135, -135, 693 -140, 29, -140, 207, -140, -140, 40, -140, -140, -140,
685 -135, -135, -28, -135, 2, -135, -135, -135, -135, -135, 694 -140, -140, -27, -140, 44, -140, -140, -140, -140, -140,
686 -135, -135, -135, -135, -6, -135, 9, -135, -135, -135, 695 -140, -140, -140, -140, -22, -140, -18, -140, -140, -140,
687 -5, 15, -17, -135, -135, -135, -135, 18, 491, -135, 696 -9, 22, 28, -140, -140, -140, -140, -140, 42, 472,
688 -135, -135, -135, -135, -135, -135, -135, -135, -135, -22, 697 -140, -140, -140, -140, -140, -140, -140, -140, -140, -140,
689 31, -135, -135, 19, 106, -135, 491, 19, -135, 491, 698 46, 43, -140, -140, 47, 107, -140, 472, 47, -140,
690 50, -135, -135, 11, -3, 51, 57, -135, 18, -14, 699 472, 62, -140, -140, 16, -3, 57, 56, -140, 42,
691 14, -135, -135, 48, 46, -135, 491, -135, 33, 32, 700 35, -11, -140, -140, 53, 48, -140, 472, -140, 51,
692 59, 154, -135, -135, 18, -135, 365, 56, 60, 61, 701 21, 59, 157, -140, -140, 42, -140, 388, 58, 60,
693 -135, -3, -135, -135, 18, -135, -135, -135, -135, -135, 702 70, 81, -140, -3, -140, -140, 42, -140, -140, -140,
694 202, 74, -135, -23, -135, -135, -135, 77, -135, 16, 703 -140, -140, 253, 71, -140, -20, -140, -140, -140, 83,
695 101, 49, -135, 34, 92, 93, -135, -135, -135, 94, 704 -140, 5, 102, 34, -140, 12, 95, 94, -140, -140,
696 -135, 110, 95, -135, 97, -135, -135, -135, -135, -20, 705 -140, 97, -140, 113, -140, -140, 2, 41, -140, 27,
697 96, 410, 99, 113, 100, -135, -135, -135, -135, -135, 706 -140, 99, -140, -140, -140, -140, -24, 98, 101, 109,
698 103, -135, 107, -135, -135, 111, -135, 239, -135, 32, 707 104, -140, -140, -140, -140, -140, 105, -140, 110, -140,
699 -135, -135, -135, 123, -135, -135, -135, -135, -135, 3, 708 -140, 117, -140, 298, -140, 21, 112, -140, 120, -140,
700 52, -135, 38, -135, -135, 454, -135, -135, 117, 128, 709 -140, 343, -140, -140, 121, -140, -140, -140, -140, -140,
701 -135, -135, 134, -135, 135, -135, -135, 276, -135, -135, 710 434, -140, -140, 131, 137, -140, -140, -140, 138, 141,
702 -135, -135, -135, -135, 137, 138, -135, -135 711 -140, -140, -140, -140, -140, -140, -140
703}; 712};
704 713
705/* YYPGOTO[NTERM-NUM]. */ 714/* YYPGOTO[NTERM-NUM]. */
706static const yytype_int16 yypgoto[] = 715static const yytype_int16 yypgoto[] =
707{ 716{
708 -135, -135, 187, -135, -135, -135, -135, -50, -135, -135, 717 -140, -140, 190, -140, -140, -140, -140, -45, -140, -140,
709 98, 0, -59, -37, -135, -135, -135, -77, -135, -135, 718 96, 1, -60, -31, -140, -140, -140, -78, -140, -140,
710 -54, -30, -135, -90, -135, -134, -135, -135, 24, -58, 719 -55, -7, -140, -92, -140, -139, -140, -140, -59, -39,
711 -135, -135, -135, -135, -18, -135, -135, 109, -135, -135, 720 -140, -140, -140, -140, -13, -140, -140, 111, -140, -140,
712 44, 87, 84, 148, -135, 102, -135, -135, -135 721 39, 87, 84, 147, -140, 106, -140, -140, -140
713}; 722};
714 723
715/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 724/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
@@ -718,149 +727,145 @@ static const yytype_int16 yypgoto[] =
718#define YYTABLE_NINF -109 727#define YYTABLE_NINF -109
719static const yytype_int16 yytable[] = 728static const yytype_int16 yytable[] =
720{ 729{
721 86, 71, 111, 37, 172, 10, 83, 69, 58, 49, 730 87, 88, 113, 156, 38, 10, 146, 163, 72, 127,
722 92, 152, 88, 169, 73, 20, 96, 140, 97, 142, 731 94, 50, 84, 59, 174, 20, 54, 90, 74, 148,
723 4, 144, 137, 50, 29, 52, 104, 61, 33, 50, 732 58, 150, 179, 101, 29, 51, 143, 164, 33, 4,
724 153, 53, 111, 89, 111, 77, -93, 127, 95, 85, 733 55, 70, 106, 113, 55, 113, -93, 102, 134, 60,
725 157, 131, 59, 185, 173, 54, 57, 99, 62, 71, 734 124, 78, 87, 147, 157, 86, 152, 110, 127, 127,
726 159, 64, -93, 141, 160, 62, 84, 108, 63, 64, 735 126, -93, 65, 111, 63, 65, 72, 91, 85, 109,
727 54, 100, 60, 109, 64, 63, 64, 146, 73, 107, 736 153, 160, 97, 110, 64, 98, 65, 53, 99, 111,
728 54, 176, 111, 108, 47, 48, 84, 105, 106, 109, 737 61, 65, 147, 62, 112, 161, 110, 113, 85, 124,
729 64, 147, 160, 160, 110, 177, 141, 87, 131, 157, 738 63, 74, 111, 157, 65, 48, 49, 158, 159, 126,
730 108, 102, 103, 173, 71, 93, 109, 64, 101, 159, 739 64, 65, 65, 87, 104, 105, 107, 108, 51, 55,
731 64, 174, 175, 94, 118, 124, 131, 78, 136, 125, 740 89, 87, 95, 96, 103, 120, 142, 130, 79, 131,
732 126, 7, 8, 9, 10, 11, 12, 13, 131, 15, 741 87, 182, 7, 8, 9, 10, 11, 12, 13, 132,
733 16, 17, 18, 19, 20, 21, 22, 23, 24, 110, 742 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
734 26, 27, 28, 29, 30, 143, 148, 33, 105, 149, 743 133, 26, 27, 28, 29, 30, 112, 149, 33, 34,
735 96, 151, 152, -22, 150, 156, 165, 34, 163, 164, 744 154, 155, 107, 98, 162, -22, 169, 167, 163, 35,
736 -22, -107, 166, -22, -22, 119, 167, 171, -22, 7, 745 168, 170, -22, -107, 171, -22, 180, -22, 121, 172,
737 8, 9, 10, 11, 12, 13, 180, 15, 16, 17, 746 -22, 176, 7, 8, 9, 10, 11, 12, 13, 177,
738 18, 19, 20, 21, 22, 23, 24, 181, 26, 27, 747 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
739 28, 29, 30, 182, 183, 33, 186, 187, 5, 179, 748 183, 26, 27, 28, 29, 30, 184, 185, 33, 34,
740 120, -22, 128, 170, 139, 34, 145, 72, -22, -108, 749 186, 5, 135, 122, 175, -22, 145, 73, 151, 35,
741 0, -22, -22, 130, 0, 138, -22, 7, 8, 9, 750 0, 0, -22, -108, 0, -22, 0, -22, 6, 0,
742 10, 11, 12, 13, 0, 15, 16, 17, 18, 19, 751 -22, 144, 7, 8, 9, 10, 11, 12, 13, 14,
743 20, 21, 22, 23, 24, 0, 26, 27, 28, 29, 752 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
744 30, 0, 0, 33, 0, 0, 0, 0, -86, 0, 753 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
745 168, 0, 0, 34, 7, 8, 9, 10, 11, 12, 754 0, 0, 0, 0, 0, -22, 0, 0, 0, 35,
746 13, -86, 15, 16, 17, 18, 19, 20, 21, 22, 755 0, 0, -22, 0, 137, -22, 0, -22, 7, 8,
747 23, 24, 0, 26, 27, 28, 29, 30, 0, 0, 756 9, 10, 11, 12, 13, 0, 15, 16, 17, 18,
748 33, 0, 0, 0, 0, -86, 0, 184, 0, 0, 757 19, 20, 21, 22, 23, 24, 0, 26, 27, 28,
749 34, 7, 8, 9, 10, 11, 12, 13, -86, 15, 758 29, 30, 0, 0, 33, 34, 0, 0, 0, 0,
750 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 759 -86, 0, 0, 0, 0, 35, 0, 0, 0, 173,
751 26, 27, 28, 29, 30, 0, 0, 33, 0, 0, 760 0, 0, -86, 7, 8, 9, 10, 11, 12, 13,
752 0, 0, -86, 0, 0, 0, 0, 34, 0, 0, 761 0, 15, 16, 17, 18, 19, 20, 21, 22, 23,
753 0, 0, 6, 0, 0, -86, 7, 8, 9, 10, 762 24, 0, 26, 27, 28, 29, 30, 0, 0, 33,
754 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 763 34, 0, 0, 0, 0, -86, 0, 0, 0, 0,
755 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 764 35, 0, 0, 0, 178, 0, 0, -86, 7, 8,
756 31, 32, 33, 0, 0, 0, 0, 0, -22, 0, 765 9, 10, 11, 12, 13, 0, 15, 16, 17, 18,
757 0, 0, 34, 0, 0, -22, 0, 0, -22, -22, 766 19, 20, 21, 22, 23, 24, 0, 26, 27, 28,
758 7, 8, 9, 10, 11, 12, 13, 0, 15, 16, 767 29, 30, 0, 0, 33, 34, 0, 0, 0, 0,
759 17, 18, 19, 20, 21, 22, 23, 24, 0, 26, 768 -86, 0, 0, 0, 0, 35, 0, 0, 0, 0,
760 27, 28, 29, 30, 0, 0, 33, 0, 0, 0, 769 0, 0, -86, 7, 8, 9, 10, 11, 12, 13,
761 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 770 0, 15, 16, 17, 18, 19, 20, 21, 22, 23,
762 0, 0, 0, 122, 123, 7, 8, 9, 10, 11, 771 24, 0, 26, 27, 28, 29, 30, 0, 0, 33,
763 12, 13, 0, 15, 16, 17, 18, 19, 20, 21, 772 34, 0, 0, 0, 0, 0, 124, 0, 0, 0,
764 22, 23, 24, 0, 26, 27, 28, 29, 30, 0, 773 125, 0, 0, 0, 0, 0, 126, 0, 65, 7,
765 0, 33, 0, 0, 0, 0, 0, 157, 0, 0,
766 0, 158, 0, 0, 0, 0, 0, 159, 64, 7,
767 8, 9, 10, 11, 12, 13, 0, 15, 16, 17, 774 8, 9, 10, 11, 12, 13, 0, 15, 16, 17,
768 18, 19, 20, 21, 22, 23, 24, 0, 26, 27, 775 18, 19, 20, 21, 22, 23, 24, 0, 26, 27,
769 28, 29, 30, 0, 0, 33, 0, 0, 0, 0, 776 28, 29, 30, 0, 0, 33, 34, 0, 0, 0,
770 178, 0, 0, 0, 0, 34, 7, 8, 9, 10, 777 0, 181, 0, 0, 0, 0, 35, 7, 8, 9,
771 11, 12, 13, 0, 15, 16, 17, 18, 19, 20, 778 10, 11, 12, 13, 0, 15, 16, 17, 18, 19,
772 21, 22, 23, 24, 0, 26, 27, 28, 29, 30, 779 20, 21, 22, 23, 24, 0, 26, 27, 28, 29,
773 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 780 30, 0, 0, 33, 34, 0, 0, 0, 0, 0,
774 0, 0, 34 781 0, 0, 0, 0, 35
775}; 782};
776 783
777#define yypact_value_is_default(yystate) \ 784#define yypact_value_is_default(yystate) \
778 ((yystate) == (-135)) 785 ((yystate) == (-140))
779 786
780#define yytable_value_is_error(yytable_value) \ 787#define yytable_value_is_error(yytable_value) \
781 YYID (0) 788 YYID (0)
782 789
783static const yytype_int16 yycheck[] = 790static const yytype_int16 yycheck[] =
784{ 791{
785 59, 38, 79, 3, 1, 8, 56, 37, 26, 37, 792 60, 60, 80, 1, 3, 8, 1, 31, 39, 87,
786 64, 31, 1, 147, 37, 18, 30, 1, 32, 109, 793 65, 38, 57, 26, 153, 18, 38, 1, 38, 111,
787 0, 111, 45, 51, 27, 23, 76, 44, 31, 51, 794 38, 113, 161, 34, 27, 52, 46, 51, 31, 0,
788 50, 37, 109, 63, 111, 53, 33, 91, 68, 57, 795 52, 38, 77, 111, 52, 113, 34, 48, 93, 48,
789 37, 100, 47, 177, 41, 51, 37, 33, 37, 86, 796 38, 54, 102, 38, 42, 58, 34, 42, 126, 127,
790 47, 48, 49, 37, 131, 37, 56, 41, 47, 48, 797 48, 49, 50, 48, 38, 50, 87, 64, 57, 38,
791 51, 47, 47, 47, 48, 47, 48, 33, 37, 37, 798 48, 34, 69, 42, 48, 30, 50, 23, 33, 48,
792 51, 33, 149, 41, 44, 45, 76, 44, 45, 47, 799 48, 50, 38, 45, 53, 48, 42, 155, 77, 38,
793 48, 47, 159, 160, 52, 47, 37, 37, 147, 37, 800 38, 38, 48, 42, 50, 45, 46, 126, 127, 48,
794 41, 45, 46, 41, 131, 44, 47, 48, 50, 47, 801 48, 50, 50, 153, 46, 47, 45, 46, 52, 52,
795 48, 159, 160, 46, 45, 49, 165, 1, 34, 49, 802 38, 161, 45, 47, 51, 46, 35, 49, 1, 49,
796 49, 5, 6, 7, 8, 9, 10, 11, 177, 13, 803 170, 170, 5, 6, 7, 8, 9, 10, 11, 49,
797 14, 15, 16, 17, 18, 19, 20, 21, 22, 52, 804 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
798 24, 25, 26, 27, 28, 34, 44, 31, 44, 46, 805 49, 24, 25, 26, 27, 28, 53, 35, 31, 32,
799 30, 44, 31, 37, 49, 49, 46, 41, 49, 36, 806 45, 47, 45, 30, 45, 38, 37, 49, 31, 42,
800 44, 45, 49, 47, 48, 1, 49, 34, 52, 5, 807 49, 47, 45, 46, 49, 48, 35, 50, 1, 49,
801 6, 7, 8, 9, 10, 11, 49, 13, 14, 15, 808 53, 49, 5, 6, 7, 8, 9, 10, 11, 49,
802 16, 17, 18, 19, 20, 21, 22, 49, 24, 25, 809 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
803 26, 27, 28, 49, 49, 31, 49, 49, 1, 165, 810 49, 24, 25, 26, 27, 28, 49, 49, 31, 32,
804 81, 37, 94, 149, 107, 41, 112, 49, 44, 45, 811 49, 1, 96, 82, 155, 38, 109, 50, 114, 42,
805 -1, 47, 48, 1, -1, 103, 52, 5, 6, 7, 812 -1, -1, 45, 46, -1, 48, -1, 50, 1, -1,
806 8, 9, 10, 11, -1, 13, 14, 15, 16, 17, 813 53, 105, 5, 6, 7, 8, 9, 10, 11, 12,
807 18, 19, 20, 21, 22, -1, 24, 25, 26, 27, 814 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
808 28, -1, -1, 31, -1, -1, -1, -1, 36, -1, 815 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
809 1, -1, -1, 41, 5, 6, 7, 8, 9, 10, 816 -1, -1, -1, -1, -1, 38, -1, -1, -1, 42,
810 11, 49, 13, 14, 15, 16, 17, 18, 19, 20, 817 -1, -1, 45, -1, 1, 48, -1, 50, 5, 6,
811 21, 22, -1, 24, 25, 26, 27, 28, -1, -1, 818 7, 8, 9, 10, 11, -1, 13, 14, 15, 16,
812 31, -1, -1, -1, -1, 36, -1, 1, -1, -1, 819 17, 18, 19, 20, 21, 22, -1, 24, 25, 26,
813 41, 5, 6, 7, 8, 9, 10, 11, 49, 13, 820 27, 28, -1, -1, 31, 32, -1, -1, -1, -1,
814 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, 821 37, -1, -1, -1, -1, 42, -1, -1, -1, 1,
815 24, 25, 26, 27, 28, -1, -1, 31, -1, -1, 822 -1, -1, 49, 5, 6, 7, 8, 9, 10, 11,
816 -1, -1, 36, -1, -1, -1, -1, 41, -1, -1, 823 -1, 13, 14, 15, 16, 17, 18, 19, 20, 21,
817 -1, -1, 1, -1, -1, 49, 5, 6, 7, 8, 824 22, -1, 24, 25, 26, 27, 28, -1, -1, 31,
818 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 825 32, -1, -1, -1, -1, 37, -1, -1, -1, -1,
819 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 826 42, -1, -1, -1, 1, -1, -1, 49, 5, 6,
820 29, 30, 31, -1, -1, -1, -1, -1, 37, -1, 827 7, 8, 9, 10, 11, -1, 13, 14, 15, 16,
821 -1, -1, 41, -1, -1, 44, -1, -1, 47, 48, 828 17, 18, 19, 20, 21, 22, -1, 24, 25, 26,
822 5, 6, 7, 8, 9, 10, 11, -1, 13, 14, 829 27, 28, -1, -1, 31, 32, -1, -1, -1, -1,
823 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, 830 37, -1, -1, -1, -1, 42, -1, -1, -1, -1,
824 25, 26, 27, 28, -1, -1, 31, -1, -1, -1, 831 -1, -1, 49, 5, 6, 7, 8, 9, 10, 11,
825 -1, -1, -1, -1, -1, -1, 41, -1, -1, -1, 832 -1, 13, 14, 15, 16, 17, 18, 19, 20, 21,
826 -1, -1, -1, 48, 49, 5, 6, 7, 8, 9, 833 22, -1, 24, 25, 26, 27, 28, -1, -1, 31,
827 10, 11, -1, 13, 14, 15, 16, 17, 18, 19, 834 32, -1, -1, -1, -1, -1, 38, -1, -1, -1,
828 20, 21, 22, -1, 24, 25, 26, 27, 28, -1, 835 42, -1, -1, -1, -1, -1, 48, -1, 50, 5,
829 -1, 31, -1, -1, -1, -1, -1, 37, -1, -1,
830 -1, 41, -1, -1, -1, -1, -1, 47, 48, 5,
831 6, 7, 8, 9, 10, 11, -1, 13, 14, 15, 836 6, 7, 8, 9, 10, 11, -1, 13, 14, 15,
832 16, 17, 18, 19, 20, 21, 22, -1, 24, 25, 837 16, 17, 18, 19, 20, 21, 22, -1, 24, 25,
833 26, 27, 28, -1, -1, 31, -1, -1, -1, -1, 838 26, 27, 28, -1, -1, 31, 32, -1, -1, -1,
834 36, -1, -1, -1, -1, 41, 5, 6, 7, 8, 839 -1, 37, -1, -1, -1, -1, 42, 5, 6, 7,
835 9, 10, 11, -1, 13, 14, 15, 16, 17, 18, 840 8, 9, 10, 11, -1, 13, 14, 15, 16, 17,
836 19, 20, 21, 22, -1, 24, 25, 26, 27, 28, 841 18, 19, 20, 21, 22, -1, 24, 25, 26, 27,
837 -1, -1, 31, -1, -1, -1, -1, -1, -1, -1, 842 28, -1, -1, 31, 32, -1, -1, -1, -1, -1,
838 -1, -1, 41 843 -1, -1, -1, -1, 42
839}; 844};
840 845
841/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 846/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
842 symbol of state STATE-NUM. */ 847 symbol of state STATE-NUM. */
843static const yytype_uint8 yystos[] = 848static const yytype_uint8 yystos[] =
844{ 849{
845 0, 54, 55, 56, 0, 55, 1, 5, 6, 7, 850 0, 55, 56, 57, 0, 56, 1, 5, 6, 7,
846 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 851 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
847 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 852 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
848 28, 29, 30, 31, 41, 57, 60, 64, 65, 66, 853 28, 29, 30, 31, 32, 42, 58, 61, 65, 66,
849 67, 68, 69, 73, 84, 99, 101, 44, 45, 37, 854 67, 68, 69, 70, 74, 85, 100, 102, 45, 46,
850 51, 96, 23, 37, 51, 87, 59, 37, 87, 47, 855 38, 52, 97, 23, 38, 52, 88, 60, 38, 88,
851 47, 44, 37, 47, 48, 61, 62, 63, 70, 74, 856 48, 48, 45, 38, 48, 50, 62, 63, 64, 71,
852 75, 66, 96, 37, 97, 98, 58, 87, 1, 64, 857 75, 76, 67, 97, 38, 98, 99, 59, 88, 1,
853 88, 89, 90, 60, 64, 87, 65, 37, 1, 74, 858 65, 89, 90, 91, 61, 65, 88, 66, 82, 38,
854 71, 72, 73, 44, 46, 74, 30, 32, 100, 33, 859 1, 75, 72, 73, 74, 45, 47, 75, 30, 33,
855 47, 50, 45, 46, 60, 44, 45, 37, 41, 47, 860 101, 34, 48, 51, 46, 47, 61, 45, 46, 38,
856 52, 70, 76, 77, 91, 92, 93, 94, 45, 1, 861 42, 48, 53, 71, 77, 78, 92, 93, 94, 95,
857 90, 74, 48, 49, 49, 49, 49, 73, 63, 95, 862 46, 1, 91, 75, 38, 42, 48, 71, 83, 84,
858 1, 65, 78, 79, 80, 81, 34, 45, 98, 94, 863 49, 49, 49, 49, 74, 64, 96, 1, 79, 80,
859 1, 37, 76, 34, 76, 95, 33, 47, 44, 46, 864 81, 82, 35, 46, 99, 95, 1, 38, 77, 35,
860 49, 44, 31, 50, 85, 86, 49, 37, 41, 47, 865 77, 96, 34, 48, 45, 47, 1, 42, 83, 83,
861 70, 82, 83, 49, 36, 46, 49, 49, 1, 78, 866 34, 48, 45, 31, 51, 86, 87, 49, 49, 37,
862 93, 34, 1, 41, 82, 82, 33, 47, 36, 81, 867 47, 49, 49, 1, 79, 94, 49, 49, 1, 79,
863 49, 49, 49, 49, 1, 78, 49, 49 868 35, 37, 82, 49, 49, 49, 49
864}; 869};
865 870
866#define yyerrok (yyerrstatus = 0) 871#define yyerrok (yyerrstatus = 0)
@@ -890,17 +895,18 @@ static const yytype_uint8 yystos[] =
890 895
891#define YYRECOVERING() (!!yyerrstatus) 896#define YYRECOVERING() (!!yyerrstatus)
892 897
893#define YYBACKUP(Token, Value) \ 898#define YYBACKUP(Token, Value) \
894do \ 899do \
895 if (yychar == YYEMPTY && yylen == 1) \ 900 if (yychar == YYEMPTY) \
896 { \ 901 { \
897 yychar = (Token); \ 902 yychar = (Token); \
898 yylval = (Value); \ 903 yylval = (Value); \
899 YYPOPSTACK (1); \ 904 YYPOPSTACK (yylen); \
900 goto yybackup; \ 905 yystate = *yyssp; \
901 } \ 906 goto yybackup; \
902 else \ 907 } \
903 { \ 908 else \
909 { \
904 yyerror (YY_("syntax error: cannot back up")); \ 910 yyerror (YY_("syntax error: cannot back up")); \
905 YYERROR; \ 911 YYERROR; \
906 } \ 912 } \
@@ -995,6 +1001,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep)
995 YYSTYPE const * const yyvaluep; 1001 YYSTYPE const * const yyvaluep;
996#endif 1002#endif
997{ 1003{
1004 FILE *yyo = yyoutput;
1005 YYUSE (yyo);
998 if (!yyvaluep) 1006 if (!yyvaluep)
999 return; 1007 return;
1000# ifdef YYPRINT 1008# ifdef YYPRINT
@@ -1246,12 +1254,12 @@ static int
1246yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 1254yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1247 yytype_int16 *yyssp, int yytoken) 1255 yytype_int16 *yyssp, int yytoken)
1248{ 1256{
1249 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); 1257 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1250 YYSIZE_T yysize = yysize0; 1258 YYSIZE_T yysize = yysize0;
1251 YYSIZE_T yysize1; 1259 YYSIZE_T yysize1;
1252 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 1260 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1253 /* Internationalized format string. */ 1261 /* Internationalized format string. */
1254 const char *yyformat = 0; 1262 const char *yyformat = YY_NULL;
1255 /* Arguments of yyformat. */ 1263 /* Arguments of yyformat. */
1256 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 1264 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1257 /* Number of reported tokens (one for the "unexpected", one per 1265 /* Number of reported tokens (one for the "unexpected", one per
@@ -1311,7 +1319,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1311 break; 1319 break;
1312 } 1320 }
1313 yyarg[yycount++] = yytname[yyx]; 1321 yyarg[yycount++] = yytname[yyx];
1314 yysize1 = yysize + yytnamerr (0, yytname[yyx]); 1322 yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1315 if (! (yysize <= yysize1 1323 if (! (yysize <= yysize1
1316 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1324 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1317 return 2; 1325 return 2;
@@ -1463,7 +1471,7 @@ yyparse ()
1463 `yyss': related to states. 1471 `yyss': related to states.
1464 `yyvs': related to semantic values. 1472 `yyvs': related to semantic values.
1465 1473
1466 Refer to the stacks thru separate pointers, to allow yyoverflow 1474 Refer to the stacks through separate pointers, to allow yyoverflow
1467 to reallocate them elsewhere. */ 1475 to reallocate them elsewhere. */
1468 1476
1469 /* The state stack. */ 1477 /* The state stack. */
@@ -2346,7 +2354,7 @@ yyabortlab:
2346 yyresult = 1; 2354 yyresult = 1;
2347 goto yyreturn; 2355 goto yyreturn;
2348 2356
2349#if !defined(yyoverflow) || YYERROR_VERBOSE 2357#if !defined yyoverflow || YYERROR_VERBOSE
2350/*-------------------------------------------------. 2358/*-------------------------------------------------.
2351| yyexhaustedlab -- memory exhaustion comes here. | 2359| yyexhaustedlab -- memory exhaustion comes here. |
2352`-------------------------------------------------*/ 2360`-------------------------------------------------*/
diff --git a/scripts/genksyms/parse.tab.h_shipped b/scripts/genksyms/parse.tab.h_shipped
index 93240a3cdecc..a4737dec4532 100644
--- a/scripts/genksyms/parse.tab.h_shipped
+++ b/scripts/genksyms/parse.tab.h_shipped
@@ -1,8 +1,8 @@
1/* A Bison parser, made by GNU Bison 2.5. */ 1/* A Bison parser, made by GNU Bison 2.5.1. */
2 2
3/* Bison interface for Yacc-like parsers in C 3/* Bison interface for Yacc-like parsers in C
4 4
5 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. 5 Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
6 6
7 This program is free software: you can redistribute it and/or modify 7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
@@ -66,18 +66,19 @@
66 EXPORT_SYMBOL_KEYW = 284, 66 EXPORT_SYMBOL_KEYW = 284,
67 ASM_PHRASE = 285, 67 ASM_PHRASE = 285,
68 ATTRIBUTE_PHRASE = 286, 68 ATTRIBUTE_PHRASE = 286,
69 BRACE_PHRASE = 287, 69 TYPEOF_PHRASE = 287,
70 BRACKET_PHRASE = 288, 70 BRACE_PHRASE = 288,
71 EXPRESSION_PHRASE = 289, 71 BRACKET_PHRASE = 289,
72 CHAR = 290, 72 EXPRESSION_PHRASE = 290,
73 DOTS = 291, 73 CHAR = 291,
74 IDENT = 292, 74 DOTS = 292,
75 INT = 293, 75 IDENT = 293,
76 REAL = 294, 76 INT = 294,
77 STRING = 295, 77 REAL = 295,
78 TYPE = 296, 78 STRING = 296,
79 OTHER = 297, 79 TYPE = 297,
80 FILENAME = 298 80 OTHER = 298,
81 FILENAME = 299
81 }; 82 };
82#endif 83#endif
83 84
diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y
index 23c39998ad86..b9f4cf202302 100644
--- a/scripts/genksyms/parse.y
+++ b/scripts/genksyms/parse.y
@@ -103,6 +103,7 @@ static void record_compound(struct string_list **keyw,
103 103
104%token ASM_PHRASE 104%token ASM_PHRASE
105%token ATTRIBUTE_PHRASE 105%token ATTRIBUTE_PHRASE
106%token TYPEOF_PHRASE
106%token BRACE_PHRASE 107%token BRACE_PHRASE
107%token BRACKET_PHRASE 108%token BRACKET_PHRASE
108%token EXPRESSION_PHRASE 109%token EXPRESSION_PHRASE
@@ -220,8 +221,8 @@ storage_class_specifier:
220type_specifier: 221type_specifier:
221 simple_type_specifier 222 simple_type_specifier
222 | cvar_qualifier 223 | cvar_qualifier
223 | TYPEOF_KEYW '(' decl_specifier_seq '*' ')' 224 | TYPEOF_KEYW '(' parameter_declaration ')'
224 | TYPEOF_KEYW '(' decl_specifier_seq ')' 225 | TYPEOF_PHRASE
225 226
226 /* References to s/u/e's defined elsewhere. Rearrange things 227 /* References to s/u/e's defined elsewhere. Rearrange things
227 so that it is easier to expand the definition fully later. */ 228 so that it is easier to expand the definition fully later. */
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 10085de886fe..1237dd7fb4ca 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -36,13 +36,13 @@ struct sym_entry {
36 unsigned char *sym; 36 unsigned char *sym;
37}; 37};
38 38
39struct text_range { 39struct addr_range {
40 const char *stext, *etext; 40 const char *start_sym, *end_sym;
41 unsigned long long start, end; 41 unsigned long long start, end;
42}; 42};
43 43
44static unsigned long long _text; 44static unsigned long long _text;
45static struct text_range text_ranges[] = { 45static struct addr_range text_ranges[] = {
46 { "_stext", "_etext" }, 46 { "_stext", "_etext" },
47 { "_sinittext", "_einittext" }, 47 { "_sinittext", "_einittext" },
48 { "_stext_l1", "_etext_l1" }, /* Blackfin on-chip L1 inst SRAM */ 48 { "_stext_l1", "_etext_l1" }, /* Blackfin on-chip L1 inst SRAM */
@@ -51,9 +51,14 @@ static struct text_range text_ranges[] = {
51#define text_range_text (&text_ranges[0]) 51#define text_range_text (&text_ranges[0])
52#define text_range_inittext (&text_ranges[1]) 52#define text_range_inittext (&text_ranges[1])
53 53
54static struct addr_range percpu_range = {
55 "__per_cpu_start", "__per_cpu_end", -1ULL, 0
56};
57
54static struct sym_entry *table; 58static struct sym_entry *table;
55static unsigned int table_size, table_cnt; 59static unsigned int table_size, table_cnt;
56static int all_symbols = 0; 60static int all_symbols = 0;
61static int absolute_percpu = 0;
57static char symbol_prefix_char = '\0'; 62static char symbol_prefix_char = '\0';
58static unsigned long long kernel_start_addr = 0; 63static unsigned long long kernel_start_addr = 0;
59 64
@@ -83,19 +88,20 @@ static inline int is_arm_mapping_symbol(const char *str)
83 && (str[2] == '\0' || str[2] == '.'); 88 && (str[2] == '\0' || str[2] == '.');
84} 89}
85 90
86static int read_symbol_tr(const char *sym, unsigned long long addr) 91static int check_symbol_range(const char *sym, unsigned long long addr,
92 struct addr_range *ranges, int entries)
87{ 93{
88 size_t i; 94 size_t i;
89 struct text_range *tr; 95 struct addr_range *ar;
90 96
91 for (i = 0; i < ARRAY_SIZE(text_ranges); ++i) { 97 for (i = 0; i < entries; ++i) {
92 tr = &text_ranges[i]; 98 ar = &ranges[i];
93 99
94 if (strcmp(sym, tr->stext) == 0) { 100 if (strcmp(sym, ar->start_sym) == 0) {
95 tr->start = addr; 101 ar->start = addr;
96 return 0; 102 return 0;
97 } else if (strcmp(sym, tr->etext) == 0) { 103 } else if (strcmp(sym, ar->end_sym) == 0) {
98 tr->end = addr; 104 ar->end = addr;
99 return 0; 105 return 0;
100 } 106 }
101 } 107 }
@@ -130,7 +136,8 @@ static int read_symbol(FILE *in, struct sym_entry *s)
130 /* Ignore most absolute/undefined (?) symbols. */ 136 /* Ignore most absolute/undefined (?) symbols. */
131 if (strcmp(sym, "_text") == 0) 137 if (strcmp(sym, "_text") == 0)
132 _text = s->addr; 138 _text = s->addr;
133 else if (read_symbol_tr(sym, s->addr) == 0) 139 else if (check_symbol_range(sym, s->addr, text_ranges,
140 ARRAY_SIZE(text_ranges)) == 0)
134 /* nothing to do */; 141 /* nothing to do */;
135 else if (toupper(stype) == 'A') 142 else if (toupper(stype) == 'A')
136 { 143 {
@@ -164,18 +171,22 @@ static int read_symbol(FILE *in, struct sym_entry *s)
164 strcpy((char *)s->sym + 1, str); 171 strcpy((char *)s->sym + 1, str);
165 s->sym[0] = stype; 172 s->sym[0] = stype;
166 173
174 /* Record if we've found __per_cpu_start/end. */
175 check_symbol_range(sym, s->addr, &percpu_range, 1);
176
167 return 0; 177 return 0;
168} 178}
169 179
170static int symbol_valid_tr(struct sym_entry *s) 180static int symbol_in_range(struct sym_entry *s, struct addr_range *ranges,
181 int entries)
171{ 182{
172 size_t i; 183 size_t i;
173 struct text_range *tr; 184 struct addr_range *ar;
174 185
175 for (i = 0; i < ARRAY_SIZE(text_ranges); ++i) { 186 for (i = 0; i < entries; ++i) {
176 tr = &text_ranges[i]; 187 ar = &ranges[i];
177 188
178 if (s->addr >= tr->start && s->addr <= tr->end) 189 if (s->addr >= ar->start && s->addr <= ar->end)
179 return 1; 190 return 1;
180 } 191 }
181 192
@@ -214,7 +225,8 @@ static int symbol_valid(struct sym_entry *s)
214 /* if --all-symbols is not specified, then symbols outside the text 225 /* if --all-symbols is not specified, then symbols outside the text
215 * and inittext sections are discarded */ 226 * and inittext sections are discarded */
216 if (!all_symbols) { 227 if (!all_symbols) {
217 if (symbol_valid_tr(s) == 0) 228 if (symbol_in_range(s, text_ranges,
229 ARRAY_SIZE(text_ranges)) == 0)
218 return 0; 230 return 0;
219 /* Corner case. Discard any symbols with the same value as 231 /* Corner case. Discard any symbols with the same value as
220 * _etext _einittext; they can move between pass 1 and 2 when 232 * _etext _einittext; they can move between pass 1 and 2 when
@@ -223,9 +235,11 @@ static int symbol_valid(struct sym_entry *s)
223 * rules. 235 * rules.
224 */ 236 */
225 if ((s->addr == text_range_text->end && 237 if ((s->addr == text_range_text->end &&
226 strcmp((char *)s->sym + offset, text_range_text->etext)) || 238 strcmp((char *)s->sym + offset,
239 text_range_text->end_sym)) ||
227 (s->addr == text_range_inittext->end && 240 (s->addr == text_range_inittext->end &&
228 strcmp((char *)s->sym + offset, text_range_inittext->etext))) 241 strcmp((char *)s->sym + offset,
242 text_range_inittext->end_sym)))
229 return 0; 243 return 0;
230 } 244 }
231 245
@@ -298,6 +312,11 @@ static int expand_symbol(unsigned char *data, int len, char *result)
298 return total; 312 return total;
299} 313}
300 314
315static int symbol_absolute(struct sym_entry *s)
316{
317 return toupper(s->sym[0]) == 'A';
318}
319
301static void write_src(void) 320static void write_src(void)
302{ 321{
303 unsigned int i, k, off; 322 unsigned int i, k, off;
@@ -325,7 +344,7 @@ static void write_src(void)
325 */ 344 */
326 output_label("kallsyms_addresses"); 345 output_label("kallsyms_addresses");
327 for (i = 0; i < table_cnt; i++) { 346 for (i = 0; i < table_cnt; i++) {
328 if (toupper(table[i].sym[0]) != 'A') { 347 if (!symbol_absolute(&table[i])) {
329 if (_text <= table[i].addr) 348 if (_text <= table[i].addr)
330 printf("\tPTR\t_text + %#llx\n", 349 printf("\tPTR\t_text + %#llx\n",
331 table[i].addr - _text); 350 table[i].addr - _text);
@@ -646,6 +665,15 @@ static void sort_symbols(void)
646 qsort(table, table_cnt, sizeof(struct sym_entry), compare_symbols); 665 qsort(table, table_cnt, sizeof(struct sym_entry), compare_symbols);
647} 666}
648 667
668static void make_percpus_absolute(void)
669{
670 unsigned int i;
671
672 for (i = 0; i < table_cnt; i++)
673 if (symbol_in_range(&table[i], &percpu_range, 1))
674 table[i].sym[0] = 'A';
675}
676
649int main(int argc, char **argv) 677int main(int argc, char **argv)
650{ 678{
651 if (argc >= 2) { 679 if (argc >= 2) {
@@ -653,6 +681,8 @@ int main(int argc, char **argv)
653 for (i = 1; i < argc; i++) { 681 for (i = 1; i < argc; i++) {
654 if(strcmp(argv[i], "--all-symbols") == 0) 682 if(strcmp(argv[i], "--all-symbols") == 0)
655 all_symbols = 1; 683 all_symbols = 1;
684 else if (strcmp(argv[i], "--absolute-percpu") == 0)
685 absolute_percpu = 1;
656 else if (strncmp(argv[i], "--symbol-prefix=", 16) == 0) { 686 else if (strncmp(argv[i], "--symbol-prefix=", 16) == 0) {
657 char *p = &argv[i][16]; 687 char *p = &argv[i][16];
658 /* skip quote */ 688 /* skip quote */
@@ -669,6 +699,8 @@ int main(int argc, char **argv)
669 usage(); 699 usage();
670 700
671 read_map(stdin); 701 read_map(stdin);
702 if (absolute_percpu)
703 make_percpus_absolute();
672 sort_symbols(); 704 sort_symbols();
673 optimize_token_table(); 705 optimize_token_table();
674 write_src(); 706 write_src();
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 87f723804079..f88d90f20228 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -1178,7 +1178,10 @@ bool conf_set_all_new_symbols(enum conf_def_mode mode)
1178 sym->def[S_DEF_USER].tri = mod; 1178 sym->def[S_DEF_USER].tri = mod;
1179 break; 1179 break;
1180 case def_no: 1180 case def_no:
1181 sym->def[S_DEF_USER].tri = no; 1181 if (sym->flags & SYMBOL_ALLNOCONFIG_Y)
1182 sym->def[S_DEF_USER].tri = yes;
1183 else
1184 sym->def[S_DEF_USER].tri = no;
1182 break; 1185 break;
1183 case def_random: 1186 case def_random:
1184 sym->def[S_DEF_USER].tri = no; 1187 sym->def[S_DEF_USER].tri = no;
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
index ba663e1dc7e3..412ea8a2abb8 100644
--- a/scripts/kconfig/expr.h
+++ b/scripts/kconfig/expr.h
@@ -109,6 +109,9 @@ struct symbol {
109/* choice values need to be set before calculating this symbol value */ 109/* choice values need to be set before calculating this symbol value */
110#define SYMBOL_NEED_SET_CHOICE_VALUES 0x100000 110#define SYMBOL_NEED_SET_CHOICE_VALUES 0x100000
111 111
112/* Set symbol to y if allnoconfig; used for symbols that hide others */
113#define SYMBOL_ALLNOCONFIG_Y 0x200000
114
112#define SYMBOL_MAXLENGTH 256 115#define SYMBOL_MAXLENGTH 256
113#define SYMBOL_HASHSIZE 9973 116#define SYMBOL_HASHSIZE 9973
114 117
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 09f4edfdc911..d5daa7af8b49 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -61,6 +61,7 @@ enum conf_def_mode {
61#define T_OPT_MODULES 1 61#define T_OPT_MODULES 1
62#define T_OPT_DEFCONFIG_LIST 2 62#define T_OPT_DEFCONFIG_LIST 2
63#define T_OPT_ENV 3 63#define T_OPT_ENV 3
64#define T_OPT_ALLNOCONFIG_Y 4
64 65
65struct kconf_id { 66struct kconf_id {
66 int name; 67 int name;
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index db1512ae30cc..3ac2c9c6e280 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -217,6 +217,9 @@ void menu_add_option(int token, char *arg)
217 case T_OPT_ENV: 217 case T_OPT_ENV:
218 prop_add_env(arg); 218 prop_add_env(arg);
219 break; 219 break;
220 case T_OPT_ALLNOCONFIG_Y:
221 current_entry->sym->flags |= SYMBOL_ALLNOCONFIG_Y;
222 break;
220 } 223 }
221} 224}
222 225
diff --git a/scripts/kconfig/zconf.gperf b/scripts/kconfig/zconf.gperf
index f14ab41154b6..b6ac02d604f1 100644
--- a/scripts/kconfig/zconf.gperf
+++ b/scripts/kconfig/zconf.gperf
@@ -44,4 +44,5 @@ on, T_ON, TF_PARAM
44modules, T_OPT_MODULES, TF_OPTION 44modules, T_OPT_MODULES, TF_OPTION
45defconfig_list, T_OPT_DEFCONFIG_LIST,TF_OPTION 45defconfig_list, T_OPT_DEFCONFIG_LIST,TF_OPTION
46env, T_OPT_ENV, TF_OPTION 46env, T_OPT_ENV, TF_OPTION
47allnoconfig_y, T_OPT_ALLNOCONFIG_Y,TF_OPTION
47%% 48%%
diff --git a/scripts/kconfig/zconf.hash.c_shipped b/scripts/kconfig/zconf.hash.c_shipped
index 40df0005daa9..c77a8eff1ef2 100644
--- a/scripts/kconfig/zconf.hash.c_shipped
+++ b/scripts/kconfig/zconf.hash.c_shipped
@@ -55,10 +55,10 @@ kconf_id_hash (register const char *str, register unsigned int len)
55 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 55 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
56 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 56 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
57 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 57 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
58 73, 73, 73, 73, 73, 73, 73, 73, 25, 25, 58 73, 73, 73, 73, 73, 73, 73, 5, 25, 25,
59 0, 0, 0, 5, 0, 0, 73, 73, 5, 0, 59 0, 0, 0, 5, 0, 0, 73, 73, 5, 0,
60 10, 5, 45, 73, 20, 20, 0, 15, 15, 73, 60 10, 5, 45, 73, 20, 20, 0, 15, 15, 73,
61 20, 73, 73, 73, 73, 73, 73, 73, 73, 73, 61 20, 5, 73, 73, 73, 73, 73, 73, 73, 73,
62 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 62 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
63 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 63 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
64 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 64 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
@@ -106,6 +106,7 @@ struct kconf_id_strings_t
106 char kconf_id_strings_str23[sizeof("mainmenu")]; 106 char kconf_id_strings_str23[sizeof("mainmenu")];
107 char kconf_id_strings_str25[sizeof("menuconfig")]; 107 char kconf_id_strings_str25[sizeof("menuconfig")];
108 char kconf_id_strings_str27[sizeof("modules")]; 108 char kconf_id_strings_str27[sizeof("modules")];
109 char kconf_id_strings_str28[sizeof("allnoconfig_y")];
109 char kconf_id_strings_str29[sizeof("menu")]; 110 char kconf_id_strings_str29[sizeof("menu")];
110 char kconf_id_strings_str31[sizeof("select")]; 111 char kconf_id_strings_str31[sizeof("select")];
111 char kconf_id_strings_str32[sizeof("comment")]; 112 char kconf_id_strings_str32[sizeof("comment")];
@@ -141,6 +142,7 @@ static const struct kconf_id_strings_t kconf_id_strings_contents =
141 "mainmenu", 142 "mainmenu",
142 "menuconfig", 143 "menuconfig",
143 "modules", 144 "modules",
145 "allnoconfig_y",
144 "menu", 146 "menu",
145 "select", 147 "select",
146 "comment", 148 "comment",
@@ -170,7 +172,7 @@ kconf_id_lookup (register const char *str, register unsigned int len)
170{ 172{
171 enum 173 enum
172 { 174 {
173 TOTAL_KEYWORDS = 32, 175 TOTAL_KEYWORDS = 33,
174 MIN_WORD_LENGTH = 2, 176 MIN_WORD_LENGTH = 2,
175 MAX_WORD_LENGTH = 14, 177 MAX_WORD_LENGTH = 14,
176 MIN_HASH_VALUE = 2, 178 MIN_HASH_VALUE = 2,
@@ -219,7 +221,8 @@ kconf_id_lookup (register const char *str, register unsigned int len)
219 {-1}, 221 {-1},
220#line 44 "scripts/kconfig/zconf.gperf" 222#line 44 "scripts/kconfig/zconf.gperf"
221 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION}, 223 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION},
222 {-1}, 224#line 47 "scripts/kconfig/zconf.gperf"
225 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_OPT_ALLNOCONFIG_Y,TF_OPTION},
223#line 16 "scripts/kconfig/zconf.gperf" 226#line 16 "scripts/kconfig/zconf.gperf"
224 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND}, 227 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND},
225 {-1}, 228 {-1},
@@ -282,5 +285,5 @@ kconf_id_lookup (register const char *str, register unsigned int len)
282 } 285 }
283 return 0; 286 return 0;
284} 287}
285#line 47 "scripts/kconfig/zconf.gperf" 288#line 48 "scripts/kconfig/zconf.gperf"
286 289
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index 2dcb37736d84..86a4fe75f453 100644
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -86,6 +86,10 @@ kallsyms()
86 kallsymopt="${kallsymopt} --page-offset=$CONFIG_PAGE_OFFSET" 86 kallsymopt="${kallsymopt} --page-offset=$CONFIG_PAGE_OFFSET"
87 fi 87 fi
88 88
89 if [ -n "${CONFIG_X86_64}" ]; then
90 kallsymopt="${kallsymopt} --absolute-percpu"
91 fi
92
89 local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \ 93 local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \
90 ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}" 94 ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}"
91 95
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
index f221ddf69080..cfb8440cc0b2 100755
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -76,7 +76,7 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
76 echo \#define LINUX_COMPILE_BY \"`echo $LINUX_COMPILE_BY | $UTS_TRUNCATE`\" 76 echo \#define LINUX_COMPILE_BY \"`echo $LINUX_COMPILE_BY | $UTS_TRUNCATE`\"
77 echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\" 77 echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\"
78 78
79 echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\" 79 echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | grep ' version '`\"
80) > .tmpcompile 80) > .tmpcompile
81 81
82# Only replace the real compile.h if the new one is different, 82# Only replace the real compile.h if the new one is different,
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 25f6f5970552..1924990a737f 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -42,7 +42,7 @@ typedef unsigned char __u8;
42 42
43/* This array collects all instances that use the generic do_table */ 43/* This array collects all instances that use the generic do_table */
44struct devtable { 44struct devtable {
45 const char *device_id; /* name of table, __mod_<name>_device_table. */ 45 const char *device_id; /* name of table, __mod_<name>__*_device_table. */
46 unsigned long id_size; 46 unsigned long id_size;
47 void *function; 47 void *function;
48}; 48};
@@ -146,7 +146,8 @@ static void device_id_check(const char *modname, const char *device_id,
146 146
147 if (size % id_size || size < id_size) { 147 if (size % id_size || size < id_size) {
148 fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo " 148 fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "
149 "of the size of section __mod_%s_device_table=%lu.\n" 149 "of the size of "
150 "section __mod_%s__<identifier>_device_table=%lu.\n"
150 "Fix definition of struct %s_device_id " 151 "Fix definition of struct %s_device_id "
151 "in mod_devicetable.h\n", 152 "in mod_devicetable.h\n",
152 modname, device_id, id_size, device_id, size, device_id); 153 modname, device_id, id_size, device_id, size, device_id);
@@ -1216,7 +1217,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
1216{ 1217{
1217 void *symval; 1218 void *symval;
1218 char *zeros = NULL; 1219 char *zeros = NULL;
1219 const char *name; 1220 const char *name, *identifier;
1220 unsigned int namelen; 1221 unsigned int namelen;
1221 1222
1222 /* We're looking for a section relative symbol */ 1223 /* We're looking for a section relative symbol */
@@ -1227,7 +1228,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
1227 if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT) 1228 if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT)
1228 return; 1229 return;
1229 1230
1230 /* All our symbols are of form <prefix>__mod_XXX_device_table. */ 1231 /* All our symbols are of form <prefix>__mod_<name>__<identifier>_device_table. */
1231 name = strstr(symname, "__mod_"); 1232 name = strstr(symname, "__mod_");
1232 if (!name) 1233 if (!name)
1233 return; 1234 return;
@@ -1237,7 +1238,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
1237 return; 1238 return;
1238 if (strcmp(name + namelen - strlen("_device_table"), "_device_table")) 1239 if (strcmp(name + namelen - strlen("_device_table"), "_device_table"))
1239 return; 1240 return;
1240 namelen -= strlen("_device_table"); 1241 identifier = strstr(name, "__");
1242 if (!identifier)
1243 return;
1244 namelen = identifier - name;
1241 1245
1242 /* Handle all-NULL symbols allocated into .bss */ 1246 /* Handle all-NULL symbols allocated into .bss */
1243 if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) { 1247 if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) {
diff --git a/scripts/objdiff b/scripts/objdiff
new file mode 100755
index 000000000000..b3e4f10bfc3e
--- /dev/null
+++ b/scripts/objdiff
@@ -0,0 +1,141 @@
1#!/bin/bash
2
3# objdiff - a small script for validating that a commit or series of commits
4# didn't change object code.
5#
6# Copyright 2014, Jason Cooper <jason@lakedaemon.net>
7#
8# Licensed under the terms of the GNU GPL version 2
9
10# usage example:
11#
12# $ git checkout COMMIT_A
13# $ <your fancy build command here>
14# $ ./scripts/objdiff record path/to/*.o
15#
16# $ git checkout COMMIT_B
17# $ <your fancy build command here>
18# $ ./scripts/objdiff record path/to/*.o
19#
20# $ ./scripts/objdiff diff COMMIT_A COMMIT_B
21# $
22
23# And to clean up (everything is in .tmp_objdiff/*)
24# $ ./scripts/objdiff clean all
25#
26# Note: 'make mrproper' will also remove .tmp_objdiff
27
28GIT_DIR="`git rev-parse --git-dir`"
29
30if [ -d "$GIT_DIR" ]; then
31 TMPD="${GIT_DIR%git}tmp_objdiff"
32
33 [ -d "$TMPD" ] || mkdir "$TMPD"
34else
35 echo "ERROR: git directory not found."
36 exit 1
37fi
38
39usage() {
40 echo "Usage: $0 <command> <args>"
41 echo " record <list of object files>"
42 echo " diff <commitA> <commitB>"
43 echo " clean all | <commit>"
44 exit 1
45}
46
47dorecord() {
48 [ $# -eq 0 ] && usage
49
50 FILES="$*"
51
52 CMT="`git rev-parse --short HEAD`"
53
54 OBJDUMP="${CROSS_COMPILE}objdump"
55 OBJDIFFD="$TMPD/$CMT"
56
57 [ ! -d "$OBJDIFFD" ] && mkdir -p "$OBJDIFFD"
58
59 for f in $FILES; do
60 dn="${f%/*}"
61 bn="${f##*/}"
62
63 [ ! -d "$OBJDIFFD/$dn" ] && mkdir -p "$OBJDIFFD/$dn"
64
65 # remove addresses for a more clear diff
66 # http://dummdida.tumblr.com/post/60924060451/binary-diff-between-libc-from-scientificlinux-and
67 $OBJDUMP -D "$f" | sed "s/^[[:space:]]\+[0-9a-f]\+//" \
68 >"$OBJDIFFD/$dn/$bn"
69 done
70}
71
72dodiff() {
73 [ $# -ne 2 ] && [ $# -ne 0 ] && usage
74
75 if [ $# -eq 0 ]; then
76 SRC="`git rev-parse --short HEAD^`"
77 DST="`git rev-parse --short HEAD`"
78 else
79 SRC="`git rev-parse --short $1`"
80 DST="`git rev-parse --short $2`"
81 fi
82
83 DIFF="`which colordiff`"
84
85 if [ ${#DIFF} -eq 0 ] || [ ! -x "$DIFF" ]; then
86 DIFF="`which diff`"
87 fi
88
89 SRCD="$TMPD/$SRC"
90 DSTD="$TMPD/$DST"
91
92 if [ ! -d "$SRCD" ]; then
93 echo "ERROR: $SRCD doesn't exist"
94 exit 1
95 fi
96
97 if [ ! -d "$DSTD" ]; then
98 echo "ERROR: $DSTD doesn't exist"
99 exit 1
100 fi
101
102 $DIFF -Nurd $SRCD $DSTD
103}
104
105doclean() {
106 [ $# -eq 0 ] && usage
107 [ $# -gt 1 ] && usage
108
109 if [ "x$1" = "xall" ]; then
110 rm -rf $TMPD/*
111 else
112 CMT="`git rev-parse --short $1`"
113
114 if [ -d "$TMPD/$CMT" ]; then
115 rm -rf $TMPD/$CMT
116 else
117 echo "$CMT not found"
118 fi
119 fi
120}
121
122[ $# -eq 0 ] && usage
123
124case "$1" in
125 record)
126 shift
127 dorecord $*
128 ;;
129 diff)
130 shift
131 dodiff $*
132 ;;
133 clean)
134 shift
135 doclean $*
136 ;;
137 *)
138 echo "Unrecognized command '$1'"
139 exit 1
140 ;;
141esac
diff --git a/scripts/tags.sh b/scripts/tags.sh
index 58c455929091..f2c5b006a3d7 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -11,11 +11,10 @@ if [ "$KBUILD_VERBOSE" = "1" ]; then
11 set -x 11 set -x
12fi 12fi
13 13
14# This is a duplicate of RCS_FIND_IGNORE without escaped '()' 14# RCS_FIND_IGNORE has escaped ()s -- remove them.
15ignore="( -name SCCS -o -name BitKeeper -o -name .svn -o \ 15ignore="$(echo "$RCS_FIND_IGNORE" | sed 's|\\||g' )"
16 -name CVS -o -name .pc -o -name .hg -o \ 16# tags and cscope files should also ignore MODVERSION *.mod.c files
17 -name .git ) \ 17ignore="$ignore ( -name *.mod.c ) -prune -o"
18 -prune -o"
19 18
20# Do not use full path if we do not use O=.. builds 19# Do not use full path if we do not use O=.. builds
21# Use make O=. {tags|cscope} 20# Use make O=. {tags|cscope}