diff options
author | Ingo Molnar <mingo@kernel.org> | 2014-04-14 10:44:42 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-04-14 10:44:42 -0400 |
commit | 740c699a8d316c8bf8593f19e2ca47795e690622 (patch) | |
tree | a78886955770a477945c5d84e06b2e7678733b54 /scripts | |
parent | e69af4657e7764d03ad555f0b583d9c4217bcefa (diff) | |
parent | c9eaa447e77efe77b7fa4c953bd62de8297fd6c5 (diff) |
Merge tag 'v3.15-rc1' into perf/urgent
Pick up the latest fixes.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'scripts')
37 files changed, 1571 insertions, 968 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 |
5 | comma := , | 5 | comma := , |
6 | quote := " | ||
6 | squote := ' | 7 | squote := ' |
7 | empty := | 8 | empty := |
8 | space := $(empty) $(empty) | 9 | space := $(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) | |||
27 | hostprogs-y += unifdef docproc | 27 | hostprogs-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 |
30 | PHONY += build_unifdef | 30 | PHONY += build_unifdef build_docproc |
31 | build_unifdef: scripts/unifdef FORCE | 31 | build_unifdef: $(obj)/unifdef |
32 | @: | 32 | @: |
33 | build_docproc: scripts/docproc FORCE | 33 | build_docproc: $(obj)/docproc |
34 | @: | 34 | @: |
35 | 35 | ||
36 | subdir-$(CONFIG_MODVERSIONS) += genksyms | 36 | subdir-$(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) | |||
65 | warning-1 := -Wextra -Wunused -Wno-unused-parameter | 65 | warning-1 := -Wextra -Wunused -Wno-unused-parameter |
66 | warning-1 += -Wmissing-declarations | 66 | warning-1 += -Wmissing-declarations |
67 | warning-1 += -Wmissing-format-attribute | 67 | warning-1 += -Wmissing-format-attribute |
68 | warning-1 += -Wmissing-prototypes | 68 | warning-1 += $(call cc-option, -Wmissing-prototypes) |
69 | warning-1 += -Wold-style-definition | 69 | warning-1 += -Wold-style-definition |
70 | warning-1 += $(call cc-option, -Wmissing-include-dirs) | 70 | warning-1 += $(call cc-option, -Wmissing-include-dirs) |
71 | warning-1 += $(call cc-option, -Wunused-but-set-variable) | 71 | warning-1 += $(call cc-option, -Wunused-but-set-variable) |
72 | warning-1 += $(call cc-disable-warning, missing-field-initializers) | 72 | warning-1 += $(call cc-disable-warning, missing-field-initializers) |
73 | 73 | ||
74 | # Clang | ||
75 | warning-1 += $(call cc-disable-warning, initializer-overrides) | ||
76 | warning-1 += $(call cc-disable-warning, unused-value) | ||
77 | warning-1 += $(call cc-disable-warning, format) | ||
78 | warning-1 += $(call cc-disable-warning, unknown-warning-option) | ||
79 | warning-1 += $(call cc-disable-warning, sign-compare) | ||
80 | warning-1 += $(call cc-disable-warning, format-zero-length) | ||
81 | warning-1 += $(call cc-disable-warning, uninitialized) | ||
82 | warning-1 += $(call cc-option, -fcatch-undefined-behavior) | ||
83 | |||
74 | warning-2 := -Waggregate-return | 84 | warning-2 := -Waggregate-return |
75 | warning-2 += -Wcast-align | 85 | warning-2 += -Wcast-align |
76 | warning-2 += -Wdisabled-optimization | 86 | warning-2 += -Wdisabled-optimization |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 79c059e70860..6a5b0decb797 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -274,6 +274,18 @@ $(obj)/%.dtb: $(src)/%.dts FORCE | |||
274 | 274 | ||
275 | dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) | 275 | dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) |
276 | 276 | ||
277 | # Helper targets for Installing DTBs into the boot directory | ||
278 | quiet_cmd_dtb_install = INSTALL $< | ||
279 | cmd_dtb_install = cp $< $(2) | ||
280 | |||
281 | _dtbinst_pre_: | ||
282 | $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi | ||
283 | $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi | ||
284 | $(Q)mkdir -p $(INSTALL_DTBS_PATH) | ||
285 | |||
286 | %.dtb_dtbinst_: $(obj)/%.dtb _dtbinst_pre_ | ||
287 | $(call cmd,dtb_install,$(INSTALL_DTBS_PATH)) | ||
288 | |||
277 | # Bzip2 | 289 | # Bzip2 |
278 | # --------------------------------------------------------------------------- | 290 | # --------------------------------------------------------------------------- |
279 | 291 | ||
@@ -368,7 +380,3 @@ quiet_cmd_xzmisc = XZMISC $@ | |||
368 | cmd_xzmisc = (cat $(filter-out FORCE,$^) | \ | 380 | cmd_xzmisc = (cat $(filter-out FORCE,$^) | \ |
369 | xz --check=crc32 --lzma2=dict=1MiB) > $@ || \ | 381 | xz --check=crc32 --lzma2=dict=1MiB) > $@ || \ |
370 | (rm -f $@ ; false) | 382 | (rm -f $@ ; false) |
371 | |||
372 | # misc stuff | ||
373 | # --------------------------------------------------------------------------- | ||
374 | quote:=" | ||
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 | ||
40 | use strict; | 40 | use strict; |
41 | use Getopt::Long; | ||
42 | my $header = 0; | ||
43 | |||
44 | sub help { | ||
45 | my $text = << "EOM"; | ||
46 | Usage: | ||
47 | 1) dmesg | perl scripts/bootgraph.pl [OPTION] > output.svg | ||
48 | 2) perl scripts/bootgraph.pl -h | ||
49 | |||
50 | Options: | ||
51 | -header Insert kernel version and date | ||
52 | EOM | ||
53 | my $std=shift; | ||
54 | if ($std == 1) { | ||
55 | print STDERR $text; | ||
56 | } else { | ||
57 | print $text; | ||
58 | } | ||
59 | exit; | ||
60 | } | ||
61 | |||
62 | GetOptions( | ||
63 | 'h|help' =>\&help, | ||
64 | 'header' =>\$header | ||
65 | ); | ||
41 | 66 | ||
42 | my %start; | 67 | my %start; |
43 | my %end; | 68 | my %end; |
@@ -49,6 +74,11 @@ my $count = 0; | |||
49 | my %pids; | 74 | my %pids; |
50 | my %pidctr; | 75 | my %pidctr; |
51 | 76 | ||
77 | my $headerstep = 20; | ||
78 | my $xheader = 15; | ||
79 | my $yheader = 25; | ||
80 | my $cyheader = 0; | ||
81 | |||
52 | while (<>) { | 82 | while (<>) { |
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; |
113 | No data found in the dmesg. Make sure that 'printk.time=1' and | 143 | No 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. |
115 | Usage: | ||
116 | dmesg | perl scripts/bootgraph.pl > output.svg | ||
117 | END | 145 | END |
146 | help(1); | ||
118 | exit 1; | 147 | exit 1; |
119 | } | 148 | } |
120 | 149 | ||
121 | print "<?xml version=\"1.0\" standalone=\"no\"?> \n"; | 150 | print "<?xml version=\"1.0\" standalone=\"no\"?> \n"; |
122 | print "<svg width=\"2000\" height=\"100%\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n"; | 151 | print "<svg width=\"2000\" height=\"100%\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n"; |
123 | 152 | ||
153 | |||
154 | if ($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 | |||
124 | my @styles; | 162 | my @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; |
283 | our $Modifier; | 283 | our $Modifier; |
284 | our $Inline = qr{inline|__always_inline|noinline}; | 284 | our $Inline = qr{inline|__always_inline|noinline|__inline|__inline__}; |
285 | our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]}; | 285 | our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]}; |
286 | our $Lval = qr{$Ident(?:$Member)*}; | 286 | our $Lval = qr{$Ident(?:$Member)*}; |
287 | 287 | ||
@@ -289,13 +289,14 @@ our $Int_type = qr{(?i)llu|ull|ll|lu|ul|l|u}; | |||
289 | our $Binary = qr{(?i)0b[01]+$Int_type?}; | 289 | our $Binary = qr{(?i)0b[01]+$Int_type?}; |
290 | our $Hex = qr{(?i)0x[0-9a-f]+$Int_type?}; | 290 | our $Hex = qr{(?i)0x[0-9a-f]+$Int_type?}; |
291 | our $Int = qr{[0-9]+$Int_type?}; | 291 | our $Int = qr{[0-9]+$Int_type?}; |
292 | our $Octal = qr{0[0-7]+$Int_type?}; | ||
292 | our $Float_hex = qr{(?i)0x[0-9a-f]+p-?[0-9]+[fl]?}; | 293 | our $Float_hex = qr{(?i)0x[0-9a-f]+p-?[0-9]+[fl]?}; |
293 | our $Float_dec = qr{(?i)(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?}; | 294 | our $Float_dec = qr{(?i)(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?}; |
294 | our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?}; | 295 | our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?}; |
295 | our $Float = qr{$Float_hex|$Float_dec|$Float_int}; | 296 | our $Float = qr{$Float_hex|$Float_dec|$Float_int}; |
296 | our $Constant = qr{$Float|$Binary|$Hex|$Int}; | 297 | our $Constant = qr{$Float|$Binary|$Octal|$Hex|$Int}; |
297 | our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=}; | 298 | our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=}; |
298 | our $Compare = qr{<=|>=|==|!=|<|>}; | 299 | our $Compare = qr{<=|>=|==|!=|<|(?<!-)>}; |
299 | our $Arithmetic = qr{\+|-|\*|\/|%}; | 300 | our $Arithmetic = qr{\+|-|\*|\/|%}; |
300 | our $Operators = qr{ | 301 | our $Operators = qr{ |
301 | <=|>=|==|!=| | 302 | <=|>=|==|!=| |
@@ -303,6 +304,8 @@ our $Operators = qr{ | |||
303 | &&|\|\||,|\^|\+\+|--|&|\||$Arithmetic | 304 | &&|\|\||,|\^|\+\+|--|&|\||$Arithmetic |
304 | }x; | 305 | }x; |
305 | 306 | ||
307 | our $c90_Keywords = qr{do|for|while|if|else|return|goto|continue|switch|default|case|break}x; | ||
308 | |||
306 | our $NonptrType; | 309 | our $NonptrType; |
307 | our $NonptrTypeWithAttr; | 310 | our $NonptrTypeWithAttr; |
308 | our $Type; | 311 | our $Type; |
@@ -378,6 +381,22 @@ our @modifierList = ( | |||
378 | qr{fastcall}, | 381 | qr{fastcall}, |
379 | ); | 382 | ); |
380 | 383 | ||
384 | our @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 | ||
394 | our $mode_perms_search = ""; | ||
395 | foreach my $entry (@mode_permission_funcs) { | ||
396 | $mode_perms_search .= '|' if ($mode_perms_search ne ""); | ||
397 | $mode_perms_search .= $entry->[0]; | ||
398 | } | ||
399 | |||
381 | our $allowed_asm_includes = qr{(?x: | 400 | our $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 | } |
417 | build_types(); | 436 | build_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 | ||
425 | our $balanced_parens = qr/(\((?:[^\(\)]++|(?-1))*\))/; | 444 | our $balanced_parens = qr/(\((?:[^\(\)]++|(?-1))*\))/; |
426 | our $LvalOrFunc = qr{($Lval)\s*($balanced_parens{0,1})\s*}; | 445 | our $LvalOrFunc = qr{((?:[\&\*]\s*)?$Lval)\s*($balanced_parens{0,1})\s*}; |
427 | our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant)}; | 446 | our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant)}; |
428 | 447 | ||
429 | sub deparenthesize { | 448 | sub 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 { | |||
1421 | my $prefix = ''; | 1445 | my $prefix = ''; |
1422 | 1446 | ||
1423 | sub show_type { | 1447 | sub 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 | ||
1429 | sub report { | 1455 | sub 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 | |||
1446 | sub report_dump { | 1475 | sub report_dump { |
1447 | our @report; | 1476 | our @report; |
1448 | } | 1477 | } |
1449 | 1478 | ||
1450 | sub ERROR { | 1479 | sub 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 | } |
1458 | sub WARN { | 1489 | sub 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 | } |
1466 | sub CHK { | 1499 | sub 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 | ||
1580 | sub process { | 1615 | sub 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; | |||
62 | p << r1.p1; | 62 | p << r1.p1; |
63 | @@ | 63 | @@ |
64 | 64 | ||
65 | coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used") | 65 | coccilib.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@ |
69 | p << r2.p2; | 69 | p << r2.p2; |
70 | @@ | 70 | @@ |
71 | 71 | ||
72 | coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used") | 72 | coccilib.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@ |
75 | p << r3.p3; | 75 | p << r3.p3; |
76 | @@ | 76 | @@ |
77 | 77 | ||
78 | coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used") | 78 | coccilib.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@ |
81 | p << r1.p1; | 81 | p << r1.p1; |
82 | @@ | 82 | @@ |
83 | 83 | ||
84 | coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used") | 84 | coccilib.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@ |
87 | p << r2.p2; | 87 | p << r2.p2; |
88 | @@ | 88 | @@ |
89 | 89 | ||
90 | coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used") | 90 | coccilib.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@ |
93 | p << r3.p3; | 93 | p << r3.p3; |
94 | @@ | 94 | @@ |
95 | 95 | ||
96 | coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used") | 96 | coccilib.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 | |||
10 | virtual patch | ||
11 | virtual report | ||
12 | virtual context | ||
13 | virtual org | ||
14 | |||
15 | @r1 depends on !patch@ | ||
16 | identifier struct_name; | ||
17 | struct struct_name to; | ||
18 | struct struct_name from; | ||
19 | struct struct_name *top; | ||
20 | struct struct_name *fromp; | ||
21 | position p; | ||
22 | @@ | ||
23 | memcpy@p(\(&(to)\|top\), \(&(from)\|fromp\), \(sizeof(to)\|sizeof(from)\|sizeof(struct struct_name)\|sizeof(*top)\|sizeof(*fromp)\)) | ||
24 | |||
25 | @script:python depends on report@ | ||
26 | p << r1.p; | ||
27 | @@ | ||
28 | coccilib.report.print_report(p[0],"Replace memcpy with struct assignment") | ||
29 | |||
30 | @depends on context@ | ||
31 | position r1.p; | ||
32 | @@ | ||
33 | *memcpy@p(...); | ||
34 | |||
35 | @script:python depends on org@ | ||
36 | p << r1.p; | ||
37 | @@ | ||
38 | cocci.print_main("Replace memcpy with struct assignment",p) | ||
39 | |||
40 | @depends on patch@ | ||
41 | identifier struct_name; | ||
42 | struct struct_name to; | ||
43 | struct 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@ | ||
57 | identifier struct_name; | ||
58 | struct struct_name to; | ||
59 | struct 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@ | ||
73 | identifier struct_name; | ||
74 | struct struct_name *to; | ||
75 | struct 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@ | ||
89 | identifier struct_name; | ||
90 | struct struct_name *to; | ||
91 | struct 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/dtc/dtc-parser.tab.c_shipped b/scripts/dtc/dtc-parser.tab.c_shipped index ee1d8c3042fb..c8769d550cfb 100644 --- a/scripts/dtc/dtc-parser.tab.c_shipped +++ b/scripts/dtc/dtc-parser.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.7.12-4996. */ |
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-2013 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.7.12-4996" |
48 | 48 | ||
49 | /* Skeleton name. */ | 49 | /* Skeleton name. */ |
50 | #define YYSKELETON_NAME "yacc.c" | 50 | #define YYSKELETON_NAME "yacc.c" |
@@ -58,14 +58,11 @@ | |||
58 | /* Pull parsers. */ | 58 | /* Pull parsers. */ |
59 | #define YYPULL 1 | 59 | #define YYPULL 1 |
60 | 60 | ||
61 | /* Using locations. */ | ||
62 | #define YYLSP_NEEDED 0 | ||
63 | 61 | ||
64 | 62 | ||
65 | 63 | ||
66 | /* Copy the first part of user declarations. */ | 64 | /* Copy the first part of user declarations. */ |
67 | 65 | /* Line 371 of yacc.c */ | |
68 | /* Line 268 of yacc.c */ | ||
69 | #line 21 "dtc-parser.y" | 66 | #line 21 "dtc-parser.y" |
70 | 67 | ||
71 | #include <stdio.h> | 68 | #include <stdio.h> |
@@ -85,14 +82,16 @@ extern int treesource_error; | |||
85 | static unsigned long long eval_literal(const char *s, int base, int bits); | 82 | static unsigned long long eval_literal(const char *s, int base, int bits); |
86 | static unsigned char eval_char_literal(const char *s); | 83 | static unsigned char eval_char_literal(const char *s); |
87 | 84 | ||
85 | /* Line 371 of yacc.c */ | ||
86 | #line 87 "dtc-parser.tab.c" | ||
88 | 87 | ||
89 | /* Line 268 of yacc.c */ | 88 | # ifndef YY_NULL |
90 | #line 91 "dtc-parser.tab.c" | 89 | # if defined __cplusplus && 201103L <= __cplusplus |
91 | 90 | # define YY_NULL nullptr | |
92 | /* Enabling traces. */ | 91 | # else |
93 | #ifndef YYDEBUG | 92 | # define YY_NULL 0 |
94 | # define YYDEBUG 0 | 93 | # endif |
95 | #endif | 94 | # endif |
96 | 95 | ||
97 | /* Enabling verbose error messages. */ | 96 | /* Enabling verbose error messages. */ |
98 | #ifdef YYERROR_VERBOSE | 97 | #ifdef YYERROR_VERBOSE |
@@ -102,11 +101,17 @@ static unsigned char eval_char_literal(const char *s); | |||
102 | # define YYERROR_VERBOSE 0 | 101 | # define YYERROR_VERBOSE 0 |
103 | #endif | 102 | #endif |
104 | 103 | ||
105 | /* Enabling the token table. */ | 104 | /* In a future release of Bison, this section will be replaced |
106 | #ifndef YYTOKEN_TABLE | 105 | by #include "dtc-parser.tab.h". */ |
107 | # define YYTOKEN_TABLE 0 | 106 | #ifndef YY_YY_DTC_PARSER_TAB_H_INCLUDED |
107 | # define YY_YY_DTC_PARSER_TAB_H_INCLUDED | ||
108 | /* Enabling traces. */ | ||
109 | #ifndef YYDEBUG | ||
110 | # define YYDEBUG 0 | ||
111 | #endif | ||
112 | #if YYDEBUG | ||
113 | extern int yydebug; | ||
108 | #endif | 114 | #endif |
109 | |||
110 | 115 | ||
111 | /* Tokens. */ | 116 | /* Tokens. */ |
112 | #ifndef YYTOKENTYPE | 117 | #ifndef YYTOKENTYPE |
@@ -140,12 +145,10 @@ static unsigned char eval_char_literal(const char *s); | |||
140 | #endif | 145 | #endif |
141 | 146 | ||
142 | 147 | ||
143 | |||
144 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED | 148 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
145 | typedef union YYSTYPE | 149 | typedef union YYSTYPE |
146 | { | 150 | { |
147 | 151 | /* Line 387 of yacc.c */ | |
148 | /* Line 293 of yacc.c */ | ||
149 | #line 40 "dtc-parser.y" | 152 | #line 40 "dtc-parser.y" |
150 | 153 | ||
151 | char *propnodename; | 154 | char *propnodename; |
@@ -168,21 +171,36 @@ typedef union YYSTYPE | |||
168 | uint64_t integer; | 171 | uint64_t integer; |
169 | 172 | ||
170 | 173 | ||
171 | 174 | /* Line 387 of yacc.c */ | |
172 | /* Line 293 of yacc.c */ | 175 | #line 176 "dtc-parser.tab.c" |
173 | #line 174 "dtc-parser.tab.c" | ||
174 | } YYSTYPE; | 176 | } YYSTYPE; |
175 | # define YYSTYPE_IS_TRIVIAL 1 | 177 | # define YYSTYPE_IS_TRIVIAL 1 |
176 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ | 178 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ |
177 | # define YYSTYPE_IS_DECLARED 1 | 179 | # define YYSTYPE_IS_DECLARED 1 |
178 | #endif | 180 | #endif |
179 | 181 | ||
182 | extern YYSTYPE yylval; | ||
180 | 183 | ||
181 | /* Copy the second part of user declarations. */ | 184 | #ifdef YYPARSE_PARAM |
185 | #if defined __STDC__ || defined __cplusplus | ||
186 | int yyparse (void *YYPARSE_PARAM); | ||
187 | #else | ||
188 | int yyparse (); | ||
189 | #endif | ||
190 | #else /* ! YYPARSE_PARAM */ | ||
191 | #if defined __STDC__ || defined __cplusplus | ||
192 | int yyparse (void); | ||
193 | #else | ||
194 | int yyparse (); | ||
195 | #endif | ||
196 | #endif /* ! YYPARSE_PARAM */ | ||
182 | 197 | ||
198 | #endif /* !YY_YY_DTC_PARSER_TAB_H_INCLUDED */ | ||
183 | 199 | ||
184 | /* Line 343 of yacc.c */ | 200 | /* Copy the second part of user declarations. */ |
185 | #line 186 "dtc-parser.tab.c" | 201 | |
202 | /* Line 390 of yacc.c */ | ||
203 | #line 204 "dtc-parser.tab.c" | ||
186 | 204 | ||
187 | #ifdef short | 205 | #ifdef short |
188 | # undef short | 206 | # undef short |
@@ -235,24 +253,33 @@ typedef short int yytype_int16; | |||
235 | # if defined YYENABLE_NLS && YYENABLE_NLS | 253 | # if defined YYENABLE_NLS && YYENABLE_NLS |
236 | # if ENABLE_NLS | 254 | # if ENABLE_NLS |
237 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ | 255 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
238 | # define YY_(msgid) dgettext ("bison-runtime", msgid) | 256 | # define YY_(Msgid) dgettext ("bison-runtime", Msgid) |
239 | # endif | 257 | # endif |
240 | # endif | 258 | # endif |
241 | # ifndef YY_ | 259 | # ifndef YY_ |
242 | # define YY_(msgid) msgid | 260 | # define YY_(Msgid) Msgid |
261 | # endif | ||
262 | #endif | ||
263 | |||
264 | #ifndef __attribute__ | ||
265 | /* This feature is available in gcc versions 2.5 and later. */ | ||
266 | # if (! defined __GNUC__ || __GNUC__ < 2 \ | ||
267 | || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) | ||
268 | # define __attribute__(Spec) /* empty */ | ||
243 | # endif | 269 | # endif |
244 | #endif | 270 | #endif |
245 | 271 | ||
246 | /* Suppress unused-variable warnings by "using" E. */ | 272 | /* Suppress unused-variable warnings by "using" E. */ |
247 | #if ! defined lint || defined __GNUC__ | 273 | #if ! defined lint || defined __GNUC__ |
248 | # define YYUSE(e) ((void) (e)) | 274 | # define YYUSE(E) ((void) (E)) |
249 | #else | 275 | #else |
250 | # define YYUSE(e) /* empty */ | 276 | # define YYUSE(E) /* empty */ |
251 | #endif | 277 | #endif |
252 | 278 | ||
279 | |||
253 | /* Identity function, used to suppress warnings about constant conditions. */ | 280 | /* Identity function, used to suppress warnings about constant conditions. */ |
254 | #ifndef lint | 281 | #ifndef lint |
255 | # define YYID(n) (n) | 282 | # define YYID(N) (N) |
256 | #else | 283 | #else |
257 | #if (defined __STDC__ || defined __C99__FUNC__ \ | 284 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
258 | || defined __cplusplus || defined _MSC_VER) | 285 | || defined __cplusplus || defined _MSC_VER) |
@@ -288,6 +315,7 @@ YYID (yyi) | |||
288 | # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ | 315 | # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
289 | || defined __cplusplus || defined _MSC_VER) | 316 | || defined __cplusplus || defined _MSC_VER) |
290 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | 317 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
318 | /* Use EXIT_SUCCESS as a witness for stdlib.h. */ | ||
291 | # ifndef EXIT_SUCCESS | 319 | # ifndef EXIT_SUCCESS |
292 | # define EXIT_SUCCESS 0 | 320 | # define EXIT_SUCCESS 0 |
293 | # endif | 321 | # endif |
@@ -379,20 +407,20 @@ union yyalloc | |||
379 | #endif | 407 | #endif |
380 | 408 | ||
381 | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED | 409 | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
382 | /* Copy COUNT objects from FROM to TO. The source and destination do | 410 | /* Copy COUNT objects from SRC to DST. The source and destination do |
383 | not overlap. */ | 411 | not overlap. */ |
384 | # ifndef YYCOPY | 412 | # ifndef YYCOPY |
385 | # if defined __GNUC__ && 1 < __GNUC__ | 413 | # if defined __GNUC__ && 1 < __GNUC__ |
386 | # define YYCOPY(To, From, Count) \ | 414 | # define YYCOPY(Dst, Src, Count) \ |
387 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | 415 | __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) |
388 | # else | 416 | # else |
389 | # define YYCOPY(To, From, Count) \ | 417 | # define YYCOPY(Dst, Src, Count) \ |
390 | do \ | 418 | do \ |
391 | { \ | 419 | { \ |
392 | YYSIZE_T yyi; \ | 420 | YYSIZE_T yyi; \ |
393 | for (yyi = 0; yyi < (Count); yyi++) \ | 421 | for (yyi = 0; yyi < (Count); yyi++) \ |
394 | (To)[yyi] = (From)[yyi]; \ | 422 | (Dst)[yyi] = (Src)[yyi]; \ |
395 | } \ | 423 | } \ |
396 | while (YYID (0)) | 424 | while (YYID (0)) |
397 | # endif | 425 | # endif |
398 | # endif | 426 | # endif |
@@ -513,7 +541,7 @@ static const yytype_uint16 yyrline[] = | |||
513 | }; | 541 | }; |
514 | #endif | 542 | #endif |
515 | 543 | ||
516 | #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE | 544 | #if YYDEBUG || YYERROR_VERBOSE || 0 |
517 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. | 545 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
518 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ | 546 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
519 | static const char *const yytname[] = | 547 | static const char *const yytname[] = |
@@ -530,7 +558,7 @@ static const char *const yytname[] = | |||
530 | "integer_expr", "integer_trinary", "integer_or", "integer_and", | 558 | "integer_expr", "integer_trinary", "integer_or", "integer_and", |
531 | "integer_bitor", "integer_bitxor", "integer_bitand", "integer_eq", | 559 | "integer_bitor", "integer_bitxor", "integer_bitand", "integer_eq", |
532 | "integer_rela", "integer_shift", "integer_add", "integer_mul", | 560 | "integer_rela", "integer_shift", "integer_add", "integer_mul", |
533 | "integer_unary", "bytestring", "subnodes", "subnode", 0 | 561 | "integer_unary", "bytestring", "subnodes", "subnode", YY_NULL |
534 | }; | 562 | }; |
535 | #endif | 563 | #endif |
536 | 564 | ||
@@ -655,10 +683,10 @@ static const yytype_uint8 yytable[] = | |||
655 | 137, 0, 73, 139 | 683 | 137, 0, 73, 139 |
656 | }; | 684 | }; |
657 | 685 | ||
658 | #define yypact_value_is_default(yystate) \ | 686 | #define yypact_value_is_default(Yystate) \ |
659 | ((yystate) == (-78)) | 687 | (!!((Yystate) == (-78))) |
660 | 688 | ||
661 | #define yytable_value_is_error(yytable_value) \ | 689 | #define yytable_value_is_error(Yytable_value) \ |
662 | YYID (0) | 690 | YYID (0) |
663 | 691 | ||
664 | static const yytype_int16 yycheck[] = | 692 | static const yytype_int16 yycheck[] = |
@@ -727,62 +755,35 @@ static const yytype_uint8 yystos[] = | |||
727 | 755 | ||
728 | #define YYRECOVERING() (!!yyerrstatus) | 756 | #define YYRECOVERING() (!!yyerrstatus) |
729 | 757 | ||
730 | #define YYBACKUP(Token, Value) \ | 758 | #define YYBACKUP(Token, Value) \ |
731 | do \ | 759 | do \ |
732 | if (yychar == YYEMPTY && yylen == 1) \ | 760 | if (yychar == YYEMPTY) \ |
733 | { \ | 761 | { \ |
734 | yychar = (Token); \ | 762 | yychar = (Token); \ |
735 | yylval = (Value); \ | 763 | yylval = (Value); \ |
736 | YYPOPSTACK (1); \ | 764 | YYPOPSTACK (yylen); \ |
737 | goto yybackup; \ | 765 | yystate = *yyssp; \ |
738 | } \ | 766 | goto yybackup; \ |
739 | else \ | 767 | } \ |
740 | { \ | 768 | else \ |
769 | { \ | ||
741 | yyerror (YY_("syntax error: cannot back up")); \ | 770 | yyerror (YY_("syntax error: cannot back up")); \ |
742 | YYERROR; \ | 771 | YYERROR; \ |
743 | } \ | 772 | } \ |
744 | while (YYID (0)) | 773 | while (YYID (0)) |
745 | 774 | ||
746 | 775 | /* Error token number */ | |
747 | #define YYTERROR 1 | 776 | #define YYTERROR 1 |
748 | #define YYERRCODE 256 | 777 | #define YYERRCODE 256 |
749 | 778 | ||
750 | 779 | ||
751 | /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. | ||
752 | If N is 0, then set CURRENT to the empty location which ends | ||
753 | the previous symbol: RHS[0] (always defined). */ | ||
754 | |||
755 | #define YYRHSLOC(Rhs, K) ((Rhs)[K]) | ||
756 | #ifndef YYLLOC_DEFAULT | ||
757 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ | ||
758 | do \ | ||
759 | if (YYID (N)) \ | ||
760 | { \ | ||
761 | (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ | ||
762 | (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ | ||
763 | (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ | ||
764 | (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ | ||
765 | } \ | ||
766 | else \ | ||
767 | { \ | ||
768 | (Current).first_line = (Current).last_line = \ | ||
769 | YYRHSLOC (Rhs, 0).last_line; \ | ||
770 | (Current).first_column = (Current).last_column = \ | ||
771 | YYRHSLOC (Rhs, 0).last_column; \ | ||
772 | } \ | ||
773 | while (YYID (0)) | ||
774 | #endif | ||
775 | |||
776 | |||
777 | /* This macro is provided for backward compatibility. */ | 780 | /* This macro is provided for backward compatibility. */ |
778 | |||
779 | #ifndef YY_LOCATION_PRINT | 781 | #ifndef YY_LOCATION_PRINT |
780 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) | 782 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
781 | #endif | 783 | #endif |
782 | 784 | ||
783 | 785 | ||
784 | /* YYLEX -- calling `yylex' with the right arguments. */ | 786 | /* YYLEX -- calling `yylex' with the right arguments. */ |
785 | |||
786 | #ifdef YYLEX_PARAM | 787 | #ifdef YYLEX_PARAM |
787 | # define YYLEX yylex (YYLEX_PARAM) | 788 | # define YYLEX yylex (YYLEX_PARAM) |
788 | #else | 789 | #else |
@@ -832,6 +833,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) | |||
832 | YYSTYPE const * const yyvaluep; | 833 | YYSTYPE const * const yyvaluep; |
833 | #endif | 834 | #endif |
834 | { | 835 | { |
836 | FILE *yyo = yyoutput; | ||
837 | YYUSE (yyo); | ||
835 | if (!yyvaluep) | 838 | if (!yyvaluep) |
836 | return; | 839 | return; |
837 | # ifdef YYPRINT | 840 | # ifdef YYPRINT |
@@ -840,11 +843,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) | |||
840 | # else | 843 | # else |
841 | YYUSE (yyoutput); | 844 | YYUSE (yyoutput); |
842 | # endif | 845 | # endif |
843 | switch (yytype) | 846 | YYUSE (yytype); |
844 | { | ||
845 | default: | ||
846 | break; | ||
847 | } | ||
848 | } | 847 | } |
849 | 848 | ||
850 | 849 | ||
@@ -1083,12 +1082,11 @@ static int | |||
1083 | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | 1082 | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, |
1084 | yytype_int16 *yyssp, int yytoken) | 1083 | yytype_int16 *yyssp, int yytoken) |
1085 | { | 1084 | { |
1086 | YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); | 1085 | YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); |
1087 | YYSIZE_T yysize = yysize0; | 1086 | YYSIZE_T yysize = yysize0; |
1088 | YYSIZE_T yysize1; | ||
1089 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; | 1087 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
1090 | /* Internationalized format string. */ | 1088 | /* Internationalized format string. */ |
1091 | const char *yyformat = 0; | 1089 | const char *yyformat = YY_NULL; |
1092 | /* Arguments of yyformat. */ | 1090 | /* Arguments of yyformat. */ |
1093 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; | 1091 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; |
1094 | /* Number of reported tokens (one for the "unexpected", one per | 1092 | /* Number of reported tokens (one for the "unexpected", one per |
@@ -1148,11 +1146,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | |||
1148 | break; | 1146 | break; |
1149 | } | 1147 | } |
1150 | yyarg[yycount++] = yytname[yyx]; | 1148 | yyarg[yycount++] = yytname[yyx]; |
1151 | yysize1 = yysize + yytnamerr (0, yytname[yyx]); | 1149 | { |
1152 | if (! (yysize <= yysize1 | 1150 | YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); |
1153 | && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | 1151 | if (! (yysize <= yysize1 |
1154 | return 2; | 1152 | && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
1155 | yysize = yysize1; | 1153 | return 2; |
1154 | yysize = yysize1; | ||
1155 | } | ||
1156 | } | 1156 | } |
1157 | } | 1157 | } |
1158 | } | 1158 | } |
@@ -1172,10 +1172,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | |||
1172 | # undef YYCASE_ | 1172 | # undef YYCASE_ |
1173 | } | 1173 | } |
1174 | 1174 | ||
1175 | yysize1 = yysize + yystrlen (yyformat); | 1175 | { |
1176 | if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | 1176 | YYSIZE_T yysize1 = yysize + yystrlen (yyformat); |
1177 | return 2; | 1177 | if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
1178 | yysize = yysize1; | 1178 | return 2; |
1179 | yysize = yysize1; | ||
1180 | } | ||
1179 | 1181 | ||
1180 | if (*yymsg_alloc < yysize) | 1182 | if (*yymsg_alloc < yysize) |
1181 | { | 1183 | { |
@@ -1231,36 +1233,26 @@ yydestruct (yymsg, yytype, yyvaluep) | |||
1231 | yymsg = "Deleting"; | 1233 | yymsg = "Deleting"; |
1232 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); | 1234 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
1233 | 1235 | ||
1234 | switch (yytype) | 1236 | YYUSE (yytype); |
1235 | { | ||
1236 | |||
1237 | default: | ||
1238 | break; | ||
1239 | } | ||
1240 | } | 1237 | } |
1241 | 1238 | ||
1242 | 1239 | ||
1243 | /* Prevent warnings from -Wmissing-prototypes. */ | ||
1244 | #ifdef YYPARSE_PARAM | ||
1245 | #if defined __STDC__ || defined __cplusplus | ||
1246 | int yyparse (void *YYPARSE_PARAM); | ||
1247 | #else | ||
1248 | int yyparse (); | ||
1249 | #endif | ||
1250 | #else /* ! YYPARSE_PARAM */ | ||
1251 | #if defined __STDC__ || defined __cplusplus | ||
1252 | int yyparse (void); | ||
1253 | #else | ||
1254 | int yyparse (); | ||
1255 | #endif | ||
1256 | #endif /* ! YYPARSE_PARAM */ | ||
1257 | 1240 | ||
1258 | 1241 | ||
1259 | /* The lookahead symbol. */ | 1242 | /* The lookahead symbol. */ |
1260 | int yychar; | 1243 | int yychar; |
1261 | 1244 | ||
1245 | |||
1246 | #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | ||
1247 | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | ||
1248 | # define YY_IGNORE_MAYBE_UNINITIALIZED_END | ||
1249 | #endif | ||
1250 | #ifndef YY_INITIAL_VALUE | ||
1251 | # define YY_INITIAL_VALUE(Value) /* Nothing. */ | ||
1252 | #endif | ||
1253 | |||
1262 | /* The semantic value of the lookahead symbol. */ | 1254 | /* The semantic value of the lookahead symbol. */ |
1263 | YYSTYPE yylval; | 1255 | YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); |
1264 | 1256 | ||
1265 | /* Number of syntax errors so far. */ | 1257 | /* Number of syntax errors so far. */ |
1266 | int yynerrs; | 1258 | int yynerrs; |
@@ -1300,7 +1292,7 @@ yyparse () | |||
1300 | `yyss': related to states. | 1292 | `yyss': related to states. |
1301 | `yyvs': related to semantic values. | 1293 | `yyvs': related to semantic values. |
1302 | 1294 | ||
1303 | Refer to the stacks thru separate pointers, to allow yyoverflow | 1295 | Refer to the stacks through separate pointers, to allow yyoverflow |
1304 | to reallocate them elsewhere. */ | 1296 | to reallocate them elsewhere. */ |
1305 | 1297 | ||
1306 | /* The state stack. */ | 1298 | /* The state stack. */ |
@@ -1318,7 +1310,7 @@ yyparse () | |||
1318 | int yyn; | 1310 | int yyn; |
1319 | int yyresult; | 1311 | int yyresult; |
1320 | /* Lookahead token as an internal (translated) token number. */ | 1312 | /* Lookahead token as an internal (translated) token number. */ |
1321 | int yytoken; | 1313 | int yytoken = 0; |
1322 | /* The variables used to return semantic value and location from the | 1314 | /* The variables used to return semantic value and location from the |
1323 | action routines. */ | 1315 | action routines. */ |
1324 | YYSTYPE yyval; | 1316 | YYSTYPE yyval; |
@@ -1336,9 +1328,8 @@ yyparse () | |||
1336 | Keep to zero when no symbol should be popped. */ | 1328 | Keep to zero when no symbol should be popped. */ |
1337 | int yylen = 0; | 1329 | int yylen = 0; |
1338 | 1330 | ||
1339 | yytoken = 0; | 1331 | yyssp = yyss = yyssa; |
1340 | yyss = yyssa; | 1332 | yyvsp = yyvs = yyvsa; |
1341 | yyvs = yyvsa; | ||
1342 | yystacksize = YYINITDEPTH; | 1333 | yystacksize = YYINITDEPTH; |
1343 | 1334 | ||
1344 | YYDPRINTF ((stderr, "Starting parse\n")); | 1335 | YYDPRINTF ((stderr, "Starting parse\n")); |
@@ -1347,14 +1338,6 @@ yyparse () | |||
1347 | yyerrstatus = 0; | 1338 | yyerrstatus = 0; |
1348 | yynerrs = 0; | 1339 | yynerrs = 0; |
1349 | yychar = YYEMPTY; /* Cause a token to be read. */ | 1340 | yychar = YYEMPTY; /* Cause a token to be read. */ |
1350 | |||
1351 | /* Initialize stack pointers. | ||
1352 | Waste one element of value and location stack | ||
1353 | so that they stay on the same level as the state stack. | ||
1354 | The wasted elements are never initialized. */ | ||
1355 | yyssp = yyss; | ||
1356 | yyvsp = yyvs; | ||
1357 | |||
1358 | goto yysetstate; | 1341 | goto yysetstate; |
1359 | 1342 | ||
1360 | /*------------------------------------------------------------. | 1343 | /*------------------------------------------------------------. |
@@ -1495,7 +1478,9 @@ yybackup: | |||
1495 | yychar = YYEMPTY; | 1478 | yychar = YYEMPTY; |
1496 | 1479 | ||
1497 | yystate = yyn; | 1480 | yystate = yyn; |
1481 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | ||
1498 | *++yyvsp = yylval; | 1482 | *++yyvsp = yylval; |
1483 | YY_IGNORE_MAYBE_UNINITIALIZED_END | ||
1499 | 1484 | ||
1500 | goto yynewstate; | 1485 | goto yynewstate; |
1501 | 1486 | ||
@@ -1532,8 +1517,7 @@ yyreduce: | |||
1532 | switch (yyn) | 1517 | switch (yyn) |
1533 | { | 1518 | { |
1534 | case 2: | 1519 | case 2: |
1535 | 1520 | /* Line 1787 of yacc.c */ | |
1536 | /* Line 1806 of yacc.c */ | ||
1537 | #line 110 "dtc-parser.y" | 1521 | #line 110 "dtc-parser.y" |
1538 | { | 1522 | { |
1539 | the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node), | 1523 | the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node), |
@@ -1542,8 +1526,7 @@ yyreduce: | |||
1542 | break; | 1526 | break; |
1543 | 1527 | ||
1544 | case 3: | 1528 | case 3: |
1545 | 1529 | /* Line 1787 of yacc.c */ | |
1546 | /* Line 1806 of yacc.c */ | ||
1547 | #line 118 "dtc-parser.y" | 1530 | #line 118 "dtc-parser.y" |
1548 | { | 1531 | { |
1549 | (yyval.re) = NULL; | 1532 | (yyval.re) = NULL; |
@@ -1551,8 +1534,7 @@ yyreduce: | |||
1551 | break; | 1534 | break; |
1552 | 1535 | ||
1553 | case 4: | 1536 | case 4: |
1554 | 1537 | /* Line 1787 of yacc.c */ | |
1555 | /* Line 1806 of yacc.c */ | ||
1556 | #line 122 "dtc-parser.y" | 1538 | #line 122 "dtc-parser.y" |
1557 | { | 1539 | { |
1558 | (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re)); | 1540 | (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re)); |
@@ -1560,8 +1542,7 @@ yyreduce: | |||
1560 | break; | 1542 | break; |
1561 | 1543 | ||
1562 | case 5: | 1544 | case 5: |
1563 | 1545 | /* Line 1787 of yacc.c */ | |
1564 | /* Line 1806 of yacc.c */ | ||
1565 | #line 129 "dtc-parser.y" | 1546 | #line 129 "dtc-parser.y" |
1566 | { | 1547 | { |
1567 | (yyval.re) = build_reserve_entry((yyvsp[(2) - (4)].integer), (yyvsp[(3) - (4)].integer)); | 1548 | (yyval.re) = build_reserve_entry((yyvsp[(2) - (4)].integer), (yyvsp[(3) - (4)].integer)); |
@@ -1569,8 +1550,7 @@ yyreduce: | |||
1569 | break; | 1550 | break; |
1570 | 1551 | ||
1571 | case 6: | 1552 | case 6: |
1572 | 1553 | /* Line 1787 of yacc.c */ | |
1573 | /* Line 1806 of yacc.c */ | ||
1574 | #line 133 "dtc-parser.y" | 1554 | #line 133 "dtc-parser.y" |
1575 | { | 1555 | { |
1576 | add_label(&(yyvsp[(2) - (2)].re)->labels, (yyvsp[(1) - (2)].labelref)); | 1556 | add_label(&(yyvsp[(2) - (2)].re)->labels, (yyvsp[(1) - (2)].labelref)); |
@@ -1579,8 +1559,7 @@ yyreduce: | |||
1579 | break; | 1559 | break; |
1580 | 1560 | ||
1581 | case 7: | 1561 | case 7: |
1582 | 1562 | /* Line 1787 of yacc.c */ | |
1583 | /* Line 1806 of yacc.c */ | ||
1584 | #line 141 "dtc-parser.y" | 1563 | #line 141 "dtc-parser.y" |
1585 | { | 1564 | { |
1586 | (yyval.node) = name_node((yyvsp[(2) - (2)].node), ""); | 1565 | (yyval.node) = name_node((yyvsp[(2) - (2)].node), ""); |
@@ -1588,8 +1567,7 @@ yyreduce: | |||
1588 | break; | 1567 | break; |
1589 | 1568 | ||
1590 | case 8: | 1569 | case 8: |
1591 | 1570 | /* Line 1787 of yacc.c */ | |
1592 | /* Line 1806 of yacc.c */ | ||
1593 | #line 145 "dtc-parser.y" | 1571 | #line 145 "dtc-parser.y" |
1594 | { | 1572 | { |
1595 | (yyval.node) = merge_nodes((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); | 1573 | (yyval.node) = merge_nodes((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); |
@@ -1597,8 +1575,7 @@ yyreduce: | |||
1597 | break; | 1575 | break; |
1598 | 1576 | ||
1599 | case 9: | 1577 | case 9: |
1600 | 1578 | /* Line 1787 of yacc.c */ | |
1601 | /* Line 1806 of yacc.c */ | ||
1602 | #line 149 "dtc-parser.y" | 1579 | #line 149 "dtc-parser.y" |
1603 | { | 1580 | { |
1604 | struct node *target = get_node_by_ref((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].labelref)); | 1581 | struct node *target = get_node_by_ref((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].labelref)); |
@@ -1612,8 +1589,7 @@ yyreduce: | |||
1612 | break; | 1589 | break; |
1613 | 1590 | ||
1614 | case 10: | 1591 | case 10: |
1615 | 1592 | /* Line 1787 of yacc.c */ | |
1616 | /* Line 1806 of yacc.c */ | ||
1617 | #line 159 "dtc-parser.y" | 1593 | #line 159 "dtc-parser.y" |
1618 | { | 1594 | { |
1619 | struct node *target = get_node_by_ref((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].labelref)); | 1595 | struct node *target = get_node_by_ref((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].labelref)); |
@@ -1628,8 +1604,7 @@ yyreduce: | |||
1628 | break; | 1604 | break; |
1629 | 1605 | ||
1630 | case 11: | 1606 | case 11: |
1631 | 1607 | /* Line 1787 of yacc.c */ | |
1632 | /* Line 1806 of yacc.c */ | ||
1633 | #line 173 "dtc-parser.y" | 1608 | #line 173 "dtc-parser.y" |
1634 | { | 1609 | { |
1635 | (yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist)); | 1610 | (yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist)); |
@@ -1637,8 +1612,7 @@ yyreduce: | |||
1637 | break; | 1612 | break; |
1638 | 1613 | ||
1639 | case 12: | 1614 | case 12: |
1640 | 1615 | /* Line 1787 of yacc.c */ | |
1641 | /* Line 1806 of yacc.c */ | ||
1642 | #line 180 "dtc-parser.y" | 1616 | #line 180 "dtc-parser.y" |
1643 | { | 1617 | { |
1644 | (yyval.proplist) = NULL; | 1618 | (yyval.proplist) = NULL; |
@@ -1646,8 +1620,7 @@ yyreduce: | |||
1646 | break; | 1620 | break; |
1647 | 1621 | ||
1648 | case 13: | 1622 | case 13: |
1649 | 1623 | /* Line 1787 of yacc.c */ | |
1650 | /* Line 1806 of yacc.c */ | ||
1651 | #line 184 "dtc-parser.y" | 1624 | #line 184 "dtc-parser.y" |
1652 | { | 1625 | { |
1653 | (yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist)); | 1626 | (yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist)); |
@@ -1655,8 +1628,7 @@ yyreduce: | |||
1655 | break; | 1628 | break; |
1656 | 1629 | ||
1657 | case 14: | 1630 | case 14: |
1658 | 1631 | /* Line 1787 of yacc.c */ | |
1659 | /* Line 1806 of yacc.c */ | ||
1660 | #line 191 "dtc-parser.y" | 1632 | #line 191 "dtc-parser.y" |
1661 | { | 1633 | { |
1662 | (yyval.prop) = build_property((yyvsp[(1) - (4)].propnodename), (yyvsp[(3) - (4)].data)); | 1634 | (yyval.prop) = build_property((yyvsp[(1) - (4)].propnodename), (yyvsp[(3) - (4)].data)); |
@@ -1664,8 +1636,7 @@ yyreduce: | |||
1664 | break; | 1636 | break; |
1665 | 1637 | ||
1666 | case 15: | 1638 | case 15: |
1667 | 1639 | /* Line 1787 of yacc.c */ | |
1668 | /* Line 1806 of yacc.c */ | ||
1669 | #line 195 "dtc-parser.y" | 1640 | #line 195 "dtc-parser.y" |
1670 | { | 1641 | { |
1671 | (yyval.prop) = build_property((yyvsp[(1) - (2)].propnodename), empty_data); | 1642 | (yyval.prop) = build_property((yyvsp[(1) - (2)].propnodename), empty_data); |
@@ -1673,8 +1644,7 @@ yyreduce: | |||
1673 | break; | 1644 | break; |
1674 | 1645 | ||
1675 | case 16: | 1646 | case 16: |
1676 | 1647 | /* Line 1787 of yacc.c */ | |
1677 | /* Line 1806 of yacc.c */ | ||
1678 | #line 199 "dtc-parser.y" | 1648 | #line 199 "dtc-parser.y" |
1679 | { | 1649 | { |
1680 | (yyval.prop) = build_property_delete((yyvsp[(2) - (3)].propnodename)); | 1650 | (yyval.prop) = build_property_delete((yyvsp[(2) - (3)].propnodename)); |
@@ -1682,8 +1652,7 @@ yyreduce: | |||
1682 | break; | 1652 | break; |
1683 | 1653 | ||
1684 | case 17: | 1654 | case 17: |
1685 | 1655 | /* Line 1787 of yacc.c */ | |
1686 | /* Line 1806 of yacc.c */ | ||
1687 | #line 203 "dtc-parser.y" | 1656 | #line 203 "dtc-parser.y" |
1688 | { | 1657 | { |
1689 | add_label(&(yyvsp[(2) - (2)].prop)->labels, (yyvsp[(1) - (2)].labelref)); | 1658 | add_label(&(yyvsp[(2) - (2)].prop)->labels, (yyvsp[(1) - (2)].labelref)); |
@@ -1692,8 +1661,7 @@ yyreduce: | |||
1692 | break; | 1661 | break; |
1693 | 1662 | ||
1694 | case 18: | 1663 | case 18: |
1695 | 1664 | /* Line 1787 of yacc.c */ | |
1696 | /* Line 1806 of yacc.c */ | ||
1697 | #line 211 "dtc-parser.y" | 1665 | #line 211 "dtc-parser.y" |
1698 | { | 1666 | { |
1699 | (yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data)); | 1667 | (yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data)); |
@@ -1701,8 +1669,7 @@ yyreduce: | |||
1701 | break; | 1669 | break; |
1702 | 1670 | ||
1703 | case 19: | 1671 | case 19: |
1704 | 1672 | /* Line 1787 of yacc.c */ | |
1705 | /* Line 1806 of yacc.c */ | ||
1706 | #line 215 "dtc-parser.y" | 1673 | #line 215 "dtc-parser.y" |
1707 | { | 1674 | { |
1708 | (yyval.data) = data_merge((yyvsp[(1) - (3)].data), (yyvsp[(2) - (3)].array).data); | 1675 | (yyval.data) = data_merge((yyvsp[(1) - (3)].data), (yyvsp[(2) - (3)].array).data); |
@@ -1710,8 +1677,7 @@ yyreduce: | |||
1710 | break; | 1677 | break; |
1711 | 1678 | ||
1712 | case 20: | 1679 | case 20: |
1713 | 1680 | /* Line 1787 of yacc.c */ | |
1714 | /* Line 1806 of yacc.c */ | ||
1715 | #line 219 "dtc-parser.y" | 1681 | #line 219 "dtc-parser.y" |
1716 | { | 1682 | { |
1717 | (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data)); | 1683 | (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data)); |
@@ -1719,8 +1685,7 @@ yyreduce: | |||
1719 | break; | 1685 | break; |
1720 | 1686 | ||
1721 | case 21: | 1687 | case 21: |
1722 | 1688 | /* Line 1787 of yacc.c */ | |
1723 | /* Line 1806 of yacc.c */ | ||
1724 | #line 223 "dtc-parser.y" | 1689 | #line 223 "dtc-parser.y" |
1725 | { | 1690 | { |
1726 | (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref)); | 1691 | (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref)); |
@@ -1728,8 +1693,7 @@ yyreduce: | |||
1728 | break; | 1693 | break; |
1729 | 1694 | ||
1730 | case 22: | 1695 | case 22: |
1731 | 1696 | /* Line 1787 of yacc.c */ | |
1732 | /* Line 1806 of yacc.c */ | ||
1733 | #line 227 "dtc-parser.y" | 1697 | #line 227 "dtc-parser.y" |
1734 | { | 1698 | { |
1735 | FILE *f = srcfile_relative_open((yyvsp[(4) - (9)].data).val, NULL); | 1699 | FILE *f = srcfile_relative_open((yyvsp[(4) - (9)].data).val, NULL); |
@@ -1750,8 +1714,7 @@ yyreduce: | |||
1750 | break; | 1714 | break; |
1751 | 1715 | ||
1752 | case 23: | 1716 | case 23: |
1753 | 1717 | /* Line 1787 of yacc.c */ | |
1754 | /* Line 1806 of yacc.c */ | ||
1755 | #line 244 "dtc-parser.y" | 1718 | #line 244 "dtc-parser.y" |
1756 | { | 1719 | { |
1757 | FILE *f = srcfile_relative_open((yyvsp[(4) - (5)].data).val, NULL); | 1720 | FILE *f = srcfile_relative_open((yyvsp[(4) - (5)].data).val, NULL); |
@@ -1765,8 +1728,7 @@ yyreduce: | |||
1765 | break; | 1728 | break; |
1766 | 1729 | ||
1767 | case 24: | 1730 | case 24: |
1768 | 1731 | /* Line 1787 of yacc.c */ | |
1769 | /* Line 1806 of yacc.c */ | ||
1770 | #line 254 "dtc-parser.y" | 1732 | #line 254 "dtc-parser.y" |
1771 | { | 1733 | { |
1772 | (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref)); | 1734 | (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref)); |
@@ -1774,8 +1736,7 @@ yyreduce: | |||
1774 | break; | 1736 | break; |
1775 | 1737 | ||
1776 | case 25: | 1738 | case 25: |
1777 | 1739 | /* Line 1787 of yacc.c */ | |
1778 | /* Line 1806 of yacc.c */ | ||
1779 | #line 261 "dtc-parser.y" | 1740 | #line 261 "dtc-parser.y" |
1780 | { | 1741 | { |
1781 | (yyval.data) = empty_data; | 1742 | (yyval.data) = empty_data; |
@@ -1783,8 +1744,7 @@ yyreduce: | |||
1783 | break; | 1744 | break; |
1784 | 1745 | ||
1785 | case 26: | 1746 | case 26: |
1786 | 1747 | /* Line 1787 of yacc.c */ | |
1787 | /* Line 1806 of yacc.c */ | ||
1788 | #line 265 "dtc-parser.y" | 1748 | #line 265 "dtc-parser.y" |
1789 | { | 1749 | { |
1790 | (yyval.data) = (yyvsp[(1) - (2)].data); | 1750 | (yyval.data) = (yyvsp[(1) - (2)].data); |
@@ -1792,8 +1752,7 @@ yyreduce: | |||
1792 | break; | 1752 | break; |
1793 | 1753 | ||
1794 | case 27: | 1754 | case 27: |
1795 | 1755 | /* Line 1787 of yacc.c */ | |
1796 | /* Line 1806 of yacc.c */ | ||
1797 | #line 269 "dtc-parser.y" | 1756 | #line 269 "dtc-parser.y" |
1798 | { | 1757 | { |
1799 | (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref)); | 1758 | (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref)); |
@@ -1801,8 +1760,7 @@ yyreduce: | |||
1801 | break; | 1760 | break; |
1802 | 1761 | ||
1803 | case 28: | 1762 | case 28: |
1804 | 1763 | /* Line 1787 of yacc.c */ | |
1805 | /* Line 1806 of yacc.c */ | ||
1806 | #line 276 "dtc-parser.y" | 1764 | #line 276 "dtc-parser.y" |
1807 | { | 1765 | { |
1808 | (yyval.array).data = empty_data; | 1766 | (yyval.array).data = empty_data; |
@@ -1821,8 +1779,7 @@ yyreduce: | |||
1821 | break; | 1779 | break; |
1822 | 1780 | ||
1823 | case 29: | 1781 | case 29: |
1824 | 1782 | /* Line 1787 of yacc.c */ | |
1825 | /* Line 1806 of yacc.c */ | ||
1826 | #line 291 "dtc-parser.y" | 1783 | #line 291 "dtc-parser.y" |
1827 | { | 1784 | { |
1828 | (yyval.array).data = empty_data; | 1785 | (yyval.array).data = empty_data; |
@@ -1831,8 +1788,7 @@ yyreduce: | |||
1831 | break; | 1788 | break; |
1832 | 1789 | ||
1833 | case 30: | 1790 | case 30: |
1834 | 1791 | /* Line 1787 of yacc.c */ | |
1835 | /* Line 1806 of yacc.c */ | ||
1836 | #line 296 "dtc-parser.y" | 1792 | #line 296 "dtc-parser.y" |
1837 | { | 1793 | { |
1838 | if ((yyvsp[(1) - (2)].array).bits < 64) { | 1794 | if ((yyvsp[(1) - (2)].array).bits < 64) { |
@@ -1856,8 +1812,7 @@ yyreduce: | |||
1856 | break; | 1812 | break; |
1857 | 1813 | ||
1858 | case 31: | 1814 | case 31: |
1859 | 1815 | /* Line 1787 of yacc.c */ | |
1860 | /* Line 1806 of yacc.c */ | ||
1861 | #line 316 "dtc-parser.y" | 1816 | #line 316 "dtc-parser.y" |
1862 | { | 1817 | { |
1863 | uint64_t val = ~0ULL >> (64 - (yyvsp[(1) - (2)].array).bits); | 1818 | uint64_t val = ~0ULL >> (64 - (yyvsp[(1) - (2)].array).bits); |
@@ -1875,8 +1830,7 @@ yyreduce: | |||
1875 | break; | 1830 | break; |
1876 | 1831 | ||
1877 | case 32: | 1832 | case 32: |
1878 | 1833 | /* Line 1787 of yacc.c */ | |
1879 | /* Line 1806 of yacc.c */ | ||
1880 | #line 330 "dtc-parser.y" | 1834 | #line 330 "dtc-parser.y" |
1881 | { | 1835 | { |
1882 | (yyval.array).data = data_add_marker((yyvsp[(1) - (2)].array).data, LABEL, (yyvsp[(2) - (2)].labelref)); | 1836 | (yyval.array).data = data_add_marker((yyvsp[(1) - (2)].array).data, LABEL, (yyvsp[(2) - (2)].labelref)); |
@@ -1884,8 +1838,7 @@ yyreduce: | |||
1884 | break; | 1838 | break; |
1885 | 1839 | ||
1886 | case 33: | 1840 | case 33: |
1887 | 1841 | /* Line 1787 of yacc.c */ | |
1888 | /* Line 1806 of yacc.c */ | ||
1889 | #line 337 "dtc-parser.y" | 1842 | #line 337 "dtc-parser.y" |
1890 | { | 1843 | { |
1891 | (yyval.integer) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64); | 1844 | (yyval.integer) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64); |
@@ -1893,8 +1846,7 @@ yyreduce: | |||
1893 | break; | 1846 | break; |
1894 | 1847 | ||
1895 | case 34: | 1848 | case 34: |
1896 | 1849 | /* Line 1787 of yacc.c */ | |
1897 | /* Line 1806 of yacc.c */ | ||
1898 | #line 341 "dtc-parser.y" | 1850 | #line 341 "dtc-parser.y" |
1899 | { | 1851 | { |
1900 | (yyval.integer) = eval_char_literal((yyvsp[(1) - (1)].literal)); | 1852 | (yyval.integer) = eval_char_literal((yyvsp[(1) - (1)].literal)); |
@@ -1902,8 +1854,7 @@ yyreduce: | |||
1902 | break; | 1854 | break; |
1903 | 1855 | ||
1904 | case 35: | 1856 | case 35: |
1905 | 1857 | /* Line 1787 of yacc.c */ | |
1906 | /* Line 1806 of yacc.c */ | ||
1907 | #line 345 "dtc-parser.y" | 1858 | #line 345 "dtc-parser.y" |
1908 | { | 1859 | { |
1909 | (yyval.integer) = (yyvsp[(2) - (3)].integer); | 1860 | (yyval.integer) = (yyvsp[(2) - (3)].integer); |
@@ -1911,162 +1862,139 @@ yyreduce: | |||
1911 | break; | 1862 | break; |
1912 | 1863 | ||
1913 | case 38: | 1864 | case 38: |
1914 | 1865 | /* Line 1787 of yacc.c */ | |
1915 | /* Line 1806 of yacc.c */ | ||
1916 | #line 356 "dtc-parser.y" | 1866 | #line 356 "dtc-parser.y" |
1917 | { (yyval.integer) = (yyvsp[(1) - (5)].integer) ? (yyvsp[(3) - (5)].integer) : (yyvsp[(5) - (5)].integer); } | 1867 | { (yyval.integer) = (yyvsp[(1) - (5)].integer) ? (yyvsp[(3) - (5)].integer) : (yyvsp[(5) - (5)].integer); } |
1918 | break; | 1868 | break; |
1919 | 1869 | ||
1920 | case 40: | 1870 | case 40: |
1921 | 1871 | /* Line 1787 of yacc.c */ | |
1922 | /* Line 1806 of yacc.c */ | ||
1923 | #line 361 "dtc-parser.y" | 1872 | #line 361 "dtc-parser.y" |
1924 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) || (yyvsp[(3) - (3)].integer); } | 1873 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) || (yyvsp[(3) - (3)].integer); } |
1925 | break; | 1874 | break; |
1926 | 1875 | ||
1927 | case 42: | 1876 | case 42: |
1928 | 1877 | /* Line 1787 of yacc.c */ | |
1929 | /* Line 1806 of yacc.c */ | ||
1930 | #line 366 "dtc-parser.y" | 1878 | #line 366 "dtc-parser.y" |
1931 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) && (yyvsp[(3) - (3)].integer); } | 1879 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) && (yyvsp[(3) - (3)].integer); } |
1932 | break; | 1880 | break; |
1933 | 1881 | ||
1934 | case 44: | 1882 | case 44: |
1935 | 1883 | /* Line 1787 of yacc.c */ | |
1936 | /* Line 1806 of yacc.c */ | ||
1937 | #line 371 "dtc-parser.y" | 1884 | #line 371 "dtc-parser.y" |
1938 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) | (yyvsp[(3) - (3)].integer); } | 1885 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) | (yyvsp[(3) - (3)].integer); } |
1939 | break; | 1886 | break; |
1940 | 1887 | ||
1941 | case 46: | 1888 | case 46: |
1942 | 1889 | /* Line 1787 of yacc.c */ | |
1943 | /* Line 1806 of yacc.c */ | ||
1944 | #line 376 "dtc-parser.y" | 1890 | #line 376 "dtc-parser.y" |
1945 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) ^ (yyvsp[(3) - (3)].integer); } | 1891 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) ^ (yyvsp[(3) - (3)].integer); } |
1946 | break; | 1892 | break; |
1947 | 1893 | ||
1948 | case 48: | 1894 | case 48: |
1949 | 1895 | /* Line 1787 of yacc.c */ | |
1950 | /* Line 1806 of yacc.c */ | ||
1951 | #line 381 "dtc-parser.y" | 1896 | #line 381 "dtc-parser.y" |
1952 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) & (yyvsp[(3) - (3)].integer); } | 1897 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) & (yyvsp[(3) - (3)].integer); } |
1953 | break; | 1898 | break; |
1954 | 1899 | ||
1955 | case 50: | 1900 | case 50: |
1956 | 1901 | /* Line 1787 of yacc.c */ | |
1957 | /* Line 1806 of yacc.c */ | ||
1958 | #line 386 "dtc-parser.y" | 1902 | #line 386 "dtc-parser.y" |
1959 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) == (yyvsp[(3) - (3)].integer); } | 1903 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) == (yyvsp[(3) - (3)].integer); } |
1960 | break; | 1904 | break; |
1961 | 1905 | ||
1962 | case 51: | 1906 | case 51: |
1963 | 1907 | /* Line 1787 of yacc.c */ | |
1964 | /* Line 1806 of yacc.c */ | ||
1965 | #line 387 "dtc-parser.y" | 1908 | #line 387 "dtc-parser.y" |
1966 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) != (yyvsp[(3) - (3)].integer); } | 1909 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) != (yyvsp[(3) - (3)].integer); } |
1967 | break; | 1910 | break; |
1968 | 1911 | ||
1969 | case 53: | 1912 | case 53: |
1970 | 1913 | /* Line 1787 of yacc.c */ | |
1971 | /* Line 1806 of yacc.c */ | ||
1972 | #line 392 "dtc-parser.y" | 1914 | #line 392 "dtc-parser.y" |
1973 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) < (yyvsp[(3) - (3)].integer); } | 1915 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) < (yyvsp[(3) - (3)].integer); } |
1974 | break; | 1916 | break; |
1975 | 1917 | ||
1976 | case 54: | 1918 | case 54: |
1977 | 1919 | /* Line 1787 of yacc.c */ | |
1978 | /* Line 1806 of yacc.c */ | ||
1979 | #line 393 "dtc-parser.y" | 1920 | #line 393 "dtc-parser.y" |
1980 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) > (yyvsp[(3) - (3)].integer); } | 1921 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) > (yyvsp[(3) - (3)].integer); } |
1981 | break; | 1922 | break; |
1982 | 1923 | ||
1983 | case 55: | 1924 | case 55: |
1984 | 1925 | /* Line 1787 of yacc.c */ | |
1985 | /* Line 1806 of yacc.c */ | ||
1986 | #line 394 "dtc-parser.y" | 1926 | #line 394 "dtc-parser.y" |
1987 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) <= (yyvsp[(3) - (3)].integer); } | 1927 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) <= (yyvsp[(3) - (3)].integer); } |
1988 | break; | 1928 | break; |
1989 | 1929 | ||
1990 | case 56: | 1930 | case 56: |
1991 | 1931 | /* Line 1787 of yacc.c */ | |
1992 | /* Line 1806 of yacc.c */ | ||
1993 | #line 395 "dtc-parser.y" | 1932 | #line 395 "dtc-parser.y" |
1994 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) >= (yyvsp[(3) - (3)].integer); } | 1933 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) >= (yyvsp[(3) - (3)].integer); } |
1995 | break; | 1934 | break; |
1996 | 1935 | ||
1997 | case 57: | 1936 | case 57: |
1998 | 1937 | /* Line 1787 of yacc.c */ | |
1999 | /* Line 1806 of yacc.c */ | ||
2000 | #line 399 "dtc-parser.y" | 1938 | #line 399 "dtc-parser.y" |
2001 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) << (yyvsp[(3) - (3)].integer); } | 1939 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) << (yyvsp[(3) - (3)].integer); } |
2002 | break; | 1940 | break; |
2003 | 1941 | ||
2004 | case 58: | 1942 | case 58: |
2005 | 1943 | /* Line 1787 of yacc.c */ | |
2006 | /* Line 1806 of yacc.c */ | ||
2007 | #line 400 "dtc-parser.y" | 1944 | #line 400 "dtc-parser.y" |
2008 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) >> (yyvsp[(3) - (3)].integer); } | 1945 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) >> (yyvsp[(3) - (3)].integer); } |
2009 | break; | 1946 | break; |
2010 | 1947 | ||
2011 | case 60: | 1948 | case 60: |
2012 | 1949 | /* Line 1787 of yacc.c */ | |
2013 | /* Line 1806 of yacc.c */ | ||
2014 | #line 405 "dtc-parser.y" | 1950 | #line 405 "dtc-parser.y" |
2015 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) + (yyvsp[(3) - (3)].integer); } | 1951 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) + (yyvsp[(3) - (3)].integer); } |
2016 | break; | 1952 | break; |
2017 | 1953 | ||
2018 | case 61: | 1954 | case 61: |
2019 | 1955 | /* Line 1787 of yacc.c */ | |
2020 | /* Line 1806 of yacc.c */ | ||
2021 | #line 406 "dtc-parser.y" | 1956 | #line 406 "dtc-parser.y" |
2022 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) - (yyvsp[(3) - (3)].integer); } | 1957 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) - (yyvsp[(3) - (3)].integer); } |
2023 | break; | 1958 | break; |
2024 | 1959 | ||
2025 | case 63: | 1960 | case 63: |
2026 | 1961 | /* Line 1787 of yacc.c */ | |
2027 | /* Line 1806 of yacc.c */ | ||
2028 | #line 411 "dtc-parser.y" | 1962 | #line 411 "dtc-parser.y" |
2029 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) * (yyvsp[(3) - (3)].integer); } | 1963 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) * (yyvsp[(3) - (3)].integer); } |
2030 | break; | 1964 | break; |
2031 | 1965 | ||
2032 | case 64: | 1966 | case 64: |
2033 | 1967 | /* Line 1787 of yacc.c */ | |
2034 | /* Line 1806 of yacc.c */ | ||
2035 | #line 412 "dtc-parser.y" | 1968 | #line 412 "dtc-parser.y" |
2036 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) / (yyvsp[(3) - (3)].integer); } | 1969 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) / (yyvsp[(3) - (3)].integer); } |
2037 | break; | 1970 | break; |
2038 | 1971 | ||
2039 | case 65: | 1972 | case 65: |
2040 | 1973 | /* Line 1787 of yacc.c */ | |
2041 | /* Line 1806 of yacc.c */ | ||
2042 | #line 413 "dtc-parser.y" | 1974 | #line 413 "dtc-parser.y" |
2043 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) % (yyvsp[(3) - (3)].integer); } | 1975 | { (yyval.integer) = (yyvsp[(1) - (3)].integer) % (yyvsp[(3) - (3)].integer); } |
2044 | break; | 1976 | break; |
2045 | 1977 | ||
2046 | case 68: | 1978 | case 68: |
2047 | 1979 | /* Line 1787 of yacc.c */ | |
2048 | /* Line 1806 of yacc.c */ | ||
2049 | #line 419 "dtc-parser.y" | 1980 | #line 419 "dtc-parser.y" |
2050 | { (yyval.integer) = -(yyvsp[(2) - (2)].integer); } | 1981 | { (yyval.integer) = -(yyvsp[(2) - (2)].integer); } |
2051 | break; | 1982 | break; |
2052 | 1983 | ||
2053 | case 69: | 1984 | case 69: |
2054 | 1985 | /* Line 1787 of yacc.c */ | |
2055 | /* Line 1806 of yacc.c */ | ||
2056 | #line 420 "dtc-parser.y" | 1986 | #line 420 "dtc-parser.y" |
2057 | { (yyval.integer) = ~(yyvsp[(2) - (2)].integer); } | 1987 | { (yyval.integer) = ~(yyvsp[(2) - (2)].integer); } |
2058 | break; | 1988 | break; |
2059 | 1989 | ||
2060 | case 70: | 1990 | case 70: |
2061 | 1991 | /* Line 1787 of yacc.c */ | |
2062 | /* Line 1806 of yacc.c */ | ||
2063 | #line 421 "dtc-parser.y" | 1992 | #line 421 "dtc-parser.y" |
2064 | { (yyval.integer) = !(yyvsp[(2) - (2)].integer); } | 1993 | { (yyval.integer) = !(yyvsp[(2) - (2)].integer); } |
2065 | break; | 1994 | break; |
2066 | 1995 | ||
2067 | case 71: | 1996 | case 71: |
2068 | 1997 | /* Line 1787 of yacc.c */ | |
2069 | /* Line 1806 of yacc.c */ | ||
2070 | #line 426 "dtc-parser.y" | 1998 | #line 426 "dtc-parser.y" |
2071 | { | 1999 | { |
2072 | (yyval.data) = empty_data; | 2000 | (yyval.data) = empty_data; |
@@ -2074,8 +2002,7 @@ yyreduce: | |||
2074 | break; | 2002 | break; |
2075 | 2003 | ||
2076 | case 72: | 2004 | case 72: |
2077 | 2005 | /* Line 1787 of yacc.c */ | |
2078 | /* Line 1806 of yacc.c */ | ||
2079 | #line 430 "dtc-parser.y" | 2006 | #line 430 "dtc-parser.y" |
2080 | { | 2007 | { |
2081 | (yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte)); | 2008 | (yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte)); |
@@ -2083,8 +2010,7 @@ yyreduce: | |||
2083 | break; | 2010 | break; |
2084 | 2011 | ||
2085 | case 73: | 2012 | case 73: |
2086 | 2013 | /* Line 1787 of yacc.c */ | |
2087 | /* Line 1806 of yacc.c */ | ||
2088 | #line 434 "dtc-parser.y" | 2014 | #line 434 "dtc-parser.y" |
2089 | { | 2015 | { |
2090 | (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref)); | 2016 | (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref)); |
@@ -2092,8 +2018,7 @@ yyreduce: | |||
2092 | break; | 2018 | break; |
2093 | 2019 | ||
2094 | case 74: | 2020 | case 74: |
2095 | 2021 | /* Line 1787 of yacc.c */ | |
2096 | /* Line 1806 of yacc.c */ | ||
2097 | #line 441 "dtc-parser.y" | 2022 | #line 441 "dtc-parser.y" |
2098 | { | 2023 | { |
2099 | (yyval.nodelist) = NULL; | 2024 | (yyval.nodelist) = NULL; |
@@ -2101,8 +2026,7 @@ yyreduce: | |||
2101 | break; | 2026 | break; |
2102 | 2027 | ||
2103 | case 75: | 2028 | case 75: |
2104 | 2029 | /* Line 1787 of yacc.c */ | |
2105 | /* Line 1806 of yacc.c */ | ||
2106 | #line 445 "dtc-parser.y" | 2030 | #line 445 "dtc-parser.y" |
2107 | { | 2031 | { |
2108 | (yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist)); | 2032 | (yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist)); |
@@ -2110,8 +2034,7 @@ yyreduce: | |||
2110 | break; | 2034 | break; |
2111 | 2035 | ||
2112 | case 76: | 2036 | case 76: |
2113 | 2037 | /* Line 1787 of yacc.c */ | |
2114 | /* Line 1806 of yacc.c */ | ||
2115 | #line 449 "dtc-parser.y" | 2038 | #line 449 "dtc-parser.y" |
2116 | { | 2039 | { |
2117 | print_error("syntax error: properties must precede subnodes"); | 2040 | print_error("syntax error: properties must precede subnodes"); |
@@ -2120,8 +2043,7 @@ yyreduce: | |||
2120 | break; | 2043 | break; |
2121 | 2044 | ||
2122 | case 77: | 2045 | case 77: |
2123 | 2046 | /* Line 1787 of yacc.c */ | |
2124 | /* Line 1806 of yacc.c */ | ||
2125 | #line 457 "dtc-parser.y" | 2047 | #line 457 "dtc-parser.y" |
2126 | { | 2048 | { |
2127 | (yyval.node) = name_node((yyvsp[(2) - (2)].node), (yyvsp[(1) - (2)].propnodename)); | 2049 | (yyval.node) = name_node((yyvsp[(2) - (2)].node), (yyvsp[(1) - (2)].propnodename)); |
@@ -2129,8 +2051,7 @@ yyreduce: | |||
2129 | break; | 2051 | break; |
2130 | 2052 | ||
2131 | case 78: | 2053 | case 78: |
2132 | 2054 | /* Line 1787 of yacc.c */ | |
2133 | /* Line 1806 of yacc.c */ | ||
2134 | #line 461 "dtc-parser.y" | 2055 | #line 461 "dtc-parser.y" |
2135 | { | 2056 | { |
2136 | (yyval.node) = name_node(build_node_delete(), (yyvsp[(2) - (3)].propnodename)); | 2057 | (yyval.node) = name_node(build_node_delete(), (yyvsp[(2) - (3)].propnodename)); |
@@ -2138,8 +2059,7 @@ yyreduce: | |||
2138 | break; | 2059 | break; |
2139 | 2060 | ||
2140 | case 79: | 2061 | case 79: |
2141 | 2062 | /* Line 1787 of yacc.c */ | |
2142 | /* Line 1806 of yacc.c */ | ||
2143 | #line 465 "dtc-parser.y" | 2063 | #line 465 "dtc-parser.y" |
2144 | { | 2064 | { |
2145 | add_label(&(yyvsp[(2) - (2)].node)->labels, (yyvsp[(1) - (2)].labelref)); | 2065 | add_label(&(yyvsp[(2) - (2)].node)->labels, (yyvsp[(1) - (2)].labelref)); |
@@ -2148,9 +2068,8 @@ yyreduce: | |||
2148 | break; | 2068 | break; |
2149 | 2069 | ||
2150 | 2070 | ||
2151 | 2071 | /* Line 1787 of yacc.c */ | |
2152 | /* Line 1806 of yacc.c */ | 2072 | #line 2073 "dtc-parser.tab.c" |
2153 | #line 2154 "dtc-parser.tab.c" | ||
2154 | default: break; | 2073 | default: break; |
2155 | } | 2074 | } |
2156 | /* User semantic actions sometimes alter yychar, and that requires | 2075 | /* User semantic actions sometimes alter yychar, and that requires |
@@ -2313,7 +2232,9 @@ yyerrlab1: | |||
2313 | YY_STACK_PRINT (yyss, yyssp); | 2232 | YY_STACK_PRINT (yyss, yyssp); |
2314 | } | 2233 | } |
2315 | 2234 | ||
2235 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | ||
2316 | *++yyvsp = yylval; | 2236 | *++yyvsp = yylval; |
2237 | YY_IGNORE_MAYBE_UNINITIALIZED_END | ||
2317 | 2238 | ||
2318 | 2239 | ||
2319 | /* Shift the error token. */ | 2240 | /* Shift the error token. */ |
@@ -2337,7 +2258,7 @@ yyabortlab: | |||
2337 | yyresult = 1; | 2258 | yyresult = 1; |
2338 | goto yyreturn; | 2259 | goto yyreturn; |
2339 | 2260 | ||
2340 | #if !defined(yyoverflow) || YYERROR_VERBOSE | 2261 | #if !defined yyoverflow || YYERROR_VERBOSE |
2341 | /*-------------------------------------------------. | 2262 | /*-------------------------------------------------. |
2342 | | yyexhaustedlab -- memory exhaustion comes here. | | 2263 | | yyexhaustedlab -- memory exhaustion comes here. | |
2343 | `-------------------------------------------------*/ | 2264 | `-------------------------------------------------*/ |
@@ -2379,8 +2300,7 @@ yyreturn: | |||
2379 | } | 2300 | } |
2380 | 2301 | ||
2381 | 2302 | ||
2382 | 2303 | /* Line 2050 of yacc.c */ | |
2383 | /* Line 2067 of yacc.c */ | ||
2384 | #line 471 "dtc-parser.y" | 2304 | #line 471 "dtc-parser.y" |
2385 | 2305 | ||
2386 | 2306 | ||
@@ -2444,4 +2364,3 @@ static unsigned char eval_char_literal(const char *s) | |||
2444 | 2364 | ||
2445 | return c; | 2365 | return c; |
2446 | } | 2366 | } |
2447 | |||
diff --git a/scripts/dtc/dtc-parser.tab.h_shipped b/scripts/dtc/dtc-parser.tab.h_shipped index 25d3b88c6132..b2e7a86cd85e 100644 --- a/scripts/dtc/dtc-parser.tab.h_shipped +++ b/scripts/dtc/dtc-parser.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.7.12-4996. */ |
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-2013 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 |
@@ -30,6 +30,15 @@ | |||
30 | This special exception was added by the Free Software Foundation in | 30 | This special exception was added by the Free Software Foundation in |
31 | version 2.2 of Bison. */ | 31 | version 2.2 of Bison. */ |
32 | 32 | ||
33 | #ifndef YY_YY_DTC_PARSER_TAB_H_INCLUDED | ||
34 | # define YY_YY_DTC_PARSER_TAB_H_INCLUDED | ||
35 | /* Enabling traces. */ | ||
36 | #ifndef YYDEBUG | ||
37 | # define YYDEBUG 0 | ||
38 | #endif | ||
39 | #if YYDEBUG | ||
40 | extern int yydebug; | ||
41 | #endif | ||
33 | 42 | ||
34 | /* Tokens. */ | 43 | /* Tokens. */ |
35 | #ifndef YYTOKENTYPE | 44 | #ifndef YYTOKENTYPE |
@@ -63,12 +72,10 @@ | |||
63 | #endif | 72 | #endif |
64 | 73 | ||
65 | 74 | ||
66 | |||
67 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED | 75 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
68 | typedef union YYSTYPE | 76 | typedef union YYSTYPE |
69 | { | 77 | { |
70 | 78 | /* Line 2053 of yacc.c */ | |
71 | /* Line 2068 of yacc.c */ | ||
72 | #line 40 "dtc-parser.y" | 79 | #line 40 "dtc-parser.y" |
73 | 80 | ||
74 | char *propnodename; | 81 | char *propnodename; |
@@ -91,9 +98,8 @@ typedef union YYSTYPE | |||
91 | uint64_t integer; | 98 | uint64_t integer; |
92 | 99 | ||
93 | 100 | ||
94 | 101 | /* Line 2053 of yacc.c */ | |
95 | /* Line 2068 of yacc.c */ | 102 | #line 103 "dtc-parser.tab.h" |
96 | #line 97 "dtc-parser.tab.h" | ||
97 | } YYSTYPE; | 103 | } YYSTYPE; |
98 | # define YYSTYPE_IS_TRIVIAL 1 | 104 | # define YYSTYPE_IS_TRIVIAL 1 |
99 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ | 105 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ |
@@ -102,4 +108,18 @@ typedef union YYSTYPE | |||
102 | 108 | ||
103 | extern YYSTYPE yylval; | 109 | extern YYSTYPE yylval; |
104 | 110 | ||
111 | #ifdef YYPARSE_PARAM | ||
112 | #if defined __STDC__ || defined __cplusplus | ||
113 | int yyparse (void *YYPARSE_PARAM); | ||
114 | #else | ||
115 | int yyparse (); | ||
116 | #endif | ||
117 | #else /* ! YYPARSE_PARAM */ | ||
118 | #if defined __STDC__ || defined __cplusplus | ||
119 | int yyparse (void); | ||
120 | #else | ||
121 | int yyparse (); | ||
122 | #endif | ||
123 | #endif /* ! YYPARSE_PARAM */ | ||
105 | 124 | ||
125 | #endif /* !YY_YY_DTC_PARSER_TAB_H_INCLUDED */ | ||
diff --git a/scripts/dtc/dtc.c b/scripts/dtc/dtc.c index a375683c1534..e3c96536fd9d 100644 --- a/scripts/dtc/dtc.c +++ b/scripts/dtc/dtc.c | |||
@@ -21,8 +21,6 @@ | |||
21 | #include "dtc.h" | 21 | #include "dtc.h" |
22 | #include "srcpos.h" | 22 | #include "srcpos.h" |
23 | 23 | ||
24 | #include "version_gen.h" | ||
25 | |||
26 | /* | 24 | /* |
27 | * Command line options | 25 | * Command line options |
28 | */ | 26 | */ |
@@ -49,55 +47,60 @@ static void fill_fullpaths(struct node *tree, const char *prefix) | |||
49 | fill_fullpaths(child, tree->fullpath); | 47 | fill_fullpaths(child, tree->fullpath); |
50 | } | 48 | } |
51 | 49 | ||
52 | static void __attribute__ ((noreturn)) usage(void) | 50 | /* Usage related data. */ |
53 | { | 51 | static const char usage_synopsis[] = "dtc [options] <input file>"; |
54 | fprintf(stderr, "Usage:\n"); | 52 | static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:hv"; |
55 | fprintf(stderr, "\tdtc [options] <input file>\n"); | 53 | static struct option const usage_long_opts[] = { |
56 | fprintf(stderr, "\nOptions:\n"); | 54 | {"quiet", no_argument, NULL, 'q'}, |
57 | fprintf(stderr, "\t-h\n"); | 55 | {"in-format", a_argument, NULL, 'I'}, |
58 | fprintf(stderr, "\t\tThis help text\n"); | 56 | {"out", a_argument, NULL, 'o'}, |
59 | fprintf(stderr, "\t-q\n"); | 57 | {"out-format", a_argument, NULL, 'O'}, |
60 | fprintf(stderr, "\t\tQuiet: -q suppress warnings, -qq errors, -qqq all\n"); | 58 | {"out-version", a_argument, NULL, 'V'}, |
61 | fprintf(stderr, "\t-I <input format>\n"); | 59 | {"out-dependency", a_argument, NULL, 'd'}, |
62 | fprintf(stderr, "\t\tInput formats are:\n"); | 60 | {"reserve", a_argument, NULL, 'R'}, |
63 | fprintf(stderr, "\t\t\tdts - device tree source text\n"); | 61 | {"space", a_argument, NULL, 'S'}, |
64 | fprintf(stderr, "\t\t\tdtb - device tree blob\n"); | 62 | {"pad", a_argument, NULL, 'p'}, |
65 | fprintf(stderr, "\t\t\tfs - /proc/device-tree style directory\n"); | 63 | {"boot-cpu", a_argument, NULL, 'b'}, |
66 | fprintf(stderr, "\t-o <output file>\n"); | 64 | {"force", no_argument, NULL, 'f'}, |
67 | fprintf(stderr, "\t-O <output format>\n"); | 65 | {"include", a_argument, NULL, 'i'}, |
68 | fprintf(stderr, "\t\tOutput formats are:\n"); | 66 | {"sort", no_argument, NULL, 's'}, |
69 | fprintf(stderr, "\t\t\tdts - device tree source text\n"); | 67 | {"phandle", a_argument, NULL, 'H'}, |
70 | fprintf(stderr, "\t\t\tdtb - device tree blob\n"); | 68 | {"warning", a_argument, NULL, 'W'}, |
71 | fprintf(stderr, "\t\t\tasm - assembler source\n"); | 69 | {"error", a_argument, NULL, 'E'}, |
72 | fprintf(stderr, "\t-V <output version>\n"); | 70 | {"help", no_argument, NULL, 'h'}, |
73 | fprintf(stderr, "\t\tBlob version to produce, defaults to %d (relevant for dtb\n\t\tand asm output only)\n", DEFAULT_FDT_VERSION); | 71 | {"version", no_argument, NULL, 'v'}, |
74 | fprintf(stderr, "\t-d <output dependency file>\n"); | 72 | {NULL, no_argument, NULL, 0x0}, |
75 | fprintf(stderr, "\t-R <number>\n"); | 73 | }; |
76 | fprintf(stderr, "\t\tMake space for <number> reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); | 74 | static const char * const usage_opts_help[] = { |
77 | fprintf(stderr, "\t-S <bytes>\n"); | 75 | "\n\tQuiet: -q suppress warnings, -qq errors, -qqq all", |
78 | fprintf(stderr, "\t\tMake the blob at least <bytes> long (extra space)\n"); | 76 | "\n\tInput formats are:\n" |
79 | fprintf(stderr, "\t-p <bytes>\n"); | 77 | "\t\tdts - device tree source text\n" |
80 | fprintf(stderr, "\t\tAdd padding to the blob of <bytes> long (extra space)\n"); | 78 | "\t\tdtb - device tree blob\n" |
81 | fprintf(stderr, "\t-b <number>\n"); | 79 | "\t\tfs - /proc/device-tree style directory", |
82 | fprintf(stderr, "\t\tSet the physical boot cpu\n"); | 80 | "\n\tOutput file", |
83 | fprintf(stderr, "\t-f\n"); | 81 | "\n\tOutput formats are:\n" |
84 | fprintf(stderr, "\t\tForce - try to produce output even if the input tree has errors\n"); | 82 | "\t\tdts - device tree source text\n" |
85 | fprintf(stderr, "\t-i\n"); | 83 | "\t\tdtb - device tree blob\n" |
86 | fprintf(stderr, "\t\tAdd a path to search for include files\n"); | 84 | "\t\tasm - assembler source", |
87 | fprintf(stderr, "\t-s\n"); | 85 | "\n\tBlob version to produce, defaults to %d (for dtb and asm output)", //, DEFAULT_FDT_VERSION); |
88 | fprintf(stderr, "\t\tSort nodes and properties before outputting (only useful for\n\t\tcomparing trees)\n"); | 86 | "\n\tOutput dependency file", |
89 | fprintf(stderr, "\t-v\n"); | 87 | "\n\ttMake space for <number> reserve map entries (for dtb and asm output)", |
90 | fprintf(stderr, "\t\tPrint DTC version and exit\n"); | 88 | "\n\tMake the blob at least <bytes> long (extra space)", |
91 | fprintf(stderr, "\t-H <phandle format>\n"); | 89 | "\n\tAdd padding to the blob of <bytes> long (extra space)", |
92 | fprintf(stderr, "\t\tphandle formats are:\n"); | 90 | "\n\tSet the physical boot cpu", |
93 | fprintf(stderr, "\t\t\tlegacy - \"linux,phandle\" properties only\n"); | 91 | "\n\tTry to produce output even if the input tree has errors", |
94 | fprintf(stderr, "\t\t\tepapr - \"phandle\" properties only\n"); | 92 | "\n\tAdd a path to search for include files", |
95 | fprintf(stderr, "\t\t\tboth - Both \"linux,phandle\" and \"phandle\" properties\n"); | 93 | "\n\tSort nodes and properties before outputting (useful for comparing trees)", |
96 | fprintf(stderr, "\t-W [no-]<checkname>\n"); | 94 | "\n\tValid phandle formats are:\n" |
97 | fprintf(stderr, "\t-E [no-]<checkname>\n"); | 95 | "\t\tlegacy - \"linux,phandle\" properties only\n" |
98 | fprintf(stderr, "\t\t\tenable or disable warnings and errors\n"); | 96 | "\t\tepapr - \"phandle\" properties only\n" |
99 | exit(3); | 97 | "\t\tboth - Both \"linux,phandle\" and \"phandle\" properties", |
100 | } | 98 | "\n\tEnable/disable warnings (prefix with \"no-\")", |
99 | "\n\tEnable/disable errors (prefix with \"no-\")", | ||
100 | "\n\tPrint this help and exit", | ||
101 | "\n\tPrint version and exit", | ||
102 | NULL, | ||
103 | }; | ||
101 | 104 | ||
102 | int main(int argc, char *argv[]) | 105 | int main(int argc, char *argv[]) |
103 | { | 106 | { |
@@ -118,8 +121,7 @@ int main(int argc, char *argv[]) | |||
118 | minsize = 0; | 121 | minsize = 0; |
119 | padsize = 0; | 122 | padsize = 0; |
120 | 123 | ||
121 | while ((opt = getopt(argc, argv, "hI:O:o:V:d:R:S:p:fqb:i:vH:sW:E:")) | 124 | while ((opt = util_getopt_long()) != EOF) { |
122 | != EOF) { | ||
123 | switch (opt) { | 125 | switch (opt) { |
124 | case 'I': | 126 | case 'I': |
125 | inform = optarg; | 127 | inform = optarg; |
@@ -158,8 +160,7 @@ int main(int argc, char *argv[]) | |||
158 | srcfile_add_search_path(optarg); | 160 | srcfile_add_search_path(optarg); |
159 | break; | 161 | break; |
160 | case 'v': | 162 | case 'v': |
161 | printf("Version: %s\n", DTC_VERSION); | 163 | util_version(); |
162 | exit(0); | ||
163 | case 'H': | 164 | case 'H': |
164 | if (streq(optarg, "legacy")) | 165 | if (streq(optarg, "legacy")) |
165 | phandle_format = PHANDLE_LEGACY; | 166 | phandle_format = PHANDLE_LEGACY; |
@@ -185,13 +186,14 @@ int main(int argc, char *argv[]) | |||
185 | break; | 186 | break; |
186 | 187 | ||
187 | case 'h': | 188 | case 'h': |
189 | usage(NULL); | ||
188 | default: | 190 | default: |
189 | usage(); | 191 | usage("unknown option"); |
190 | } | 192 | } |
191 | } | 193 | } |
192 | 194 | ||
193 | if (argc > (optind+1)) | 195 | if (argc > (optind+1)) |
194 | usage(); | 196 | usage("missing files"); |
195 | else if (argc < (optind+1)) | 197 | else if (argc < (optind+1)) |
196 | arg = "-"; | 198 | arg = "-"; |
197 | else | 199 | else |
@@ -201,9 +203,6 @@ int main(int argc, char *argv[]) | |||
201 | if (minsize && padsize) | 203 | if (minsize && padsize) |
202 | die("Can't set both -p and -S\n"); | 204 | die("Can't set both -p and -S\n"); |
203 | 205 | ||
204 | if (minsize) | ||
205 | fprintf(stderr, "DTC: Use of \"-S\" is deprecated; it will be removed soon, use \"-p\" instead\n"); | ||
206 | |||
207 | if (depname) { | 206 | if (depname) { |
208 | depfile = fopen(depname, "w"); | 207 | depfile = fopen(depname, "w"); |
209 | if (!depfile) | 208 | if (!depfile) |
diff --git a/scripts/dtc/dtc.h b/scripts/dtc/dtc.h index 3e42a071070e..264a20cf66a8 100644 --- a/scripts/dtc/dtc.h +++ b/scripts/dtc/dtc.h | |||
@@ -66,7 +66,6 @@ typedef uint32_t cell_t; | |||
66 | #define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) | 66 | #define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) |
67 | 67 | ||
68 | #define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) | 68 | #define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) |
69 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | ||
70 | 69 | ||
71 | /* Data blobs */ | 70 | /* Data blobs */ |
72 | enum markertype { | 71 | enum markertype { |
diff --git a/scripts/dtc/srcpos.c b/scripts/dtc/srcpos.c index 246ab4bc0d9d..c20bc5315bc1 100644 --- a/scripts/dtc/srcpos.c +++ b/scripts/dtc/srcpos.c | |||
@@ -297,9 +297,9 @@ srcpos_verror(struct srcpos *pos, char const *fmt, va_list va) | |||
297 | 297 | ||
298 | srcstr = srcpos_string(pos); | 298 | srcstr = srcpos_string(pos); |
299 | 299 | ||
300 | fprintf(stdout, "Error: %s ", srcstr); | 300 | fprintf(stderr, "Error: %s ", srcstr); |
301 | vfprintf(stdout, fmt, va); | 301 | vfprintf(stderr, fmt, va); |
302 | fprintf(stdout, "\n"); | 302 | fprintf(stderr, "\n"); |
303 | } | 303 | } |
304 | 304 | ||
305 | void | 305 | void |
diff --git a/scripts/dtc/update-dtc-source.sh b/scripts/dtc/update-dtc-source.sh new file mode 100755 index 000000000000..feb01ef26be4 --- /dev/null +++ b/scripts/dtc/update-dtc-source.sh | |||
@@ -0,0 +1,54 @@ | |||
1 | #!/bin/sh | ||
2 | # Simple script to update the version of DTC carried by the Linux kernel | ||
3 | # | ||
4 | # This script assumes that the dtc and the linux git trees are in the | ||
5 | # same directory. After building dtc in the dtc directory, it copies the | ||
6 | # source files and generated source files into the scripts/dtc directory | ||
7 | # in the kernel and creates a git commit updating them to the new | ||
8 | # version. | ||
9 | # | ||
10 | # Usage: from the top level Linux source tree, run: | ||
11 | # $ ./scripts/dtc/update-dtc-source.sh | ||
12 | # | ||
13 | # The script will change into the dtc tree, build and test dtc, copy the | ||
14 | # relevant files into the kernel tree and create a git commit. The commit | ||
15 | # message will need to be modified to reflect the version of DTC being | ||
16 | # imported | ||
17 | # | ||
18 | # TODO: | ||
19 | # This script is pretty basic, but it is seldom used so a few manual tasks | ||
20 | # aren't a big deal. If anyone is interested in making it more robust, the | ||
21 | # the following would be nice: | ||
22 | # * Actually fail to complete if any testcase fails. | ||
23 | # - The dtc "make check" target needs to return a failure | ||
24 | # * Extract the version number from the dtc repo for the commit message | ||
25 | # * Build dtc in the kernel tree | ||
26 | # * run 'make check" on dtc built from the kernel tree | ||
27 | |||
28 | set -ev | ||
29 | |||
30 | DTC_UPSTREAM_PATH=`pwd`/../dtc | ||
31 | DTC_LINUX_PATH=`pwd`/scripts/dtc | ||
32 | |||
33 | DTC_SOURCE="checks.c data.c dtc.c dtc.h flattree.c fstree.c livetree.c srcpos.c \ | ||
34 | srcpos.h treesource.c util.c util.h version_gen.h Makefile.dtc \ | ||
35 | dtc-lexer.l dtc-parser.y" | ||
36 | DTC_GENERATED="dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h" | ||
37 | |||
38 | # Build DTC | ||
39 | cd $DTC_UPSTREAM_PATH | ||
40 | make clean | ||
41 | make check | ||
42 | |||
43 | # Copy the files into the Linux tree | ||
44 | cd $DTC_LINUX_PATH | ||
45 | for f in $DTC_SOURCE; do | ||
46 | cp ${DTC_UPSTREAM_PATH}/${f} ${f} | ||
47 | git add ${f} | ||
48 | done | ||
49 | for f in $DTC_GENERATED; do | ||
50 | cp ${DTC_UPSTREAM_PATH}/$f ${f}_shipped | ||
51 | git add ${f}_shipped | ||
52 | done | ||
53 | |||
54 | git commit -e -v -m "scripts/dtc: Update to upstream version [CHANGEME]" | ||
diff --git a/scripts/dtc/util.c b/scripts/dtc/util.c index 2422c34e11df..3055c16e980d 100644 --- a/scripts/dtc/util.c +++ b/scripts/dtc/util.c | |||
@@ -34,6 +34,7 @@ | |||
34 | 34 | ||
35 | #include "libfdt.h" | 35 | #include "libfdt.h" |
36 | #include "util.h" | 36 | #include "util.h" |
37 | #include "version_gen.h" | ||
37 | 38 | ||
38 | char *xstrdup(const char *s) | 39 | char *xstrdup(const char *s) |
39 | { | 40 | { |
@@ -72,7 +73,7 @@ char *join_path(const char *path, const char *name) | |||
72 | int util_is_printable_string(const void *data, int len) | 73 | int util_is_printable_string(const void *data, int len) |
73 | { | 74 | { |
74 | const char *s = data; | 75 | const char *s = data; |
75 | const char *ss; | 76 | const char *ss, *se; |
76 | 77 | ||
77 | /* zero length is not */ | 78 | /* zero length is not */ |
78 | if (len == 0) | 79 | if (len == 0) |
@@ -82,13 +83,19 @@ int util_is_printable_string(const void *data, int len) | |||
82 | if (s[len - 1] != '\0') | 83 | if (s[len - 1] != '\0') |
83 | return 0; | 84 | return 0; |
84 | 85 | ||
85 | ss = s; | 86 | se = s + len; |
86 | while (*s && isprint(*s)) | ||
87 | s++; | ||
88 | 87 | ||
89 | /* not zero, or not done yet */ | 88 | while (s < se) { |
90 | if (*s != '\0' || (s + 1 - ss) < len) | 89 | ss = s; |
91 | return 0; | 90 | while (s < se && *s && isprint(*s)) |
91 | s++; | ||
92 | |||
93 | /* not zero, or not done yet */ | ||
94 | if (*s != '\0' || s == ss) | ||
95 | return 0; | ||
96 | |||
97 | s++; | ||
98 | } | ||
92 | 99 | ||
93 | return 1; | 100 | return 1; |
94 | } | 101 | } |
@@ -191,7 +198,7 @@ char get_escape_char(const char *s, int *i) | |||
191 | return val; | 198 | return val; |
192 | } | 199 | } |
193 | 200 | ||
194 | int utilfdt_read_err(const char *filename, char **buffp) | 201 | int utilfdt_read_err_len(const char *filename, char **buffp, off_t *len) |
195 | { | 202 | { |
196 | int fd = 0; /* assume stdin */ | 203 | int fd = 0; /* assume stdin */ |
197 | char *buf = NULL; | 204 | char *buf = NULL; |
@@ -206,12 +213,12 @@ int utilfdt_read_err(const char *filename, char **buffp) | |||
206 | } | 213 | } |
207 | 214 | ||
208 | /* Loop until we have read everything */ | 215 | /* Loop until we have read everything */ |
209 | buf = malloc(bufsize); | 216 | buf = xmalloc(bufsize); |
210 | do { | 217 | do { |
211 | /* Expand the buffer to hold the next chunk */ | 218 | /* Expand the buffer to hold the next chunk */ |
212 | if (offset == bufsize) { | 219 | if (offset == bufsize) { |
213 | bufsize *= 2; | 220 | bufsize *= 2; |
214 | buf = realloc(buf, bufsize); | 221 | buf = xrealloc(buf, bufsize); |
215 | if (!buf) { | 222 | if (!buf) { |
216 | ret = ENOMEM; | 223 | ret = ENOMEM; |
217 | break; | 224 | break; |
@@ -232,13 +239,20 @@ int utilfdt_read_err(const char *filename, char **buffp) | |||
232 | free(buf); | 239 | free(buf); |
233 | else | 240 | else |
234 | *buffp = buf; | 241 | *buffp = buf; |
242 | *len = bufsize; | ||
235 | return ret; | 243 | return ret; |
236 | } | 244 | } |
237 | 245 | ||
238 | char *utilfdt_read(const char *filename) | 246 | int utilfdt_read_err(const char *filename, char **buffp) |
247 | { | ||
248 | off_t len; | ||
249 | return utilfdt_read_err_len(filename, buffp, &len); | ||
250 | } | ||
251 | |||
252 | char *utilfdt_read_len(const char *filename, off_t *len) | ||
239 | { | 253 | { |
240 | char *buff; | 254 | char *buff; |
241 | int ret = utilfdt_read_err(filename, &buff); | 255 | int ret = utilfdt_read_err_len(filename, &buff, len); |
242 | 256 | ||
243 | if (ret) { | 257 | if (ret) { |
244 | fprintf(stderr, "Couldn't open blob from '%s': %s\n", filename, | 258 | fprintf(stderr, "Couldn't open blob from '%s': %s\n", filename, |
@@ -249,6 +263,12 @@ char *utilfdt_read(const char *filename) | |||
249 | return buff; | 263 | return buff; |
250 | } | 264 | } |
251 | 265 | ||
266 | char *utilfdt_read(const char *filename) | ||
267 | { | ||
268 | off_t len; | ||
269 | return utilfdt_read_len(filename, &len); | ||
270 | } | ||
271 | |||
252 | int utilfdt_write_err(const char *filename, const void *blob) | 272 | int utilfdt_write_err(const char *filename, const void *blob) |
253 | { | 273 | { |
254 | int fd = 1; /* assume stdout */ | 274 | int fd = 1; /* assume stdout */ |
@@ -329,3 +349,100 @@ int utilfdt_decode_type(const char *fmt, int *type, int *size) | |||
329 | return -1; | 349 | return -1; |
330 | return 0; | 350 | return 0; |
331 | } | 351 | } |
352 | |||
353 | void utilfdt_print_data(const char *data, int len) | ||
354 | { | ||
355 | int i; | ||
356 | const char *p = data; | ||
357 | const char *s; | ||
358 | |||
359 | /* no data, don't print */ | ||
360 | if (len == 0) | ||
361 | return; | ||
362 | |||
363 | if (util_is_printable_string(data, len)) { | ||
364 | printf(" = "); | ||
365 | |||
366 | s = data; | ||
367 | do { | ||
368 | printf("\"%s\"", s); | ||
369 | s += strlen(s) + 1; | ||
370 | if (s < data + len) | ||
371 | printf(", "); | ||
372 | } while (s < data + len); | ||
373 | |||
374 | } else if ((len % 4) == 0) { | ||
375 | const uint32_t *cell = (const uint32_t *)data; | ||
376 | |||
377 | printf(" = <"); | ||
378 | for (i = 0; i < len; i += 4) | ||
379 | printf("0x%08x%s", fdt32_to_cpu(cell[i]), | ||
380 | i < (len - 4) ? " " : ""); | ||
381 | printf(">"); | ||
382 | } else { | ||
383 | printf(" = ["); | ||
384 | for (i = 0; i < len; i++) | ||
385 | printf("%02x%s", *p++, i < len - 1 ? " " : ""); | ||
386 | printf("]"); | ||
387 | } | ||
388 | } | ||
389 | |||
390 | void util_version(void) | ||
391 | { | ||
392 | printf("Version: %s\n", DTC_VERSION); | ||
393 | exit(0); | ||
394 | } | ||
395 | |||
396 | void util_usage(const char *errmsg, const char *synopsis, | ||
397 | const char *short_opts, struct option const long_opts[], | ||
398 | const char * const opts_help[]) | ||
399 | { | ||
400 | FILE *fp = errmsg ? stderr : stdout; | ||
401 | const char a_arg[] = "<arg>"; | ||
402 | size_t a_arg_len = strlen(a_arg) + 1; | ||
403 | size_t i; | ||
404 | int optlen; | ||
405 | |||
406 | fprintf(fp, | ||
407 | "Usage: %s\n" | ||
408 | "\n" | ||
409 | "Options: -[%s]\n", synopsis, short_opts); | ||
410 | |||
411 | /* prescan the --long opt length to auto-align */ | ||
412 | optlen = 0; | ||
413 | for (i = 0; long_opts[i].name; ++i) { | ||
414 | /* +1 is for space between --opt and help text */ | ||
415 | int l = strlen(long_opts[i].name) + 1; | ||
416 | if (long_opts[i].has_arg == a_argument) | ||
417 | l += a_arg_len; | ||
418 | if (optlen < l) | ||
419 | optlen = l; | ||
420 | } | ||
421 | |||
422 | for (i = 0; long_opts[i].name; ++i) { | ||
423 | /* helps when adding new applets or options */ | ||
424 | assert(opts_help[i] != NULL); | ||
425 | |||
426 | /* first output the short flag if it has one */ | ||
427 | if (long_opts[i].val > '~') | ||
428 | fprintf(fp, " "); | ||
429 | else | ||
430 | fprintf(fp, " -%c, ", long_opts[i].val); | ||
431 | |||
432 | /* then the long flag */ | ||
433 | if (long_opts[i].has_arg == no_argument) | ||
434 | fprintf(fp, "--%-*s", optlen, long_opts[i].name); | ||
435 | else | ||
436 | fprintf(fp, "--%s %s%*s", long_opts[i].name, a_arg, | ||
437 | (int)(optlen - strlen(long_opts[i].name) - a_arg_len), ""); | ||
438 | |||
439 | /* finally the help text */ | ||
440 | fprintf(fp, "%s\n", opts_help[i]); | ||
441 | } | ||
442 | |||
443 | if (errmsg) { | ||
444 | fprintf(fp, "\nError: %s\n", errmsg); | ||
445 | exit(EXIT_FAILURE); | ||
446 | } else | ||
447 | exit(EXIT_SUCCESS); | ||
448 | } | ||
diff --git a/scripts/dtc/util.h b/scripts/dtc/util.h index c8eb45d9f04b..8f40b4499359 100644 --- a/scripts/dtc/util.h +++ b/scripts/dtc/util.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _UTIL_H | 2 | #define _UTIL_H |
3 | 3 | ||
4 | #include <stdarg.h> | 4 | #include <stdarg.h> |
5 | #include <getopt.h> | ||
5 | 6 | ||
6 | /* | 7 | /* |
7 | * Copyright 2011 The Chromium Authors, All Rights Reserved. | 8 | * Copyright 2011 The Chromium Authors, All Rights Reserved. |
@@ -23,7 +24,9 @@ | |||
23 | * USA | 24 | * USA |
24 | */ | 25 | */ |
25 | 26 | ||
26 | static inline void __attribute__((noreturn)) die(char * str, ...) | 27 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
28 | |||
29 | static inline void __attribute__((noreturn)) die(const char *str, ...) | ||
27 | { | 30 | { |
28 | va_list ap; | 31 | va_list ap; |
29 | 32 | ||
@@ -57,12 +60,14 @@ extern char *xstrdup(const char *s); | |||
57 | extern char *join_path(const char *path, const char *name); | 60 | extern char *join_path(const char *path, const char *name); |
58 | 61 | ||
59 | /** | 62 | /** |
60 | * Check a string of a given length to see if it is all printable and | 63 | * Check a property of a given length to see if it is all printable and |
61 | * has a valid terminator. | 64 | * has a valid terminator. The property can contain either a single string, |
65 | * or multiple strings each of non-zero length. | ||
62 | * | 66 | * |
63 | * @param data The string to check | 67 | * @param data The string to check |
64 | * @param len The string length including terminator | 68 | * @param len The string length including terminator |
65 | * @return 1 if a valid printable string, 0 if not */ | 69 | * @return 1 if a valid printable string, 0 if not |
70 | */ | ||
66 | int util_is_printable_string(const void *data, int len); | 71 | int util_is_printable_string(const void *data, int len); |
67 | 72 | ||
68 | /* | 73 | /* |
@@ -83,6 +88,13 @@ char get_escape_char(const char *s, int *i); | |||
83 | char *utilfdt_read(const char *filename); | 88 | char *utilfdt_read(const char *filename); |
84 | 89 | ||
85 | /** | 90 | /** |
91 | * Like utilfdt_read(), but also passes back the size of the file read. | ||
92 | * | ||
93 | * @param len If non-NULL, the amount of data we managed to read | ||
94 | */ | ||
95 | char *utilfdt_read_len(const char *filename, off_t *len); | ||
96 | |||
97 | /** | ||
86 | * Read a device tree file into a buffer. Does not report errors, but only | 98 | * Read a device tree file into a buffer. Does not report errors, but only |
87 | * returns them. The value returned can be passed to strerror() to obtain | 99 | * returns them. The value returned can be passed to strerror() to obtain |
88 | * an error message for the user. | 100 | * an error message for the user. |
@@ -93,6 +105,12 @@ char *utilfdt_read(const char *filename); | |||
93 | */ | 105 | */ |
94 | int utilfdt_read_err(const char *filename, char **buffp); | 106 | int utilfdt_read_err(const char *filename, char **buffp); |
95 | 107 | ||
108 | /** | ||
109 | * Like utilfdt_read_err(), but also passes back the size of the file read. | ||
110 | * | ||
111 | * @param len If non-NULL, the amount of data we managed to read | ||
112 | */ | ||
113 | int utilfdt_read_err_len(const char *filename, char **buffp, off_t *len); | ||
96 | 114 | ||
97 | /** | 115 | /** |
98 | * Write a device tree buffer to a file. This will report any errors on | 116 | * Write a device tree buffer to a file. This will report any errors on |
@@ -148,6 +166,85 @@ int utilfdt_decode_type(const char *fmt, int *type, int *size); | |||
148 | #define USAGE_TYPE_MSG \ | 166 | #define USAGE_TYPE_MSG \ |
149 | "<type>\ts=string, i=int, u=unsigned, x=hex\n" \ | 167 | "<type>\ts=string, i=int, u=unsigned, x=hex\n" \ |
150 | "\tOptional modifier prefix:\n" \ | 168 | "\tOptional modifier prefix:\n" \ |
151 | "\t\thh or b=byte, h=2 byte, l=4 byte (default)\n"; | 169 | "\t\thh or b=byte, h=2 byte, l=4 byte (default)"; |
170 | |||
171 | /** | ||
172 | * Print property data in a readable format to stdout | ||
173 | * | ||
174 | * Properties that look like strings will be printed as strings. Otherwise | ||
175 | * the data will be displayed either as cells (if len is a multiple of 4 | ||
176 | * bytes) or bytes. | ||
177 | * | ||
178 | * If len is 0 then this function does nothing. | ||
179 | * | ||
180 | * @param data Pointers to property data | ||
181 | * @param len Length of property data | ||
182 | */ | ||
183 | void utilfdt_print_data(const char *data, int len); | ||
184 | |||
185 | /** | ||
186 | * Show source version and exit | ||
187 | */ | ||
188 | void util_version(void) __attribute__((noreturn)); | ||
189 | |||
190 | /** | ||
191 | * Show usage and exit | ||
192 | * | ||
193 | * This helps standardize the output of various utils. You most likely want | ||
194 | * to use the usage() helper below rather than call this. | ||
195 | * | ||
196 | * @param errmsg If non-NULL, an error message to display | ||
197 | * @param synopsis The initial example usage text (and possible examples) | ||
198 | * @param short_opts The string of short options | ||
199 | * @param long_opts The structure of long options | ||
200 | * @param opts_help An array of help strings (should align with long_opts) | ||
201 | */ | ||
202 | void util_usage(const char *errmsg, const char *synopsis, | ||
203 | const char *short_opts, struct option const long_opts[], | ||
204 | const char * const opts_help[]) __attribute__((noreturn)); | ||
205 | |||
206 | /** | ||
207 | * Show usage and exit | ||
208 | * | ||
209 | * If you name all your usage variables with usage_xxx, then you can call this | ||
210 | * help macro rather than expanding all arguments yourself. | ||
211 | * | ||
212 | * @param errmsg If non-NULL, an error message to display | ||
213 | */ | ||
214 | #define usage(errmsg) \ | ||
215 | util_usage(errmsg, usage_synopsis, usage_short_opts, \ | ||
216 | usage_long_opts, usage_opts_help) | ||
217 | |||
218 | /** | ||
219 | * Call getopt_long() with standard options | ||
220 | * | ||
221 | * Since all util code runs getopt in the same way, provide a helper. | ||
222 | */ | ||
223 | #define util_getopt_long() getopt_long(argc, argv, usage_short_opts, \ | ||
224 | usage_long_opts, NULL) | ||
225 | |||
226 | /* Helper for aligning long_opts array */ | ||
227 | #define a_argument required_argument | ||
228 | |||
229 | /* Helper for usage_short_opts string constant */ | ||
230 | #define USAGE_COMMON_SHORT_OPTS "hV" | ||
231 | |||
232 | /* Helper for usage_long_opts option array */ | ||
233 | #define USAGE_COMMON_LONG_OPTS \ | ||
234 | {"help", no_argument, NULL, 'h'}, \ | ||
235 | {"version", no_argument, NULL, 'V'}, \ | ||
236 | {NULL, no_argument, NULL, 0x0} | ||
237 | |||
238 | /* Helper for usage_opts_help array */ | ||
239 | #define USAGE_COMMON_OPTS_HELP \ | ||
240 | "Print this help and exit", \ | ||
241 | "Print version and exit", \ | ||
242 | NULL | ||
243 | |||
244 | /* Helper for getopt case statements */ | ||
245 | #define case_USAGE_COMMON_FLAGS \ | ||
246 | case 'h': usage(NULL); \ | ||
247 | case 'V': util_version(); \ | ||
248 | case '?': usage("unknown option"); | ||
152 | 249 | ||
153 | #endif /* _UTIL_H */ | 250 | #endif /* _UTIL_H */ |
diff --git a/scripts/dtc/version_gen.h b/scripts/dtc/version_gen.h index 6158b867df99..54d4e904433a 100644 --- a/scripts/dtc/version_gen.h +++ b/scripts/dtc/version_gen.h | |||
@@ -1 +1 @@ | |||
#define DTC_VERSION "DTC 1.2.0-g37c0b6a0" | #define DTC_VERSION "DTC 1.4.0-dirty" | ||
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 | |||
51 | static, STATIC_KEYW | 53 | static, STATIC_KEYW |
52 | struct, STRUCT_KEYW | 54 | struct, STRUCT_KEYW |
53 | typedef, TYPEDEF_KEYW | 55 | typedef, TYPEDEF_KEYW |
56 | typeof, TYPEOF_KEYW | ||
54 | union, UNION_KEYW | 57 | union, UNION_KEYW |
55 | unsigned, UNSIGNED_KEYW | 58 | unsigned, UNSIGNED_KEYW |
56 | void, VOID_KEYW | 59 | void, VOID_KEYW |
57 | volatile, VOLATILE_KEYW | 60 | volatile, VOLATILE_KEYW |
58 | typeof, 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; | |||
34 | static const struct resword *is_reserved_word(register const char *str, register unsigned int len); | 34 | static 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" |
36 | struct resword { const char *name; int token; }; | 36 | struct 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 | |||
129 | yylex(void) | 129 | yylex(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 | |||
1938 | yylex(void) | 1938 | yylex(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. */ |
495 | static const yytype_int8 yyrhs[] = | 505 | static 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. */ |
537 | static const yytype_uint16 yyrline[] = | 546 | static 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. */ |
606 | static const yytype_uint8 yyr1[] = | 615 | static 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]. */ |
670 | static const yytype_int16 yydefgoto[] = | 679 | static 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 |
682 | static const yytype_int16 yypact[] = | 691 | static 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]. */ |
706 | static const yytype_int16 yypgoto[] = | 715 | static 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 |
719 | static const yytype_int16 yytable[] = | 728 | static 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 | ||
783 | static const yytype_int16 yycheck[] = | 790 | static 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. */ |
843 | static const yytype_uint8 yystos[] = | 848 | static 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) \ |
894 | do \ | 899 | do \ |
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 | |||
1246 | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | 1254 | yysyntax_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: | |||
220 | type_specifier: | 221 | type_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 | ||
39 | struct text_range { | 39 | struct 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 | ||
44 | static unsigned long long _text; | 44 | static unsigned long long _text; |
45 | static struct text_range text_ranges[] = { | 45 | static 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 | ||
54 | static struct addr_range percpu_range = { | ||
55 | "__per_cpu_start", "__per_cpu_end", -1ULL, 0 | ||
56 | }; | ||
57 | |||
54 | static struct sym_entry *table; | 58 | static struct sym_entry *table; |
55 | static unsigned int table_size, table_cnt; | 59 | static unsigned int table_size, table_cnt; |
56 | static int all_symbols = 0; | 60 | static int all_symbols = 0; |
61 | static int absolute_percpu = 0; | ||
57 | static char symbol_prefix_char = '\0'; | 62 | static char symbol_prefix_char = '\0'; |
58 | static unsigned long long kernel_start_addr = 0; | 63 | static 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 | ||
86 | static int read_symbol_tr(const char *sym, unsigned long long addr) | 91 | static 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 | ||
170 | static int symbol_valid_tr(struct sym_entry *s) | 180 | static 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 | ||
315 | static int symbol_absolute(struct sym_entry *s) | ||
316 | { | ||
317 | return toupper(s->sym[0]) == 'A'; | ||
318 | } | ||
319 | |||
301 | static void write_src(void) | 320 | static 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 | ||
668 | static 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 | |||
649 | int main(int argc, char **argv) | 677 | int 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 | ||
65 | struct kconf_id { | 66 | struct 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 | |||
44 | modules, T_OPT_MODULES, TF_OPTION | 44 | modules, T_OPT_MODULES, TF_OPTION |
45 | defconfig_list, T_OPT_DEFCONFIG_LIST,TF_OPTION | 45 | defconfig_list, T_OPT_DEFCONFIG_LIST,TF_OPTION |
46 | env, T_OPT_ENV, TF_OPTION | 46 | env, T_OPT_ENV, TF_OPTION |
47 | allnoconfig_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/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c index bb5d115ca671..f282516acc7b 100644 --- a/scripts/mod/devicetable-offsets.c +++ b/scripts/mod/devicetable-offsets.c | |||
@@ -174,6 +174,9 @@ int main(void) | |||
174 | DEVID_FIELD(x86_cpu_id, model); | 174 | DEVID_FIELD(x86_cpu_id, model); |
175 | DEVID_FIELD(x86_cpu_id, vendor); | 175 | DEVID_FIELD(x86_cpu_id, vendor); |
176 | 176 | ||
177 | DEVID(cpu_feature); | ||
178 | DEVID_FIELD(cpu_feature, feature); | ||
179 | |||
177 | DEVID(mei_cl_device_id); | 180 | DEVID(mei_cl_device_id); |
178 | DEVID_FIELD(mei_cl_device_id, name); | 181 | DEVID_FIELD(mei_cl_device_id, name); |
179 | 182 | ||
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 25e5cb0aaef6..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 */ |
44 | struct devtable { | 44 | struct 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); |
@@ -1110,7 +1111,7 @@ static int do_amba_entry(const char *filename, | |||
1110 | } | 1111 | } |
1111 | ADD_TO_DEVTABLE("amba", amba_id, do_amba_entry); | 1112 | ADD_TO_DEVTABLE("amba", amba_id, do_amba_entry); |
1112 | 1113 | ||
1113 | /* LOOKS like x86cpu:vendor:VVVV:family:FFFF:model:MMMM:feature:*,FEAT,* | 1114 | /* LOOKS like cpu:type:x86,venVVVVfamFFFFmodMMMM:feature:*,FEAT,* |
1114 | * All fields are numbers. It would be nicer to use strings for vendor | 1115 | * All fields are numbers. It would be nicer to use strings for vendor |
1115 | * and feature, but getting those out of the build system here is too | 1116 | * and feature, but getting those out of the build system here is too |
1116 | * complicated. | 1117 | * complicated. |
@@ -1124,10 +1125,10 @@ static int do_x86cpu_entry(const char *filename, void *symval, | |||
1124 | DEF_FIELD(symval, x86_cpu_id, model); | 1125 | DEF_FIELD(symval, x86_cpu_id, model); |
1125 | DEF_FIELD(symval, x86_cpu_id, vendor); | 1126 | DEF_FIELD(symval, x86_cpu_id, vendor); |
1126 | 1127 | ||
1127 | strcpy(alias, "x86cpu:"); | 1128 | strcpy(alias, "cpu:type:x86,"); |
1128 | ADD(alias, "vendor:", vendor != X86_VENDOR_ANY, vendor); | 1129 | ADD(alias, "ven", vendor != X86_VENDOR_ANY, vendor); |
1129 | ADD(alias, ":family:", family != X86_FAMILY_ANY, family); | 1130 | ADD(alias, "fam", family != X86_FAMILY_ANY, family); |
1130 | ADD(alias, ":model:", model != X86_MODEL_ANY, model); | 1131 | ADD(alias, "mod", model != X86_MODEL_ANY, model); |
1131 | strcat(alias, ":feature:*"); | 1132 | strcat(alias, ":feature:*"); |
1132 | if (feature != X86_FEATURE_ANY) | 1133 | if (feature != X86_FEATURE_ANY) |
1133 | sprintf(alias + strlen(alias), "%04X*", feature); | 1134 | sprintf(alias + strlen(alias), "%04X*", feature); |
@@ -1135,6 +1136,16 @@ static int do_x86cpu_entry(const char *filename, void *symval, | |||
1135 | } | 1136 | } |
1136 | ADD_TO_DEVTABLE("x86cpu", x86_cpu_id, do_x86cpu_entry); | 1137 | ADD_TO_DEVTABLE("x86cpu", x86_cpu_id, do_x86cpu_entry); |
1137 | 1138 | ||
1139 | /* LOOKS like cpu:type:*:feature:*FEAT* */ | ||
1140 | static int do_cpu_entry(const char *filename, void *symval, char *alias) | ||
1141 | { | ||
1142 | DEF_FIELD(symval, cpu_feature, feature); | ||
1143 | |||
1144 | sprintf(alias, "cpu:type:*:feature:*%04X*", feature); | ||
1145 | return 1; | ||
1146 | } | ||
1147 | ADD_TO_DEVTABLE("cpu", cpu_feature, do_cpu_entry); | ||
1148 | |||
1138 | /* Looks like: mei:S */ | 1149 | /* Looks like: mei:S */ |
1139 | static int do_mei_entry(const char *filename, void *symval, | 1150 | static int do_mei_entry(const char *filename, void *symval, |
1140 | char *alias) | 1151 | char *alias) |
@@ -1206,7 +1217,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
1206 | { | 1217 | { |
1207 | void *symval; | 1218 | void *symval; |
1208 | char *zeros = NULL; | 1219 | char *zeros = NULL; |
1209 | const char *name; | 1220 | const char *name, *identifier; |
1210 | unsigned int namelen; | 1221 | unsigned int namelen; |
1211 | 1222 | ||
1212 | /* We're looking for a section relative symbol */ | 1223 | /* We're looking for a section relative symbol */ |
@@ -1217,7 +1228,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
1217 | if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT) | 1228 | if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT) |
1218 | return; | 1229 | return; |
1219 | 1230 | ||
1220 | /* All our symbols are of form <prefix>__mod_XXX_device_table. */ | 1231 | /* All our symbols are of form <prefix>__mod_<name>__<identifier>_device_table. */ |
1221 | name = strstr(symname, "__mod_"); | 1232 | name = strstr(symname, "__mod_"); |
1222 | if (!name) | 1233 | if (!name) |
1223 | return; | 1234 | return; |
@@ -1227,7 +1238,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
1227 | return; | 1238 | return; |
1228 | if (strcmp(name + namelen - strlen("_device_table"), "_device_table")) | 1239 | if (strcmp(name + namelen - strlen("_device_table"), "_device_table")) |
1229 | return; | 1240 | return; |
1230 | namelen -= strlen("_device_table"); | 1241 | identifier = strstr(name, "__"); |
1242 | if (!identifier) | ||
1243 | return; | ||
1244 | namelen = identifier - name; | ||
1231 | 1245 | ||
1232 | /* Handle all-NULL symbols allocated into .bss */ | 1246 | /* Handle all-NULL symbols allocated into .bss */ |
1233 | 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 | |||
28 | GIT_DIR="`git rev-parse --git-dir`" | ||
29 | |||
30 | if [ -d "$GIT_DIR" ]; then | ||
31 | TMPD="${GIT_DIR%git}tmp_objdiff" | ||
32 | |||
33 | [ -d "$TMPD" ] || mkdir "$TMPD" | ||
34 | else | ||
35 | echo "ERROR: git directory not found." | ||
36 | exit 1 | ||
37 | fi | ||
38 | |||
39 | usage() { | ||
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 | |||
47 | dorecord() { | ||
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 | |||
72 | dodiff() { | ||
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 | |||
105 | doclean() { | ||
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 | |||
124 | case "$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 | ;; | ||
141 | esac | ||
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 |
12 | fi | 12 | fi |
13 | 13 | ||
14 | # This is a duplicate of RCS_FIND_IGNORE without escaped '()' | 14 | # RCS_FIND_IGNORE has escaped ()s -- remove them. |
15 | ignore="( -name SCCS -o -name BitKeeper -o -name .svn -o \ | 15 | ignore="$(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 ) \ | 17 | ignore="$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} |