diff options
Diffstat (limited to 'scripts')
60 files changed, 2059 insertions, 2715 deletions
diff --git a/scripts/.gitignore b/scripts/.gitignore index 5ecfe93f2028..12efbbefd4d7 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore | |||
@@ -10,3 +10,5 @@ recordmcount | |||
10 | docproc | 10 | docproc |
11 | sortextable | 11 | sortextable |
12 | asn1_compiler | 12 | asn1_compiler |
13 | extract-cert | ||
14 | sign-file | ||
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index d3437b82ac25..1db6d73c8dd2 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
@@ -128,6 +128,10 @@ cc-option-align = $(subst -functions=0,,\ | |||
128 | cc-disable-warning = $(call try-run,\ | 128 | cc-disable-warning = $(call try-run,\ |
129 | $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) | 129 | $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) |
130 | 130 | ||
131 | # cc-name | ||
132 | # Expands to either gcc or clang | ||
133 | cc-name = $(shell $(CC) -v 2>&1 | grep -q "clang version" && echo clang || echo gcc) | ||
134 | |||
131 | # cc-version | 135 | # cc-version |
132 | cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC)) | 136 | cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC)) |
133 | 137 | ||
@@ -303,3 +307,54 @@ why = \ | |||
303 | 307 | ||
304 | echo-why = $(call escsq, $(strip $(why))) | 308 | echo-why = $(call escsq, $(strip $(why))) |
305 | endif | 309 | endif |
310 | |||
311 | ############################################################################### | ||
312 | # | ||
313 | # When a Kconfig string contains a filename, it is suitable for | ||
314 | # passing to shell commands. It is surrounded by double-quotes, and | ||
315 | # any double-quotes or backslashes within it are escaped by | ||
316 | # backslashes. | ||
317 | # | ||
318 | # This is no use for dependencies or $(wildcard). We need to strip the | ||
319 | # surrounding quotes and the escaping from quotes and backslashes, and | ||
320 | # we *do* need to escape any spaces in the string. So, for example: | ||
321 | # | ||
322 | # Usage: $(eval $(call config_filename,FOO)) | ||
323 | # | ||
324 | # Defines FOO_FILENAME based on the contents of the CONFIG_FOO option, | ||
325 | # transformed as described above to be suitable for use within the | ||
326 | # makefile. | ||
327 | # | ||
328 | # Also, if the filename is a relative filename and exists in the source | ||
329 | # tree but not the build tree, define FOO_SRCPREFIX as $(srctree)/ to | ||
330 | # be prefixed to *both* command invocation and dependencies. | ||
331 | # | ||
332 | # Note: We also print the filenames in the quiet_cmd_foo text, and | ||
333 | # perhaps ought to have a version specially escaped for that purpose. | ||
334 | # But it's only cosmetic, and $(patsubst "%",%,$(CONFIG_FOO)) is good | ||
335 | # enough. It'll strip the quotes in the common case where there's no | ||
336 | # space and it's a simple filename, and it'll retain the quotes when | ||
337 | # there's a space. There are some esoteric cases in which it'll print | ||
338 | # the wrong thing, but we don't really care. The actual dependencies | ||
339 | # and commands *do* get it right, with various combinations of single | ||
340 | # and double quotes, backslashes and spaces in the filenames. | ||
341 | # | ||
342 | ############################################################################### | ||
343 | # | ||
344 | space_escape := %%%SPACE%%% | ||
345 | # | ||
346 | define config_filename | ||
347 | ifneq ($$(CONFIG_$(1)),"") | ||
348 | $(1)_FILENAME := $$(subst \\,\,$$(subst \$$(quote),$$(quote),$$(subst $$(space_escape),\$$(space),$$(patsubst "%",%,$$(subst $$(space),$$(space_escape),$$(CONFIG_$(1))))))) | ||
349 | ifneq ($$(patsubst /%,%,$$(firstword $$($(1)_FILENAME))),$$(firstword $$($(1)_FILENAME))) | ||
350 | else | ||
351 | ifeq ($$(wildcard $$($(1)_FILENAME)),) | ||
352 | ifneq ($$(wildcard $$(srctree)/$$($(1)_FILENAME)),) | ||
353 | $(1)_SRCPREFIX := $(srctree)/ | ||
354 | endif | ||
355 | endif | ||
356 | endif | ||
357 | endif | ||
358 | endef | ||
359 | # | ||
360 | ############################################################################### | ||
diff --git a/scripts/Lindent b/scripts/Lindent index 9c4b3e2b7098..6d889de4e70b 100755 --- a/scripts/Lindent +++ b/scripts/Lindent | |||
@@ -1,6 +1,9 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | PARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1" | 2 | PARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1" |
3 | RES=`indent --version` | 3 | RES=`indent --version` |
4 | if [ "$RES" = "" ]; then | ||
5 | exit 1 | ||
6 | fi | ||
4 | V1=`echo $RES | cut -d' ' -f3 | cut -d'.' -f1` | 7 | V1=`echo $RES | cut -d' ' -f3 | cut -d'.' -f1` |
5 | V2=`echo $RES | cut -d' ' -f3 | cut -d'.' -f2` | 8 | V2=`echo $RES | cut -d' ' -f3 | cut -d'.' -f2` |
6 | V3=`echo $RES | cut -d' ' -f3 | cut -d'.' -f3` | 9 | V3=`echo $RES | cut -d' ' -f3 | cut -d'.' -f3` |
diff --git a/scripts/Makefile b/scripts/Makefile index 2016a64497ab..1b2661712d44 100644 --- a/scripts/Makefile +++ b/scripts/Makefile | |||
@@ -16,9 +16,13 @@ hostprogs-$(CONFIG_VT) += conmakehash | |||
16 | hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount | 16 | hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount |
17 | hostprogs-$(CONFIG_BUILDTIME_EXTABLE_SORT) += sortextable | 17 | hostprogs-$(CONFIG_BUILDTIME_EXTABLE_SORT) += sortextable |
18 | hostprogs-$(CONFIG_ASN1) += asn1_compiler | 18 | hostprogs-$(CONFIG_ASN1) += asn1_compiler |
19 | hostprogs-$(CONFIG_MODULE_SIG) += sign-file | ||
20 | hostprogs-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert | ||
19 | 21 | ||
20 | HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include | 22 | HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include |
21 | HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include | 23 | HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include |
24 | HOSTLOADLIBES_sign-file = -lcrypto | ||
25 | HOSTLOADLIBES_extract-cert = -lcrypto | ||
22 | 26 | ||
23 | always := $(hostprogs-y) $(hostprogs-m) | 27 | always := $(hostprogs-y) $(hostprogs-m) |
24 | 28 | ||
diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index f734033af219..4efedcbe4165 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn | |||
@@ -56,7 +56,7 @@ endif | |||
56 | KBUILD_CFLAGS += $(warning) | 56 | KBUILD_CFLAGS += $(warning) |
57 | else | 57 | else |
58 | 58 | ||
59 | ifeq ($(COMPILER),clang) | 59 | ifeq ($(cc-name),clang) |
60 | KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides) | 60 | KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides) |
61 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-value) | 61 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-value) |
62 | KBUILD_CFLAGS += $(call cc-disable-warning, format) | 62 | KBUILD_CFLAGS += $(call cc-disable-warning, format) |
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index e48a4e9d8868..07650eeaaf06 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst | |||
@@ -22,7 +22,7 @@ quiet_cmd_modules_install = INSTALL $@ | |||
22 | mkdir -p $(2) ; \ | 22 | mkdir -p $(2) ; \ |
23 | cp $@ $(2) ; \ | 23 | cp $@ $(2) ; \ |
24 | $(mod_strip_cmd) $(2)/$(notdir $@) ; \ | 24 | $(mod_strip_cmd) $(2)/$(notdir $@) ; \ |
25 | $(mod_sign_cmd) $(2)/$(notdir $@) $(patsubst %,|| true,$(KBUILD_EXTMOD)) ; \ | 25 | $(mod_sign_cmd) $(2)/$(notdir $@) $(patsubst %,|| true,$(KBUILD_EXTMOD)) && \ |
26 | $(mod_compress_cmd) $(2)/$(notdir $@) | 26 | $(mod_compress_cmd) $(2)/$(notdir $@) |
27 | 27 | ||
28 | # Modules built outside the kernel source tree go into extra by default | 28 | # Modules built outside the kernel source tree go into extra by default |
diff --git a/scripts/asn1_compiler.c b/scripts/asn1_compiler.c index 7750e9c31483..e000f44e37b8 100644 --- a/scripts/asn1_compiler.c +++ b/scripts/asn1_compiler.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <stdio.h> | 13 | #include <stdio.h> |
14 | #include <stdlib.h> | 14 | #include <stdlib.h> |
15 | #include <stdint.h> | 15 | #include <stdint.h> |
16 | #include <stdbool.h> | ||
16 | #include <string.h> | 17 | #include <string.h> |
17 | #include <ctype.h> | 18 | #include <ctype.h> |
18 | #include <unistd.h> | 19 | #include <unistd.h> |
@@ -293,8 +294,8 @@ static const char *const directives[NR__DIRECTIVES] = { | |||
293 | 294 | ||
294 | struct action { | 295 | struct action { |
295 | struct action *next; | 296 | struct action *next; |
297 | char *name; | ||
296 | unsigned char index; | 298 | unsigned char index; |
297 | char name[]; | ||
298 | }; | 299 | }; |
299 | 300 | ||
300 | static struct action *action_list; | 301 | static struct action *action_list; |
@@ -305,15 +306,17 @@ struct token { | |||
305 | enum token_type token_type : 8; | 306 | enum token_type token_type : 8; |
306 | unsigned char size; | 307 | unsigned char size; |
307 | struct action *action; | 308 | struct action *action; |
308 | const char *value; | 309 | char *content; |
309 | struct type *type; | 310 | struct type *type; |
310 | }; | 311 | }; |
311 | 312 | ||
312 | static struct token *token_list; | 313 | static struct token *token_list; |
313 | static unsigned nr_tokens; | 314 | static unsigned nr_tokens; |
314 | static _Bool verbose; | 315 | static bool verbose_opt; |
316 | static bool debug_opt; | ||
315 | 317 | ||
316 | #define debug(fmt, ...) do { if (verbose) printf(fmt, ## __VA_ARGS__); } while (0) | 318 | #define verbose(fmt, ...) do { if (verbose_opt) printf(fmt, ## __VA_ARGS__); } while (0) |
319 | #define debug(fmt, ...) do { if (debug_opt) printf(fmt, ## __VA_ARGS__); } while (0) | ||
317 | 320 | ||
318 | static int directive_compare(const void *_key, const void *_pdir) | 321 | static int directive_compare(const void *_key, const void *_pdir) |
319 | { | 322 | { |
@@ -325,11 +328,9 @@ static int directive_compare(const void *_key, const void *_pdir) | |||
325 | dlen = strlen(dir); | 328 | dlen = strlen(dir); |
326 | clen = (dlen < token->size) ? dlen : token->size; | 329 | clen = (dlen < token->size) ? dlen : token->size; |
327 | 330 | ||
328 | //debug("cmp(%*.*s,%s) = ", | 331 | //debug("cmp(%s,%s) = ", token->content, dir); |
329 | // (int)token->size, (int)token->size, token->value, | ||
330 | // dir); | ||
331 | 332 | ||
332 | val = memcmp(token->value, dir, clen); | 333 | val = memcmp(token->content, dir, clen); |
333 | if (val != 0) { | 334 | if (val != 0) { |
334 | //debug("%d [cmp]\n", val); | 335 | //debug("%d [cmp]\n", val); |
335 | return val; | 336 | return val; |
@@ -349,7 +350,7 @@ static int directive_compare(const void *_key, const void *_pdir) | |||
349 | static void tokenise(char *buffer, char *end) | 350 | static void tokenise(char *buffer, char *end) |
350 | { | 351 | { |
351 | struct token *tokens; | 352 | struct token *tokens; |
352 | char *line, *nl, *p, *q; | 353 | char *line, *nl, *start, *p, *q; |
353 | unsigned tix, lineno; | 354 | unsigned tix, lineno; |
354 | 355 | ||
355 | /* Assume we're going to have half as many tokens as we have | 356 | /* Assume we're going to have half as many tokens as we have |
@@ -408,11 +409,11 @@ static void tokenise(char *buffer, char *end) | |||
408 | break; | 409 | break; |
409 | 410 | ||
410 | tokens[tix].line = lineno; | 411 | tokens[tix].line = lineno; |
411 | tokens[tix].value = p; | 412 | start = p; |
412 | 413 | ||
413 | /* Handle string tokens */ | 414 | /* Handle string tokens */ |
414 | if (isalpha(*p)) { | 415 | if (isalpha(*p)) { |
415 | const char **dir; | 416 | const char **dir, *start = p; |
416 | 417 | ||
417 | /* Can be a directive, type name or element | 418 | /* Can be a directive, type name or element |
418 | * name. Find the end of the name. | 419 | * name. Find the end of the name. |
@@ -423,10 +424,18 @@ static void tokenise(char *buffer, char *end) | |||
423 | tokens[tix].size = q - p; | 424 | tokens[tix].size = q - p; |
424 | p = q; | 425 | p = q; |
425 | 426 | ||
427 | tokens[tix].content = malloc(tokens[tix].size + 1); | ||
428 | if (!tokens[tix].content) { | ||
429 | perror(NULL); | ||
430 | exit(1); | ||
431 | } | ||
432 | memcpy(tokens[tix].content, start, tokens[tix].size); | ||
433 | tokens[tix].content[tokens[tix].size] = 0; | ||
434 | |||
426 | /* If it begins with a lowercase letter then | 435 | /* If it begins with a lowercase letter then |
427 | * it's an element name | 436 | * it's an element name |
428 | */ | 437 | */ |
429 | if (islower(tokens[tix].value[0])) { | 438 | if (islower(tokens[tix].content[0])) { |
430 | tokens[tix++].token_type = TOKEN_ELEMENT_NAME; | 439 | tokens[tix++].token_type = TOKEN_ELEMENT_NAME; |
431 | continue; | 440 | continue; |
432 | } | 441 | } |
@@ -455,6 +464,13 @@ static void tokenise(char *buffer, char *end) | |||
455 | q++; | 464 | q++; |
456 | tokens[tix].size = q - p; | 465 | tokens[tix].size = q - p; |
457 | p = q; | 466 | p = q; |
467 | tokens[tix].content = malloc(tokens[tix].size + 1); | ||
468 | if (!tokens[tix].content) { | ||
469 | perror(NULL); | ||
470 | exit(1); | ||
471 | } | ||
472 | memcpy(tokens[tix].content, start, tokens[tix].size); | ||
473 | tokens[tix].content[tokens[tix].size] = 0; | ||
458 | tokens[tix++].token_type = TOKEN_NUMBER; | 474 | tokens[tix++].token_type = TOKEN_NUMBER; |
459 | continue; | 475 | continue; |
460 | } | 476 | } |
@@ -463,6 +479,7 @@ static void tokenise(char *buffer, char *end) | |||
463 | if (memcmp(p, "::=", 3) == 0) { | 479 | if (memcmp(p, "::=", 3) == 0) { |
464 | p += 3; | 480 | p += 3; |
465 | tokens[tix].size = 3; | 481 | tokens[tix].size = 3; |
482 | tokens[tix].content = "::="; | ||
466 | tokens[tix++].token_type = TOKEN_ASSIGNMENT; | 483 | tokens[tix++].token_type = TOKEN_ASSIGNMENT; |
467 | continue; | 484 | continue; |
468 | } | 485 | } |
@@ -472,12 +489,14 @@ static void tokenise(char *buffer, char *end) | |||
472 | if (memcmp(p, "({", 2) == 0) { | 489 | if (memcmp(p, "({", 2) == 0) { |
473 | p += 2; | 490 | p += 2; |
474 | tokens[tix].size = 2; | 491 | tokens[tix].size = 2; |
492 | tokens[tix].content = "({"; | ||
475 | tokens[tix++].token_type = TOKEN_OPEN_ACTION; | 493 | tokens[tix++].token_type = TOKEN_OPEN_ACTION; |
476 | continue; | 494 | continue; |
477 | } | 495 | } |
478 | if (memcmp(p, "})", 2) == 0) { | 496 | if (memcmp(p, "})", 2) == 0) { |
479 | p += 2; | 497 | p += 2; |
480 | tokens[tix].size = 2; | 498 | tokens[tix].size = 2; |
499 | tokens[tix].content = "})"; | ||
481 | tokens[tix++].token_type = TOKEN_CLOSE_ACTION; | 500 | tokens[tix++].token_type = TOKEN_CLOSE_ACTION; |
482 | continue; | 501 | continue; |
483 | } | 502 | } |
@@ -488,22 +507,27 @@ static void tokenise(char *buffer, char *end) | |||
488 | switch (*p) { | 507 | switch (*p) { |
489 | case '{': | 508 | case '{': |
490 | p += 1; | 509 | p += 1; |
510 | tokens[tix].content = "{"; | ||
491 | tokens[tix++].token_type = TOKEN_OPEN_CURLY; | 511 | tokens[tix++].token_type = TOKEN_OPEN_CURLY; |
492 | continue; | 512 | continue; |
493 | case '}': | 513 | case '}': |
494 | p += 1; | 514 | p += 1; |
515 | tokens[tix].content = "}"; | ||
495 | tokens[tix++].token_type = TOKEN_CLOSE_CURLY; | 516 | tokens[tix++].token_type = TOKEN_CLOSE_CURLY; |
496 | continue; | 517 | continue; |
497 | case '[': | 518 | case '[': |
498 | p += 1; | 519 | p += 1; |
520 | tokens[tix].content = "["; | ||
499 | tokens[tix++].token_type = TOKEN_OPEN_SQUARE; | 521 | tokens[tix++].token_type = TOKEN_OPEN_SQUARE; |
500 | continue; | 522 | continue; |
501 | case ']': | 523 | case ']': |
502 | p += 1; | 524 | p += 1; |
525 | tokens[tix].content = "]"; | ||
503 | tokens[tix++].token_type = TOKEN_CLOSE_SQUARE; | 526 | tokens[tix++].token_type = TOKEN_CLOSE_SQUARE; |
504 | continue; | 527 | continue; |
505 | case ',': | 528 | case ',': |
506 | p += 1; | 529 | p += 1; |
530 | tokens[tix].content = ","; | ||
507 | tokens[tix++].token_type = TOKEN_COMMA; | 531 | tokens[tix++].token_type = TOKEN_COMMA; |
508 | continue; | 532 | continue; |
509 | default: | 533 | default: |
@@ -518,22 +542,20 @@ static void tokenise(char *buffer, char *end) | |||
518 | } | 542 | } |
519 | 543 | ||
520 | nr_tokens = tix; | 544 | nr_tokens = tix; |
521 | debug("Extracted %u tokens\n", nr_tokens); | 545 | verbose("Extracted %u tokens\n", nr_tokens); |
522 | 546 | ||
523 | #if 0 | 547 | #if 0 |
524 | { | 548 | { |
525 | int n; | 549 | int n; |
526 | for (n = 0; n < nr_tokens; n++) | 550 | for (n = 0; n < nr_tokens; n++) |
527 | debug("Token %3u: '%*.*s'\n", | 551 | debug("Token %3u: '%s'\n", n, token_list[n].content); |
528 | n, | ||
529 | (int)token_list[n].size, (int)token_list[n].size, | ||
530 | token_list[n].value); | ||
531 | } | 552 | } |
532 | #endif | 553 | #endif |
533 | } | 554 | } |
534 | 555 | ||
535 | static void build_type_list(void); | 556 | static void build_type_list(void); |
536 | static void parse(void); | 557 | static void parse(void); |
558 | static void dump_elements(void); | ||
537 | static void render(FILE *out, FILE *hdr); | 559 | static void render(FILE *out, FILE *hdr); |
538 | 560 | ||
539 | /* | 561 | /* |
@@ -548,16 +570,27 @@ int main(int argc, char **argv) | |||
548 | char *kbuild_verbose; | 570 | char *kbuild_verbose; |
549 | int fd; | 571 | int fd; |
550 | 572 | ||
573 | kbuild_verbose = getenv("KBUILD_VERBOSE"); | ||
574 | if (kbuild_verbose) | ||
575 | verbose_opt = atoi(kbuild_verbose); | ||
576 | |||
577 | while (argc > 4) { | ||
578 | if (strcmp(argv[1], "-v") == 0) | ||
579 | verbose_opt = true; | ||
580 | else if (strcmp(argv[1], "-d") == 0) | ||
581 | debug_opt = true; | ||
582 | else | ||
583 | break; | ||
584 | memmove(&argv[1], &argv[2], (argc - 2) * sizeof(char *)); | ||
585 | argc--; | ||
586 | } | ||
587 | |||
551 | if (argc != 4) { | 588 | if (argc != 4) { |
552 | fprintf(stderr, "Format: %s <grammar-file> <c-file> <hdr-file>\n", | 589 | fprintf(stderr, "Format: %s [-v] [-d] <grammar-file> <c-file> <hdr-file>\n", |
553 | argv[0]); | 590 | argv[0]); |
554 | exit(2); | 591 | exit(2); |
555 | } | 592 | } |
556 | 593 | ||
557 | kbuild_verbose = getenv("KBUILD_VERBOSE"); | ||
558 | if (kbuild_verbose) | ||
559 | verbose = atoi(kbuild_verbose); | ||
560 | |||
561 | filename = argv[1]; | 594 | filename = argv[1]; |
562 | outputname = argv[2]; | 595 | outputname = argv[2]; |
563 | headername = argv[3]; | 596 | headername = argv[3]; |
@@ -608,6 +641,7 @@ int main(int argc, char **argv) | |||
608 | tokenise(buffer, buffer + readlen); | 641 | tokenise(buffer, buffer + readlen); |
609 | build_type_list(); | 642 | build_type_list(); |
610 | parse(); | 643 | parse(); |
644 | dump_elements(); | ||
611 | 645 | ||
612 | out = fopen(outputname, "w"); | 646 | out = fopen(outputname, "w"); |
613 | if (!out) { | 647 | if (!out) { |
@@ -666,7 +700,7 @@ struct element { | |||
666 | unsigned flags; | 700 | unsigned flags; |
667 | #define ELEMENT_IMPLICIT 0x0001 | 701 | #define ELEMENT_IMPLICIT 0x0001 |
668 | #define ELEMENT_EXPLICIT 0x0002 | 702 | #define ELEMENT_EXPLICIT 0x0002 |
669 | #define ELEMENT_MARKED 0x0004 | 703 | #define ELEMENT_TAG_SPECIFIED 0x0004 |
670 | #define ELEMENT_RENDERED 0x0008 | 704 | #define ELEMENT_RENDERED 0x0008 |
671 | #define ELEMENT_SKIPPABLE 0x0010 | 705 | #define ELEMENT_SKIPPABLE 0x0010 |
672 | #define ELEMENT_CONDITIONAL 0x0020 | 706 | #define ELEMENT_CONDITIONAL 0x0020 |
@@ -693,7 +727,7 @@ static int type_index_compare(const void *_a, const void *_b) | |||
693 | if ((*a)->name->size != (*b)->name->size) | 727 | if ((*a)->name->size != (*b)->name->size) |
694 | return (*a)->name->size - (*b)->name->size; | 728 | return (*a)->name->size - (*b)->name->size; |
695 | else | 729 | else |
696 | return memcmp((*a)->name->value, (*b)->name->value, | 730 | return memcmp((*a)->name->content, (*b)->name->content, |
697 | (*a)->name->size); | 731 | (*a)->name->size); |
698 | } | 732 | } |
699 | 733 | ||
@@ -706,7 +740,7 @@ static int type_finder(const void *_key, const void *_ti) | |||
706 | if (token->size != type->name->size) | 740 | if (token->size != type->name->size) |
707 | return token->size - type->name->size; | 741 | return token->size - type->name->size; |
708 | else | 742 | else |
709 | return memcmp(token->value, type->name->value, | 743 | return memcmp(token->content, type->name->content, |
710 | token->size); | 744 | token->size); |
711 | } | 745 | } |
712 | 746 | ||
@@ -756,14 +790,11 @@ static void build_type_list(void) | |||
756 | 790 | ||
757 | qsort(type_index, nr, sizeof(type_index[0]), type_index_compare); | 791 | qsort(type_index, nr, sizeof(type_index[0]), type_index_compare); |
758 | 792 | ||
759 | debug("Extracted %u types\n", nr_types); | 793 | verbose("Extracted %u types\n", nr_types); |
760 | #if 0 | 794 | #if 0 |
761 | for (n = 0; n < nr_types; n++) { | 795 | for (n = 0; n < nr_types; n++) { |
762 | struct type *type = type_index[n]; | 796 | struct type *type = type_index[n]; |
763 | debug("- %*.*s\n", | 797 | debug("- %*.*s\n", type->name->content); |
764 | (int)type->name->size, | ||
765 | (int)type->name->size, | ||
766 | type->name->value); | ||
767 | } | 798 | } |
768 | #endif | 799 | #endif |
769 | } | 800 | } |
@@ -793,15 +824,14 @@ static void parse(void) | |||
793 | type->element->type_def = type; | 824 | type->element->type_def = type; |
794 | 825 | ||
795 | if (cursor != type[1].name) { | 826 | if (cursor != type[1].name) { |
796 | fprintf(stderr, "%s:%d: Parse error at token '%*.*s'\n", | 827 | fprintf(stderr, "%s:%d: Parse error at token '%s'\n", |
797 | filename, cursor->line, | 828 | filename, cursor->line, cursor->content); |
798 | (int)cursor->size, (int)cursor->size, cursor->value); | ||
799 | exit(1); | 829 | exit(1); |
800 | } | 830 | } |
801 | 831 | ||
802 | } while (type++, !(type->flags & TYPE_STOP_MARKER)); | 832 | } while (type++, !(type->flags & TYPE_STOP_MARKER)); |
803 | 833 | ||
804 | debug("Extracted %u actions\n", nr_actions); | 834 | verbose("Extracted %u actions\n", nr_actions); |
805 | } | 835 | } |
806 | 836 | ||
807 | static struct element *element_list; | 837 | static struct element *element_list; |
@@ -862,33 +892,31 @@ static struct element *parse_type(struct token **_cursor, struct token *end, | |||
862 | cursor++; | 892 | cursor++; |
863 | break; | 893 | break; |
864 | default: | 894 | default: |
865 | fprintf(stderr, "%s:%d: Unrecognised tag class token '%*.*s'\n", | 895 | fprintf(stderr, "%s:%d: Unrecognised tag class token '%s'\n", |
866 | filename, cursor->line, | 896 | filename, cursor->line, cursor->content); |
867 | (int)cursor->size, (int)cursor->size, cursor->value); | ||
868 | exit(1); | 897 | exit(1); |
869 | } | 898 | } |
870 | 899 | ||
871 | if (cursor >= end) | 900 | if (cursor >= end) |
872 | goto overrun_error; | 901 | goto overrun_error; |
873 | if (cursor->token_type != TOKEN_NUMBER) { | 902 | if (cursor->token_type != TOKEN_NUMBER) { |
874 | fprintf(stderr, "%s:%d: Missing tag number '%*.*s'\n", | 903 | fprintf(stderr, "%s:%d: Missing tag number '%s'\n", |
875 | filename, cursor->line, | 904 | filename, cursor->line, cursor->content); |
876 | (int)cursor->size, (int)cursor->size, cursor->value); | ||
877 | exit(1); | 905 | exit(1); |
878 | } | 906 | } |
879 | 907 | ||
880 | element->tag &= ~0x1f; | 908 | element->tag &= ~0x1f; |
881 | element->tag |= strtoul(cursor->value, &p, 10); | 909 | element->tag |= strtoul(cursor->content, &p, 10); |
882 | if (p - cursor->value != cursor->size) | 910 | element->flags |= ELEMENT_TAG_SPECIFIED; |
911 | if (p - cursor->content != cursor->size) | ||
883 | abort(); | 912 | abort(); |
884 | cursor++; | 913 | cursor++; |
885 | 914 | ||
886 | if (cursor >= end) | 915 | if (cursor >= end) |
887 | goto overrun_error; | 916 | goto overrun_error; |
888 | if (cursor->token_type != TOKEN_CLOSE_SQUARE) { | 917 | if (cursor->token_type != TOKEN_CLOSE_SQUARE) { |
889 | fprintf(stderr, "%s:%d: Missing closing square bracket '%*.*s'\n", | 918 | fprintf(stderr, "%s:%d: Missing closing square bracket '%s'\n", |
890 | filename, cursor->line, | 919 | filename, cursor->line, cursor->content); |
891 | (int)cursor->size, (int)cursor->size, cursor->value); | ||
892 | exit(1); | 920 | exit(1); |
893 | } | 921 | } |
894 | cursor++; | 922 | cursor++; |
@@ -988,9 +1016,8 @@ static struct element *parse_type(struct token **_cursor, struct token *end, | |||
988 | ref = bsearch(cursor, type_index, nr_types, sizeof(type_index[0]), | 1016 | ref = bsearch(cursor, type_index, nr_types, sizeof(type_index[0]), |
989 | type_finder); | 1017 | type_finder); |
990 | if (!ref) { | 1018 | if (!ref) { |
991 | fprintf(stderr, "%s:%d: Type '%*.*s' undefined\n", | 1019 | fprintf(stderr, "%s:%d: Type '%s' undefined\n", |
992 | filename, cursor->line, | 1020 | filename, cursor->line, cursor->content); |
993 | (int)cursor->size, (int)cursor->size, cursor->value); | ||
994 | exit(1); | 1021 | exit(1); |
995 | } | 1022 | } |
996 | cursor->type = *ref; | 1023 | cursor->type = *ref; |
@@ -1039,9 +1066,8 @@ static struct element *parse_type(struct token **_cursor, struct token *end, | |||
1039 | break; | 1066 | break; |
1040 | 1067 | ||
1041 | default: | 1068 | default: |
1042 | fprintf(stderr, "%s:%d: Token '%*.*s' does not introduce a type\n", | 1069 | fprintf(stderr, "%s:%d: Token '%s' does not introduce a type\n", |
1043 | filename, cursor->line, | 1070 | filename, cursor->line, cursor->content); |
1044 | (int)cursor->size, (int)cursor->size, cursor->value); | ||
1045 | exit(1); | 1071 | exit(1); |
1046 | } | 1072 | } |
1047 | 1073 | ||
@@ -1058,20 +1084,18 @@ static struct element *parse_type(struct token **_cursor, struct token *end, | |||
1058 | if (cursor >= end) | 1084 | if (cursor >= end) |
1059 | goto overrun_error; | 1085 | goto overrun_error; |
1060 | if (cursor->token_type != TOKEN_ELEMENT_NAME) { | 1086 | if (cursor->token_type != TOKEN_ELEMENT_NAME) { |
1061 | fprintf(stderr, "%s:%d: Token '%*.*s' is not an action function name\n", | 1087 | fprintf(stderr, "%s:%d: Token '%s' is not an action function name\n", |
1062 | filename, cursor->line, | 1088 | filename, cursor->line, cursor->content); |
1063 | (int)cursor->size, (int)cursor->size, cursor->value); | ||
1064 | exit(1); | 1089 | exit(1); |
1065 | } | 1090 | } |
1066 | 1091 | ||
1067 | action = malloc(sizeof(struct action) + cursor->size + 1); | 1092 | action = malloc(sizeof(struct action)); |
1068 | if (!action) { | 1093 | if (!action) { |
1069 | perror(NULL); | 1094 | perror(NULL); |
1070 | exit(1); | 1095 | exit(1); |
1071 | } | 1096 | } |
1072 | action->index = 0; | 1097 | action->index = 0; |
1073 | memcpy(action->name, cursor->value, cursor->size); | 1098 | action->name = cursor->content; |
1074 | action->name[cursor->size] = 0; | ||
1075 | 1099 | ||
1076 | for (ppaction = &action_list; | 1100 | for (ppaction = &action_list; |
1077 | *ppaction; | 1101 | *ppaction; |
@@ -1101,9 +1125,8 @@ static struct element *parse_type(struct token **_cursor, struct token *end, | |||
1101 | if (cursor >= end) | 1125 | if (cursor >= end) |
1102 | goto overrun_error; | 1126 | goto overrun_error; |
1103 | if (cursor->token_type != TOKEN_CLOSE_ACTION) { | 1127 | if (cursor->token_type != TOKEN_CLOSE_ACTION) { |
1104 | fprintf(stderr, "%s:%d: Missing close action, got '%*.*s'\n", | 1128 | fprintf(stderr, "%s:%d: Missing close action, got '%s'\n", |
1105 | filename, cursor->line, | 1129 | filename, cursor->line, cursor->content); |
1106 | (int)cursor->size, (int)cursor->size, cursor->value); | ||
1107 | exit(1); | 1130 | exit(1); |
1108 | } | 1131 | } |
1109 | cursor++; | 1132 | cursor++; |
@@ -1113,9 +1136,8 @@ static struct element *parse_type(struct token **_cursor, struct token *end, | |||
1113 | return top; | 1136 | return top; |
1114 | 1137 | ||
1115 | parse_error: | 1138 | parse_error: |
1116 | fprintf(stderr, "%s:%d: Unexpected token '%*.*s'\n", | 1139 | fprintf(stderr, "%s:%d: Unexpected token '%s'\n", |
1117 | filename, cursor->line, | 1140 | filename, cursor->line, cursor->content); |
1118 | (int)cursor->size, (int)cursor->size, cursor->value); | ||
1119 | exit(1); | 1141 | exit(1); |
1120 | 1142 | ||
1121 | overrun_error: | 1143 | overrun_error: |
@@ -1133,9 +1155,8 @@ static struct element *parse_compound(struct token **_cursor, struct token *end, | |||
1133 | struct token *cursor = *_cursor, *name; | 1155 | struct token *cursor = *_cursor, *name; |
1134 | 1156 | ||
1135 | if (cursor->token_type != TOKEN_OPEN_CURLY) { | 1157 | if (cursor->token_type != TOKEN_OPEN_CURLY) { |
1136 | fprintf(stderr, "%s:%d: Expected compound to start with brace not '%*.*s'\n", | 1158 | fprintf(stderr, "%s:%d: Expected compound to start with brace not '%s'\n", |
1137 | filename, cursor->line, | 1159 | filename, cursor->line, cursor->content); |
1138 | (int)cursor->size, (int)cursor->size, cursor->value); | ||
1139 | exit(1); | 1160 | exit(1); |
1140 | } | 1161 | } |
1141 | cursor++; | 1162 | cursor++; |
@@ -1176,9 +1197,8 @@ static struct element *parse_compound(struct token **_cursor, struct token *end, | |||
1176 | children->flags &= ~ELEMENT_CONDITIONAL; | 1197 | children->flags &= ~ELEMENT_CONDITIONAL; |
1177 | 1198 | ||
1178 | if (cursor->token_type != TOKEN_CLOSE_CURLY) { | 1199 | if (cursor->token_type != TOKEN_CLOSE_CURLY) { |
1179 | fprintf(stderr, "%s:%d: Expected compound closure, got '%*.*s'\n", | 1200 | fprintf(stderr, "%s:%d: Expected compound closure, got '%s'\n", |
1180 | filename, cursor->line, | 1201 | filename, cursor->line, cursor->content); |
1181 | (int)cursor->size, (int)cursor->size, cursor->value); | ||
1182 | exit(1); | 1202 | exit(1); |
1183 | } | 1203 | } |
1184 | cursor++; | 1204 | cursor++; |
@@ -1191,6 +1211,52 @@ overrun_error: | |||
1191 | exit(1); | 1211 | exit(1); |
1192 | } | 1212 | } |
1193 | 1213 | ||
1214 | static void dump_element(const struct element *e, int level) | ||
1215 | { | ||
1216 | const struct element *c; | ||
1217 | const struct type *t = e->type_def; | ||
1218 | const char *name = e->name ? e->name->content : "."; | ||
1219 | const char *tname = t && t->name ? t->name->content : "."; | ||
1220 | char tag[32]; | ||
1221 | |||
1222 | if (e->class == 0 && e->method == 0 && e->tag == 0) | ||
1223 | strcpy(tag, "<...>"); | ||
1224 | else if (e->class == ASN1_UNIV) | ||
1225 | sprintf(tag, "%s %s %s", | ||
1226 | asn1_classes[e->class], | ||
1227 | asn1_methods[e->method], | ||
1228 | asn1_universal_tags[e->tag]); | ||
1229 | else | ||
1230 | sprintf(tag, "%s %s %u", | ||
1231 | asn1_classes[e->class], | ||
1232 | asn1_methods[e->method], | ||
1233 | e->tag); | ||
1234 | |||
1235 | printf("%c%c%c%c%c %c %*s[*] \e[33m%s\e[m %s %s \e[35m%s\e[m\n", | ||
1236 | e->flags & ELEMENT_IMPLICIT ? 'I' : '-', | ||
1237 | e->flags & ELEMENT_EXPLICIT ? 'E' : '-', | ||
1238 | e->flags & ELEMENT_TAG_SPECIFIED ? 'T' : '-', | ||
1239 | e->flags & ELEMENT_SKIPPABLE ? 'S' : '-', | ||
1240 | e->flags & ELEMENT_CONDITIONAL ? 'C' : '-', | ||
1241 | "-tTqQcaro"[e->compound], | ||
1242 | level, "", | ||
1243 | tag, | ||
1244 | tname, | ||
1245 | name, | ||
1246 | e->action ? e->action->name : ""); | ||
1247 | if (e->compound == TYPE_REF) | ||
1248 | dump_element(e->type->type->element, level + 3); | ||
1249 | else | ||
1250 | for (c = e->children; c; c = c->next) | ||
1251 | dump_element(c, level + 3); | ||
1252 | } | ||
1253 | |||
1254 | static void dump_elements(void) | ||
1255 | { | ||
1256 | if (debug_opt) | ||
1257 | dump_element(type_list[0].element, 0); | ||
1258 | } | ||
1259 | |||
1194 | static void render_element(FILE *out, struct element *e, struct element *tag); | 1260 | static void render_element(FILE *out, struct element *e, struct element *tag); |
1195 | static void render_out_of_line_list(FILE *out); | 1261 | static void render_out_of_line_list(FILE *out); |
1196 | 1262 | ||
@@ -1292,7 +1358,7 @@ static void render(FILE *out, FILE *hdr) | |||
1292 | } | 1358 | } |
1293 | 1359 | ||
1294 | /* We do two passes - the first one calculates all the offsets */ | 1360 | /* We do two passes - the first one calculates all the offsets */ |
1295 | debug("Pass 1\n"); | 1361 | verbose("Pass 1\n"); |
1296 | nr_entries = 0; | 1362 | nr_entries = 0; |
1297 | root = &type_list[0]; | 1363 | root = &type_list[0]; |
1298 | render_element(NULL, root->element, NULL); | 1364 | render_element(NULL, root->element, NULL); |
@@ -1303,7 +1369,7 @@ static void render(FILE *out, FILE *hdr) | |||
1303 | e->flags &= ~ELEMENT_RENDERED; | 1369 | e->flags &= ~ELEMENT_RENDERED; |
1304 | 1370 | ||
1305 | /* And then we actually render */ | 1371 | /* And then we actually render */ |
1306 | debug("Pass 2\n"); | 1372 | verbose("Pass 2\n"); |
1307 | fprintf(out, "\n"); | 1373 | fprintf(out, "\n"); |
1308 | fprintf(out, "static const unsigned char %s_machine[] = {\n", | 1374 | fprintf(out, "static const unsigned char %s_machine[] = {\n", |
1309 | grammar_name); | 1375 | grammar_name); |
@@ -1376,7 +1442,7 @@ static void render_out_of_line_list(FILE *out) | |||
1376 | */ | 1442 | */ |
1377 | static void render_element(FILE *out, struct element *e, struct element *tag) | 1443 | static void render_element(FILE *out, struct element *e, struct element *tag) |
1378 | { | 1444 | { |
1379 | struct element *ec; | 1445 | struct element *ec, *x; |
1380 | const char *cond, *act; | 1446 | const char *cond, *act; |
1381 | int entry, skippable = 0, outofline = 0; | 1447 | int entry, skippable = 0, outofline = 0; |
1382 | 1448 | ||
@@ -1389,9 +1455,7 @@ static void render_element(FILE *out, struct element *e, struct element *tag) | |||
1389 | outofline = 1; | 1455 | outofline = 1; |
1390 | 1456 | ||
1391 | if (e->type_def && out) { | 1457 | if (e->type_def && out) { |
1392 | render_more(out, "\t// %*.*s\n", | 1458 | render_more(out, "\t// %s\n", e->type_def->name->content); |
1393 | (int)e->type_def->name->size, (int)e->type_def->name->size, | ||
1394 | e->type_def->name->value); | ||
1395 | } | 1459 | } |
1396 | 1460 | ||
1397 | /* Render the operation */ | 1461 | /* Render the operation */ |
@@ -1400,11 +1464,10 @@ static void render_element(FILE *out, struct element *e, struct element *tag) | |||
1400 | act = e->action ? "_ACT" : ""; | 1464 | act = e->action ? "_ACT" : ""; |
1401 | switch (e->compound) { | 1465 | switch (e->compound) { |
1402 | case ANY: | 1466 | case ANY: |
1403 | render_opcode(out, "ASN1_OP_%sMATCH_ANY%s,", cond, act); | 1467 | render_opcode(out, "ASN1_OP_%sMATCH_ANY%s%s,", |
1468 | cond, act, skippable ? "_OR_SKIP" : ""); | ||
1404 | if (e->name) | 1469 | if (e->name) |
1405 | render_more(out, "\t\t// %*.*s", | 1470 | render_more(out, "\t\t// %s", e->name->content); |
1406 | (int)e->name->size, (int)e->name->size, | ||
1407 | e->name->value); | ||
1408 | render_more(out, "\n"); | 1471 | render_more(out, "\n"); |
1409 | goto dont_render_tag; | 1472 | goto dont_render_tag; |
1410 | 1473 | ||
@@ -1435,15 +1498,15 @@ static void render_element(FILE *out, struct element *e, struct element *tag) | |||
1435 | break; | 1498 | break; |
1436 | } | 1499 | } |
1437 | 1500 | ||
1438 | if (e->name) | 1501 | x = tag ?: e; |
1439 | render_more(out, "\t\t// %*.*s", | 1502 | if (x->name) |
1440 | (int)e->name->size, (int)e->name->size, | 1503 | render_more(out, "\t\t// %s", x->name->content); |
1441 | e->name->value); | ||
1442 | render_more(out, "\n"); | 1504 | render_more(out, "\n"); |
1443 | 1505 | ||
1444 | /* Render the tag */ | 1506 | /* Render the tag */ |
1445 | if (!tag) | 1507 | if (!tag || !(tag->flags & ELEMENT_TAG_SPECIFIED)) |
1446 | tag = e; | 1508 | tag = e; |
1509 | |||
1447 | if (tag->class == ASN1_UNIV && | 1510 | if (tag->class == ASN1_UNIV && |
1448 | tag->tag != 14 && | 1511 | tag->tag != 14 && |
1449 | tag->tag != 15 && | 1512 | tag->tag != 15 && |
@@ -1465,7 +1528,8 @@ dont_render_tag: | |||
1465 | case TYPE_REF: | 1528 | case TYPE_REF: |
1466 | render_element(out, e->type->type->element, tag); | 1529 | render_element(out, e->type->type->element, tag); |
1467 | if (e->action) | 1530 | if (e->action) |
1468 | render_opcode(out, "ASN1_OP_ACT,\n"); | 1531 | render_opcode(out, "ASN1_OP_%sACT,\n", |
1532 | skippable ? "MAYBE_" : ""); | ||
1469 | break; | 1533 | break; |
1470 | 1534 | ||
1471 | case SEQUENCE: | 1535 | case SEQUENCE: |
@@ -1474,10 +1538,8 @@ dont_render_tag: | |||
1474 | * skipability */ | 1538 | * skipability */ |
1475 | render_opcode(out, "_jump_target(%u),", e->entry_index); | 1539 | render_opcode(out, "_jump_target(%u),", e->entry_index); |
1476 | if (e->type_def && e->type_def->name) | 1540 | if (e->type_def && e->type_def->name) |
1477 | render_more(out, "\t\t// --> %*.*s", | 1541 | render_more(out, "\t\t// --> %s", |
1478 | (int)e->type_def->name->size, | 1542 | e->type_def->name->content); |
1479 | (int)e->type_def->name->size, | ||
1480 | e->type_def->name->value); | ||
1481 | render_more(out, "\n"); | 1543 | render_more(out, "\n"); |
1482 | if (!(e->flags & ELEMENT_RENDERED)) { | 1544 | if (!(e->flags & ELEMENT_RENDERED)) { |
1483 | e->flags |= ELEMENT_RENDERED; | 1545 | e->flags |= ELEMENT_RENDERED; |
@@ -1502,10 +1564,8 @@ dont_render_tag: | |||
1502 | * skipability */ | 1564 | * skipability */ |
1503 | render_opcode(out, "_jump_target(%u),", e->entry_index); | 1565 | render_opcode(out, "_jump_target(%u),", e->entry_index); |
1504 | if (e->type_def && e->type_def->name) | 1566 | if (e->type_def && e->type_def->name) |
1505 | render_more(out, "\t\t// --> %*.*s", | 1567 | render_more(out, "\t\t// --> %s", |
1506 | (int)e->type_def->name->size, | 1568 | e->type_def->name->content); |
1507 | (int)e->type_def->name->size, | ||
1508 | e->type_def->name->value); | ||
1509 | render_more(out, "\n"); | 1569 | render_more(out, "\n"); |
1510 | if (!(e->flags & ELEMENT_RENDERED)) { | 1570 | if (!(e->flags & ELEMENT_RENDERED)) { |
1511 | e->flags |= ELEMENT_RENDERED; | 1571 | e->flags |= ELEMENT_RENDERED; |
@@ -1539,7 +1599,7 @@ dont_render_tag: | |||
1539 | 1599 | ||
1540 | case CHOICE: | 1600 | case CHOICE: |
1541 | for (ec = e->children; ec; ec = ec->next) | 1601 | for (ec = e->children; ec; ec = ec->next) |
1542 | render_element(out, ec, NULL); | 1602 | render_element(out, ec, ec); |
1543 | if (!skippable) | 1603 | if (!skippable) |
1544 | render_opcode(out, "ASN1_OP_COND_FAIL,\n"); | 1604 | render_opcode(out, "ASN1_OP_COND_FAIL,\n"); |
1545 | if (e->action) | 1605 | if (e->action) |
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index b30406860b73..c68fd61fdc42 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c | |||
@@ -192,23 +192,6 @@ static void define_config(const char *name, int len, unsigned int hash) | |||
192 | } | 192 | } |
193 | 193 | ||
194 | /* | 194 | /* |
195 | * Clear the set of configuration strings. | ||
196 | */ | ||
197 | static void clear_config(void) | ||
198 | { | ||
199 | struct item *aux, *next; | ||
200 | unsigned int i; | ||
201 | |||
202 | for (i = 0; i < HASHSZ; i++) { | ||
203 | for (aux = hashtab[i]; aux; aux = next) { | ||
204 | next = aux->next; | ||
205 | free(aux); | ||
206 | } | ||
207 | hashtab[i] = NULL; | ||
208 | } | ||
209 | } | ||
210 | |||
211 | /* | ||
212 | * Record the use of a CONFIG_* word. | 195 | * Record the use of a CONFIG_* word. |
213 | */ | 196 | */ |
214 | static void use_config(const char *m, int slen) | 197 | static void use_config(const char *m, int slen) |
@@ -251,7 +234,8 @@ static void parse_config_file(const char *map, size_t len) | |||
251 | continue; | 234 | continue; |
252 | if (memcmp(p, "CONFIG_", 7)) | 235 | if (memcmp(p, "CONFIG_", 7)) |
253 | continue; | 236 | continue; |
254 | for (q = p + 7; q < map + len; q++) { | 237 | p += 7; |
238 | for (q = p; q < map + len; q++) { | ||
255 | if (!(isalnum(*q) || *q == '_')) | 239 | if (!(isalnum(*q) || *q == '_')) |
256 | goto found; | 240 | goto found; |
257 | } | 241 | } |
@@ -260,9 +244,9 @@ static void parse_config_file(const char *map, size_t len) | |||
260 | found: | 244 | found: |
261 | if (!memcmp(q - 7, "_MODULE", 7)) | 245 | if (!memcmp(q - 7, "_MODULE", 7)) |
262 | q -= 7; | 246 | q -= 7; |
263 | if( (q-p-7) < 0 ) | 247 | if (q - p < 0) |
264 | continue; | 248 | continue; |
265 | use_config(p+7, q-p-7); | 249 | use_config(p, q - p); |
266 | } | 250 | } |
267 | } | 251 | } |
268 | 252 | ||
@@ -324,8 +308,6 @@ static void parse_dep_file(void *map, size_t len) | |||
324 | int saw_any_target = 0; | 308 | int saw_any_target = 0; |
325 | int is_first_dep = 0; | 309 | int is_first_dep = 0; |
326 | 310 | ||
327 | clear_config(); | ||
328 | |||
329 | while (m < end) { | 311 | while (m < end) { |
330 | /* Skip any "white space" */ | 312 | /* Skip any "white space" */ |
331 | while (m < end && (*m == ' ' || *m == '\\' || *m == '\n')) | 313 | while (m < end && (*m == ' ' || *m == '\\' || *m == '\n')) |
diff --git a/scripts/checkkconfigsymbols.py b/scripts/checkkconfigsymbols.py index c89fdcaf06e8..2f4b7ffd5570 100755 --- a/scripts/checkkconfigsymbols.py +++ b/scripts/checkkconfigsymbols.py | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | """Find Kconfig symbols that are referenced but not defined.""" | 3 | """Find Kconfig symbols that are referenced but not defined.""" |
4 | 4 | ||
5 | # (c) 2014-2015 Valentin Rothberg <Valentin.Rothberg@lip6.fr> | 5 | # (c) 2014-2015 Valentin Rothberg <valentinrothberg@gmail.com> |
6 | # (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de> | 6 | # (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de> |
7 | # | 7 | # |
8 | # Licensed under the terms of the GNU GPL License version 2 | 8 | # Licensed under the terms of the GNU GPL License version 2 |
@@ -20,18 +20,20 @@ OPERATORS = r"&|\(|\)|\||\!" | |||
20 | FEATURE = r"(?:\w*[A-Z0-9]\w*){2,}" | 20 | FEATURE = r"(?:\w*[A-Z0-9]\w*){2,}" |
21 | DEF = r"^\s*(?:menu){,1}config\s+(" + FEATURE + r")\s*" | 21 | DEF = r"^\s*(?:menu){,1}config\s+(" + FEATURE + r")\s*" |
22 | EXPR = r"(?:" + OPERATORS + r"|\s|" + FEATURE + r")+" | 22 | EXPR = r"(?:" + OPERATORS + r"|\s|" + FEATURE + r")+" |
23 | STMT = r"^\s*(?:if|select|depends\s+on)\s+" + EXPR | 23 | DEFAULT = r"default\s+.*?(?:if\s.+){,1}" |
24 | STMT = r"^\s*(?:if|select|depends\s+on|(?:" + DEFAULT + r"))\s+" + EXPR | ||
24 | SOURCE_FEATURE = r"(?:\W|\b)+[D]{,1}CONFIG_(" + FEATURE + r")" | 25 | SOURCE_FEATURE = r"(?:\W|\b)+[D]{,1}CONFIG_(" + FEATURE + r")" |
25 | 26 | ||
26 | # regex objects | 27 | # regex objects |
27 | REGEX_FILE_KCONFIG = re.compile(r".*Kconfig[\.\w+\-]*$") | 28 | REGEX_FILE_KCONFIG = re.compile(r".*Kconfig[\.\w+\-]*$") |
28 | REGEX_FEATURE = re.compile(r"(" + FEATURE + r")") | 29 | REGEX_FEATURE = re.compile(r'(?!\B"[^"]*)' + FEATURE + r'(?![^"]*"\B)') |
29 | REGEX_SOURCE_FEATURE = re.compile(SOURCE_FEATURE) | 30 | REGEX_SOURCE_FEATURE = re.compile(SOURCE_FEATURE) |
30 | REGEX_KCONFIG_DEF = re.compile(DEF) | 31 | REGEX_KCONFIG_DEF = re.compile(DEF) |
31 | REGEX_KCONFIG_EXPR = re.compile(EXPR) | 32 | REGEX_KCONFIG_EXPR = re.compile(EXPR) |
32 | REGEX_KCONFIG_STMT = re.compile(STMT) | 33 | REGEX_KCONFIG_STMT = re.compile(STMT) |
33 | REGEX_KCONFIG_HELP = re.compile(r"^\s+(help|---help---)\s*$") | 34 | REGEX_KCONFIG_HELP = re.compile(r"^\s+(help|---help---)\s*$") |
34 | REGEX_FILTER_FEATURES = re.compile(r"[A-Za-z0-9]$") | 35 | REGEX_FILTER_FEATURES = re.compile(r"[A-Za-z0-9]$") |
36 | REGEX_NUMERIC = re.compile(r"0[xX][0-9a-fA-F]+|[0-9]+") | ||
35 | 37 | ||
36 | 38 | ||
37 | def parse_options(): | 39 | def parse_options(): |
@@ -58,6 +60,11 @@ def parse_options(): | |||
58 | "input format bases on Git log's " | 60 | "input format bases on Git log's " |
59 | "\'commmit1..commit2\'.") | 61 | "\'commmit1..commit2\'.") |
60 | 62 | ||
63 | parser.add_option('-f', '--find', dest='find', action='store_true', | ||
64 | default=False, | ||
65 | help="Find and show commits that may cause symbols to be " | ||
66 | "missing. Required to run with --diff.") | ||
67 | |||
61 | parser.add_option('-i', '--ignore', dest='ignore', action='store', | 68 | parser.add_option('-i', '--ignore', dest='ignore', action='store', |
62 | default="", | 69 | default="", |
63 | help="Ignore files matching this pattern. Note that " | 70 | help="Ignore files matching this pattern. Note that " |
@@ -86,6 +93,9 @@ def parse_options(): | |||
86 | "'--force' if you\nwant to ignore this warning and " | 93 | "'--force' if you\nwant to ignore this warning and " |
87 | "continue.") | 94 | "continue.") |
88 | 95 | ||
96 | if opts.commit: | ||
97 | opts.find = False | ||
98 | |||
89 | if opts.ignore: | 99 | if opts.ignore: |
90 | try: | 100 | try: |
91 | re.match(opts.ignore, "this/is/just/a/test.c") | 101 | re.match(opts.ignore, "this/is/just/a/test.c") |
@@ -128,13 +138,19 @@ def main(): | |||
128 | # feature has not been undefined before | 138 | # feature has not been undefined before |
129 | if not feature in undefined_a: | 139 | if not feature in undefined_a: |
130 | files = sorted(undefined_b.get(feature)) | 140 | files = sorted(undefined_b.get(feature)) |
131 | print "%s\t%s" % (feature, ", ".join(files)) | 141 | print "%s\t%s" % (yel(feature), ", ".join(files)) |
142 | if opts.find: | ||
143 | commits = find_commits(feature, opts.diff) | ||
144 | print red(commits) | ||
132 | # check if there are new files that reference the undefined feature | 145 | # check if there are new files that reference the undefined feature |
133 | else: | 146 | else: |
134 | files = sorted(undefined_b.get(feature) - | 147 | files = sorted(undefined_b.get(feature) - |
135 | undefined_a.get(feature)) | 148 | undefined_a.get(feature)) |
136 | if files: | 149 | if files: |
137 | print "%s\t%s" % (feature, ", ".join(files)) | 150 | print "%s\t%s" % (yel(feature), ", ".join(files)) |
151 | if opts.find: | ||
152 | commits = find_commits(feature, opts.diff) | ||
153 | print red(commits) | ||
138 | 154 | ||
139 | # reset to head | 155 | # reset to head |
140 | execute("git reset --hard %s" % head) | 156 | execute("git reset --hard %s" % head) |
@@ -144,7 +160,21 @@ def main(): | |||
144 | undefined = check_symbols(opts.ignore) | 160 | undefined = check_symbols(opts.ignore) |
145 | for feature in sorted(undefined): | 161 | for feature in sorted(undefined): |
146 | files = sorted(undefined.get(feature)) | 162 | files = sorted(undefined.get(feature)) |
147 | print "%s\t%s" % (feature, ", ".join(files)) | 163 | print "%s\t%s" % (yel(feature), ", ".join(files)) |
164 | |||
165 | |||
166 | def yel(string): | ||
167 | """ | ||
168 | Color %string yellow. | ||
169 | """ | ||
170 | return "\033[33m%s\033[0m" % string | ||
171 | |||
172 | |||
173 | def red(string): | ||
174 | """ | ||
175 | Color %string red. | ||
176 | """ | ||
177 | return "\033[31m%s\033[0m" % string | ||
148 | 178 | ||
149 | 179 | ||
150 | def execute(cmd): | 180 | def execute(cmd): |
@@ -156,6 +186,13 @@ def execute(cmd): | |||
156 | return stdout | 186 | return stdout |
157 | 187 | ||
158 | 188 | ||
189 | def find_commits(symbol, diff): | ||
190 | """Find commits changing %symbol in the given range of %diff.""" | ||
191 | commits = execute("git log --pretty=oneline --abbrev-commit -G %s %s" | ||
192 | % (symbol, diff)) | ||
193 | return commits | ||
194 | |||
195 | |||
159 | def tree_is_dirty(): | 196 | def tree_is_dirty(): |
160 | """Return true if the current working tree is dirty (i.e., if any file has | 197 | """Return true if the current working tree is dirty (i.e., if any file has |
161 | been added, deleted, modified, renamed or copied but not committed).""" | 198 | been added, deleted, modified, renamed or copied but not committed).""" |
@@ -279,6 +316,9 @@ def parse_kconfig_file(kfile, defined_features, referenced_features): | |||
279 | line = line.strip('\n') | 316 | line = line.strip('\n') |
280 | features.extend(get_features_in_line(line)) | 317 | features.extend(get_features_in_line(line)) |
281 | for feature in set(features): | 318 | for feature in set(features): |
319 | if REGEX_NUMERIC.match(feature): | ||
320 | # ignore numeric values | ||
321 | continue | ||
282 | paths = referenced_features.get(feature, set()) | 322 | paths = referenced_features.get(feature, set()) |
283 | paths.add(kfile) | 323 | paths.add(kfile) |
284 | referenced_features[feature] = paths | 324 | referenced_features[feature] = paths |
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d5c8e9a3a73c..a51ca0e5beef 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -5011,6 +5011,7 @@ sub process { | |||
5011 | "memory barrier without comment\n" . $herecurr); | 5011 | "memory barrier without comment\n" . $herecurr); |
5012 | } | 5012 | } |
5013 | } | 5013 | } |
5014 | |||
5014 | # check for waitqueue_active without a comment. | 5015 | # check for waitqueue_active without a comment. |
5015 | if ($line =~ /\bwaitqueue_active\s*\(/) { | 5016 | if ($line =~ /\bwaitqueue_active\s*\(/) { |
5016 | if (!ctx_has_comment($first_line, $linenr)) { | 5017 | if (!ctx_has_comment($first_line, $linenr)) { |
@@ -5018,6 +5019,24 @@ sub process { | |||
5018 | "waitqueue_active without comment\n" . $herecurr); | 5019 | "waitqueue_active without comment\n" . $herecurr); |
5019 | } | 5020 | } |
5020 | } | 5021 | } |
5022 | |||
5023 | # Check for expedited grace periods that interrupt non-idle non-nohz | ||
5024 | # online CPUs. These expedited can therefore degrade real-time response | ||
5025 | # if used carelessly, and should be avoided where not absolutely | ||
5026 | # needed. It is always OK to use synchronize_rcu_expedited() and | ||
5027 | # synchronize_sched_expedited() at boot time (before real-time applications | ||
5028 | # start) and in error situations where real-time response is compromised in | ||
5029 | # any case. Note that synchronize_srcu_expedited() does -not- interrupt | ||
5030 | # other CPUs, so don't warn on uses of synchronize_srcu_expedited(). | ||
5031 | # Of course, nothing comes for free, and srcu_read_lock() and | ||
5032 | # srcu_read_unlock() do contain full memory barriers in payment for | ||
5033 | # synchronize_srcu_expedited() non-interruption properties. | ||
5034 | if ($line =~ /\b(synchronize_rcu_expedited|synchronize_sched_expedited)\(/) { | ||
5035 | WARN("EXPEDITED_RCU_GRACE_PERIOD", | ||
5036 | "expedited RCU grace periods should be avoided where they can degrade real-time response\n" . $herecurr); | ||
5037 | |||
5038 | } | ||
5039 | |||
5021 | # check of hardware specific defines | 5040 | # check of hardware specific defines |
5022 | if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) { | 5041 | if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) { |
5023 | CHK("ARCH_DEFINES", | 5042 | CHK("ARCH_DEFINES", |
diff --git a/scripts/coccinelle/api/alloc/pool_zalloc-simple.cocci b/scripts/coccinelle/api/alloc/pool_zalloc-simple.cocci new file mode 100644 index 000000000000..9b7eb321a025 --- /dev/null +++ b/scripts/coccinelle/api/alloc/pool_zalloc-simple.cocci | |||
@@ -0,0 +1,84 @@ | |||
1 | /// | ||
2 | /// Use *_pool_zalloc rather than *_pool_alloc followed by memset with 0 | ||
3 | /// | ||
4 | // Copyright: (C) 2015 Intel Corp. GPLv2. | ||
5 | // Options: --no-includes --include-headers | ||
6 | // | ||
7 | // Keywords: dma_pool_zalloc, pci_pool_zalloc | ||
8 | // | ||
9 | |||
10 | virtual context | ||
11 | virtual patch | ||
12 | virtual org | ||
13 | virtual report | ||
14 | |||
15 | //---------------------------------------------------------- | ||
16 | // For context mode | ||
17 | //---------------------------------------------------------- | ||
18 | |||
19 | @depends on context@ | ||
20 | expression x; | ||
21 | statement S; | ||
22 | @@ | ||
23 | |||
24 | * x = \(dma_pool_alloc\|pci_pool_alloc\)(...); | ||
25 | if ((x==NULL) || ...) S | ||
26 | * memset(x,0, ...); | ||
27 | |||
28 | //---------------------------------------------------------- | ||
29 | // For patch mode | ||
30 | //---------------------------------------------------------- | ||
31 | |||
32 | @depends on patch@ | ||
33 | expression x; | ||
34 | expression a,b,c; | ||
35 | statement S; | ||
36 | @@ | ||
37 | |||
38 | - x = dma_pool_alloc(a,b,c); | ||
39 | + x = dma_pool_zalloc(a,b,c); | ||
40 | if ((x==NULL) || ...) S | ||
41 | - memset(x,0,...); | ||
42 | |||
43 | @depends on patch@ | ||
44 | expression x; | ||
45 | expression a,b,c; | ||
46 | statement S; | ||
47 | @@ | ||
48 | |||
49 | - x = pci_pool_alloc(a,b,c); | ||
50 | + x = pci_pool_zalloc(a,b,c); | ||
51 | if ((x==NULL) || ...) S | ||
52 | - memset(x,0,...); | ||
53 | |||
54 | //---------------------------------------------------------- | ||
55 | // For org and report mode | ||
56 | //---------------------------------------------------------- | ||
57 | |||
58 | @r depends on org || report@ | ||
59 | expression x; | ||
60 | expression a,b,c; | ||
61 | statement S; | ||
62 | position p; | ||
63 | @@ | ||
64 | |||
65 | x = @p\(dma_pool_alloc\|pci_pool_alloc\)(a,b,c); | ||
66 | if ((x==NULL) || ...) S | ||
67 | memset(x,0, ...); | ||
68 | |||
69 | @script:python depends on org@ | ||
70 | p << r.p; | ||
71 | x << r.x; | ||
72 | @@ | ||
73 | |||
74 | msg="%s" % (x) | ||
75 | msg_safe=msg.replace("[","@(").replace("]",")") | ||
76 | coccilib.org.print_todo(p[0], msg_safe) | ||
77 | |||
78 | @script:python depends on report@ | ||
79 | p << r.p; | ||
80 | x << r.x; | ||
81 | @@ | ||
82 | |||
83 | msg="WARNING: *_pool_zalloc should be used for %s, instead of *_pool_alloc/memset" % (x) | ||
84 | coccilib.report.print_report(p[0], msg) | ||
diff --git a/scripts/coccinelle/api/platform_no_drv_owner.cocci b/scripts/coccinelle/api/platform_no_drv_owner.cocci index e065b9e714fc..c5e3f73f2054 100644 --- a/scripts/coccinelle/api/platform_no_drv_owner.cocci +++ b/scripts/coccinelle/api/platform_no_drv_owner.cocci | |||
@@ -9,11 +9,14 @@ virtual org | |||
9 | virtual report | 9 | virtual report |
10 | 10 | ||
11 | @match1@ | 11 | @match1@ |
12 | declarer name module_i2c_driver; | ||
12 | declarer name module_platform_driver; | 13 | declarer name module_platform_driver; |
13 | declarer name module_platform_driver_probe; | 14 | declarer name module_platform_driver_probe; |
14 | identifier __driver; | 15 | identifier __driver; |
15 | @@ | 16 | @@ |
16 | ( | 17 | ( |
18 | module_i2c_driver(__driver); | ||
19 | | | ||
17 | module_platform_driver(__driver); | 20 | module_platform_driver(__driver); |
18 | | | 21 | | |
19 | module_platform_driver_probe(__driver, ...); | 22 | module_platform_driver_probe(__driver, ...); |
@@ -28,6 +31,15 @@ identifier match1.__driver; | |||
28 | } | 31 | } |
29 | }; | 32 | }; |
30 | 33 | ||
34 | @fix1_i2c depends on match1 && patch && !context && !org && !report@ | ||
35 | identifier match1.__driver; | ||
36 | @@ | ||
37 | static struct i2c_driver __driver = { | ||
38 | .driver = { | ||
39 | - .owner = THIS_MODULE, | ||
40 | } | ||
41 | }; | ||
42 | |||
31 | @match2@ | 43 | @match2@ |
32 | identifier __driver; | 44 | identifier __driver; |
33 | @@ | 45 | @@ |
@@ -37,6 +49,8 @@ identifier __driver; | |||
37 | platform_driver_probe(&__driver, ...) | 49 | platform_driver_probe(&__driver, ...) |
38 | | | 50 | | |
39 | platform_create_bundle(&__driver, ...) | 51 | platform_create_bundle(&__driver, ...) |
52 | | | ||
53 | i2c_add_driver(&__driver) | ||
40 | ) | 54 | ) |
41 | 55 | ||
42 | @fix2 depends on match2 && patch && !context && !org && !report@ | 56 | @fix2 depends on match2 && patch && !context && !org && !report@ |
@@ -48,6 +62,15 @@ identifier match2.__driver; | |||
48 | } | 62 | } |
49 | }; | 63 | }; |
50 | 64 | ||
65 | @fix2_i2c depends on match2 && patch && !context && !org && !report@ | ||
66 | identifier match2.__driver; | ||
67 | @@ | ||
68 | static struct i2c_driver __driver = { | ||
69 | .driver = { | ||
70 | - .owner = THIS_MODULE, | ||
71 | } | ||
72 | }; | ||
73 | |||
51 | // ---------------------------------------------------------------------------- | 74 | // ---------------------------------------------------------------------------- |
52 | 75 | ||
53 | @fix1_context depends on match1 && !patch && (context || org || report)@ | 76 | @fix1_context depends on match1 && !patch && (context || org || report)@ |
@@ -61,6 +84,17 @@ position j0; | |||
61 | } | 84 | } |
62 | }; | 85 | }; |
63 | 86 | ||
87 | @fix1_i2c_context depends on match1 && !patch && (context || org || report)@ | ||
88 | identifier match1.__driver; | ||
89 | position j0; | ||
90 | @@ | ||
91 | |||
92 | static struct i2c_driver __driver = { | ||
93 | .driver = { | ||
94 | * .owner@j0 = THIS_MODULE, | ||
95 | } | ||
96 | }; | ||
97 | |||
64 | @fix2_context depends on match2 && !patch && (context || org || report)@ | 98 | @fix2_context depends on match2 && !patch && (context || org || report)@ |
65 | identifier match2.__driver; | 99 | identifier match2.__driver; |
66 | position j0; | 100 | position j0; |
@@ -72,6 +106,17 @@ position j0; | |||
72 | } | 106 | } |
73 | }; | 107 | }; |
74 | 108 | ||
109 | @fix2_i2c_context depends on match2 && !patch && (context || org || report)@ | ||
110 | identifier match2.__driver; | ||
111 | position j0; | ||
112 | @@ | ||
113 | |||
114 | static struct i2c_driver __driver = { | ||
115 | .driver = { | ||
116 | * .owner@j0 = THIS_MODULE, | ||
117 | } | ||
118 | }; | ||
119 | |||
75 | // ---------------------------------------------------------------------------- | 120 | // ---------------------------------------------------------------------------- |
76 | 121 | ||
77 | @script:python fix1_org depends on org@ | 122 | @script:python fix1_org depends on org@ |
@@ -81,6 +126,13 @@ j0 << fix1_context.j0; | |||
81 | msg = "No need to set .owner here. The core will do it." | 126 | msg = "No need to set .owner here. The core will do it." |
82 | coccilib.org.print_todo(j0[0], msg) | 127 | coccilib.org.print_todo(j0[0], msg) |
83 | 128 | ||
129 | @script:python fix1_i2c_org depends on org@ | ||
130 | j0 << fix1_i2c_context.j0; | ||
131 | @@ | ||
132 | |||
133 | msg = "No need to set .owner here. The core will do it." | ||
134 | coccilib.org.print_todo(j0[0], msg) | ||
135 | |||
84 | @script:python fix2_org depends on org@ | 136 | @script:python fix2_org depends on org@ |
85 | j0 << fix2_context.j0; | 137 | j0 << fix2_context.j0; |
86 | @@ | 138 | @@ |
@@ -88,6 +140,13 @@ j0 << fix2_context.j0; | |||
88 | msg = "No need to set .owner here. The core will do it." | 140 | msg = "No need to set .owner here. The core will do it." |
89 | coccilib.org.print_todo(j0[0], msg) | 141 | coccilib.org.print_todo(j0[0], msg) |
90 | 142 | ||
143 | @script:python fix2_i2c_org depends on org@ | ||
144 | j0 << fix2_i2c_context.j0; | ||
145 | @@ | ||
146 | |||
147 | msg = "No need to set .owner here. The core will do it." | ||
148 | coccilib.org.print_todo(j0[0], msg) | ||
149 | |||
91 | // ---------------------------------------------------------------------------- | 150 | // ---------------------------------------------------------------------------- |
92 | 151 | ||
93 | @script:python fix1_report depends on report@ | 152 | @script:python fix1_report depends on report@ |
@@ -97,6 +156,13 @@ j0 << fix1_context.j0; | |||
97 | msg = "No need to set .owner here. The core will do it." | 156 | msg = "No need to set .owner here. The core will do it." |
98 | coccilib.report.print_report(j0[0], msg) | 157 | coccilib.report.print_report(j0[0], msg) |
99 | 158 | ||
159 | @script:python fix1_i2c_report depends on report@ | ||
160 | j0 << fix1_i2c_context.j0; | ||
161 | @@ | ||
162 | |||
163 | msg = "No need to set .owner here. The core will do it." | ||
164 | coccilib.report.print_report(j0[0], msg) | ||
165 | |||
100 | @script:python fix2_report depends on report@ | 166 | @script:python fix2_report depends on report@ |
101 | j0 << fix2_context.j0; | 167 | j0 << fix2_context.j0; |
102 | @@ | 168 | @@ |
@@ -104,3 +170,10 @@ j0 << fix2_context.j0; | |||
104 | msg = "No need to set .owner here. The core will do it." | 170 | msg = "No need to set .owner here. The core will do it." |
105 | coccilib.report.print_report(j0[0], msg) | 171 | coccilib.report.print_report(j0[0], msg) |
106 | 172 | ||
173 | @script:python fix2_i2c_report depends on report@ | ||
174 | j0 << fix2_i2c_context.j0; | ||
175 | @@ | ||
176 | |||
177 | msg = "No need to set .owner here. The core will do it." | ||
178 | coccilib.report.print_report(j0[0], msg) | ||
179 | |||
diff --git a/scripts/coccinelle/api/pm_runtime.cocci b/scripts/coccinelle/api/pm_runtime.cocci index f01789e967ec..b7042d074078 100644 --- a/scripts/coccinelle/api/pm_runtime.cocci +++ b/scripts/coccinelle/api/pm_runtime.cocci | |||
@@ -1,5 +1,5 @@ | |||
1 | /// Make sure pm_runtime_* calls does not use unnecessary IS_ERR_VALUE | 1 | /// Make sure pm_runtime_* calls does not use unnecessary IS_ERR_VALUE |
2 | // | 2 | /// |
3 | // Keywords: pm_runtime | 3 | // Keywords: pm_runtime |
4 | // Confidence: Medium | 4 | // Confidence: Medium |
5 | // Copyright (C) 2013 Texas Instruments Incorporated - GPLv2. | 5 | // Copyright (C) 2013 Texas Instruments Incorporated - GPLv2. |
diff --git a/scripts/coccinelle/api/simple_open.cocci b/scripts/coccinelle/api/simple_open.cocci index b67e174f3d95..bd1a2a4ee106 100644 --- a/scripts/coccinelle/api/simple_open.cocci +++ b/scripts/coccinelle/api/simple_open.cocci | |||
@@ -1,5 +1,5 @@ | |||
1 | /// This removes an open coded simple_open() function | 1 | /// Remove an open coded simple_open() function |
2 | /// and replaces file operations references to the function | 2 | /// and replace file operations references to the function |
3 | /// with simple_open() instead. | 3 | /// with simple_open() instead. |
4 | /// | 4 | /// |
5 | // Confidence: High | 5 | // Confidence: High |
diff --git a/scripts/coccinelle/api/vma_pages.cocci b/scripts/coccinelle/api/vma_pages.cocci new file mode 100644 index 000000000000..3e52e11ea1dc --- /dev/null +++ b/scripts/coccinelle/api/vma_pages.cocci | |||
@@ -0,0 +1,60 @@ | |||
1 | /// | ||
2 | /// Use vma_pages function on vma object instead of explicit computation. | ||
3 | /// | ||
4 | // Confidence: High | ||
5 | // Keywords: vma_pages vma | ||
6 | // Comment: Based on resource_size.cocci | ||
7 | |||
8 | virtual context | ||
9 | virtual patch | ||
10 | virtual org | ||
11 | virtual report | ||
12 | |||
13 | //---------------------------------------------------------- | ||
14 | // For context mode | ||
15 | //---------------------------------------------------------- | ||
16 | |||
17 | @r_context depends on context && !patch && !org && !report@ | ||
18 | struct vm_area_struct *vma; | ||
19 | @@ | ||
20 | |||
21 | * (vma->vm_end - vma->vm_start) >> PAGE_SHIFT | ||
22 | |||
23 | //---------------------------------------------------------- | ||
24 | // For patch mode | ||
25 | //---------------------------------------------------------- | ||
26 | |||
27 | @r_patch depends on !context && patch && !org && !report@ | ||
28 | struct vm_area_struct *vma; | ||
29 | @@ | ||
30 | |||
31 | - ((vma->vm_end - vma->vm_start) >> PAGE_SHIFT) | ||
32 | + vma_pages(vma) | ||
33 | |||
34 | //---------------------------------------------------------- | ||
35 | // For org mode | ||
36 | //---------------------------------------------------------- | ||
37 | |||
38 | @r_org depends on !context && !patch && (org || report)@ | ||
39 | struct vm_area_struct *vma; | ||
40 | position p; | ||
41 | @@ | ||
42 | |||
43 | (vma->vm_end@p - vma->vm_start) >> PAGE_SHIFT | ||
44 | |||
45 | @script:python depends on report@ | ||
46 | p << r_org.p; | ||
47 | x << r_org.vma; | ||
48 | @@ | ||
49 | |||
50 | msg="WARNING: Consider using vma_pages helper on %s" % (x) | ||
51 | coccilib.report.print_report(p[0], msg) | ||
52 | |||
53 | @script:python depends on org@ | ||
54 | p << r_org.p; | ||
55 | x << r_org.vma; | ||
56 | @@ | ||
57 | |||
58 | msg="WARNING: Consider using vma_pages helper on %s" % (x) | ||
59 | msg_safe=msg.replace("[","@(").replace("]",")") | ||
60 | coccilib.org.print_todo(p[0], msg_safe) | ||
diff --git a/scripts/coccinelle/misc/ifaddr.cocci b/scripts/coccinelle/misc/ifaddr.cocci index 8aebd1875e75..c2663c677ac1 100644 --- a/scripts/coccinelle/misc/ifaddr.cocci +++ b/scripts/coccinelle/misc/ifaddr.cocci | |||
@@ -1,5 +1,4 @@ | |||
1 | /// the address of a variable or field is non-zero is likely always to bo | 1 | /// The address of a variable or field is likely always to be non-zero. |
2 | /// non-zero | ||
3 | /// | 2 | /// |
4 | // Confidence: High | 3 | // Confidence: High |
5 | // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2. | 4 | // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2. |
diff --git a/scripts/coccinelle/misc/irqf_oneshot.cocci b/scripts/coccinelle/misc/irqf_oneshot.cocci index a24a754ae1d7..b421150a2eff 100644 --- a/scripts/coccinelle/misc/irqf_oneshot.cocci +++ b/scripts/coccinelle/misc/irqf_oneshot.cocci | |||
@@ -1,5 +1,8 @@ | |||
1 | /// Make sure threaded IRQs without a primary handler are always request with | 1 | /// Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests") |
2 | /// IRQF_ONESHOT | 2 | /// threaded IRQs without a primary handler need to be requested with |
3 | /// IRQF_ONESHOT, otherwise the request will fail. | ||
4 | /// | ||
5 | /// So pass the IRQF_ONESHOT flag in this case. | ||
3 | /// | 6 | /// |
4 | // | 7 | // |
5 | // Confidence: Good | 8 | // Confidence: Good |
diff --git a/scripts/coccinelle/misc/returnvar.cocci b/scripts/coccinelle/misc/returnvar.cocci index 605955a91c44..d8286ef5307f 100644 --- a/scripts/coccinelle/misc/returnvar.cocci +++ b/scripts/coccinelle/misc/returnvar.cocci | |||
@@ -1,5 +1,5 @@ | |||
1 | /// | 1 | /// |
2 | /// Removes unneeded variable used to store return value. | 2 | /// Remove unneeded variable used to store return value. |
3 | /// | 3 | /// |
4 | // Confidence: Moderate | 4 | // Confidence: Moderate |
5 | // Copyright: (C) 2012 Peter Senna Tschudin, INRIA/LIP6. GPLv2. | 5 | // Copyright: (C) 2012 Peter Senna Tschudin, INRIA/LIP6. GPLv2. |
diff --git a/scripts/coccinelle/misc/semicolon.cocci b/scripts/coccinelle/misc/semicolon.cocci index a47eba2edc9e..6740c659a2b3 100644 --- a/scripts/coccinelle/misc/semicolon.cocci +++ b/scripts/coccinelle/misc/semicolon.cocci | |||
@@ -1,5 +1,5 @@ | |||
1 | /// | 1 | /// |
2 | /// Removes unneeded semicolon. | 2 | /// Remove unneeded semicolon. |
3 | /// | 3 | /// |
4 | // Confidence: Moderate | 4 | // Confidence: Moderate |
5 | // Copyright: (C) 2012 Peter Senna Tschudin, INRIA/LIP6. GPLv2. | 5 | // Copyright: (C) 2012 Peter Senna Tschudin, INRIA/LIP6. GPLv2. |
diff --git a/scripts/coccinelle/misc/simple_return.cocci b/scripts/coccinelle/misc/simple_return.cocci index 47f7084b6360..e8b6313b116f 100644 --- a/scripts/coccinelle/misc/simple_return.cocci +++ b/scripts/coccinelle/misc/simple_return.cocci | |||
@@ -1,6 +1,6 @@ | |||
1 | /// Simplify a trivial if-return sequence. Possibly combine with a | 1 | /// Simplify a trivial if-return sequence. Possibly combine with a |
2 | /// preceding function call. | 2 | /// preceding function call. |
3 | // | 3 | /// |
4 | // Confidence: High | 4 | // Confidence: High |
5 | // Copyright: (C) 2014 Julia Lawall, INRIA/LIP6. GPLv2. | 5 | // Copyright: (C) 2014 Julia Lawall, INRIA/LIP6. GPLv2. |
6 | // Copyright: (C) 2014 Gilles Muller, INRIA/LiP6. GPLv2. | 6 | // Copyright: (C) 2014 Gilles Muller, INRIA/LiP6. GPLv2. |
diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh index 515c4c00e957..00d6d53c2681 100755 --- a/scripts/decode_stacktrace.sh +++ b/scripts/decode_stacktrace.sh | |||
@@ -14,11 +14,14 @@ declare -A cache | |||
14 | 14 | ||
15 | parse_symbol() { | 15 | parse_symbol() { |
16 | # The structure of symbol at this point is: | 16 | # The structure of symbol at this point is: |
17 | # [name]+[offset]/[total length] | 17 | # ([name]+[offset]/[total length]) |
18 | # | 18 | # |
19 | # For example: | 19 | # For example: |
20 | # do_basic_setup+0x9c/0xbf | 20 | # do_basic_setup+0x9c/0xbf |
21 | 21 | ||
22 | # Remove the englobing parenthesis | ||
23 | symbol=${symbol#\(} | ||
24 | symbol=${symbol%\)} | ||
22 | 25 | ||
23 | # Strip the symbol name so that we could look it up | 26 | # Strip the symbol name so that we could look it up |
24 | local name=${symbol%+*} | 27 | local name=${symbol%+*} |
diff --git a/scripts/extract-cert.c b/scripts/extract-cert.c new file mode 100644 index 000000000000..fd0db015c65c --- /dev/null +++ b/scripts/extract-cert.c | |||
@@ -0,0 +1,166 @@ | |||
1 | /* Extract X.509 certificate in DER form from PKCS#11 or PEM. | ||
2 | * | ||
3 | * Copyright © 2014 Red Hat, Inc. All Rights Reserved. | ||
4 | * Copyright © 2015 Intel Corporation. | ||
5 | * | ||
6 | * Authors: David Howells <dhowells@redhat.com> | ||
7 | * David Woodhouse <dwmw2@infradead.org> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public Licence | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the Licence, or (at your option) any later version. | ||
13 | */ | ||
14 | #define _GNU_SOURCE | ||
15 | #include <stdio.h> | ||
16 | #include <stdlib.h> | ||
17 | #include <stdint.h> | ||
18 | #include <stdbool.h> | ||
19 | #include <string.h> | ||
20 | #include <getopt.h> | ||
21 | #include <err.h> | ||
22 | #include <arpa/inet.h> | ||
23 | #include <openssl/bio.h> | ||
24 | #include <openssl/evp.h> | ||
25 | #include <openssl/pem.h> | ||
26 | #include <openssl/pkcs7.h> | ||
27 | #include <openssl/err.h> | ||
28 | #include <openssl/engine.h> | ||
29 | |||
30 | #define PKEY_ID_PKCS7 2 | ||
31 | |||
32 | static __attribute__((noreturn)) | ||
33 | void format(void) | ||
34 | { | ||
35 | fprintf(stderr, | ||
36 | "Usage: scripts/extract-cert <source> <dest>\n"); | ||
37 | exit(2); | ||
38 | } | ||
39 | |||
40 | static void display_openssl_errors(int l) | ||
41 | { | ||
42 | const char *file; | ||
43 | char buf[120]; | ||
44 | int e, line; | ||
45 | |||
46 | if (ERR_peek_error() == 0) | ||
47 | return; | ||
48 | fprintf(stderr, "At main.c:%d:\n", l); | ||
49 | |||
50 | while ((e = ERR_get_error_line(&file, &line))) { | ||
51 | ERR_error_string(e, buf); | ||
52 | fprintf(stderr, "- SSL %s: %s:%d\n", buf, file, line); | ||
53 | } | ||
54 | } | ||
55 | |||
56 | static void drain_openssl_errors(void) | ||
57 | { | ||
58 | const char *file; | ||
59 | int line; | ||
60 | |||
61 | if (ERR_peek_error() == 0) | ||
62 | return; | ||
63 | while (ERR_get_error_line(&file, &line)) {} | ||
64 | } | ||
65 | |||
66 | #define ERR(cond, fmt, ...) \ | ||
67 | do { \ | ||
68 | bool __cond = (cond); \ | ||
69 | display_openssl_errors(__LINE__); \ | ||
70 | if (__cond) { \ | ||
71 | err(1, fmt, ## __VA_ARGS__); \ | ||
72 | } \ | ||
73 | } while(0) | ||
74 | |||
75 | static const char *key_pass; | ||
76 | static BIO *wb; | ||
77 | static char *cert_dst; | ||
78 | int kbuild_verbose; | ||
79 | |||
80 | static void write_cert(X509 *x509) | ||
81 | { | ||
82 | char buf[200]; | ||
83 | |||
84 | if (!wb) { | ||
85 | wb = BIO_new_file(cert_dst, "wb"); | ||
86 | ERR(!wb, "%s", cert_dst); | ||
87 | } | ||
88 | X509_NAME_oneline(X509_get_subject_name(x509), buf, sizeof(buf)); | ||
89 | ERR(!i2d_X509_bio(wb, x509), cert_dst); | ||
90 | if (kbuild_verbose) | ||
91 | fprintf(stderr, "Extracted cert: %s\n", buf); | ||
92 | } | ||
93 | |||
94 | int main(int argc, char **argv) | ||
95 | { | ||
96 | char *cert_src; | ||
97 | |||
98 | OpenSSL_add_all_algorithms(); | ||
99 | ERR_load_crypto_strings(); | ||
100 | ERR_clear_error(); | ||
101 | |||
102 | kbuild_verbose = atoi(getenv("KBUILD_VERBOSE")?:"0"); | ||
103 | |||
104 | key_pass = getenv("KBUILD_SIGN_PIN"); | ||
105 | |||
106 | if (argc != 3) | ||
107 | format(); | ||
108 | |||
109 | cert_src = argv[1]; | ||
110 | cert_dst = argv[2]; | ||
111 | |||
112 | if (!cert_src[0]) { | ||
113 | /* Invoked with no input; create empty file */ | ||
114 | FILE *f = fopen(cert_dst, "wb"); | ||
115 | ERR(!f, "%s", cert_dst); | ||
116 | fclose(f); | ||
117 | exit(0); | ||
118 | } else if (!strncmp(cert_src, "pkcs11:", 7)) { | ||
119 | ENGINE *e; | ||
120 | struct { | ||
121 | const char *cert_id; | ||
122 | X509 *cert; | ||
123 | } parms; | ||
124 | |||
125 | parms.cert_id = cert_src; | ||
126 | parms.cert = NULL; | ||
127 | |||
128 | ENGINE_load_builtin_engines(); | ||
129 | drain_openssl_errors(); | ||
130 | e = ENGINE_by_id("pkcs11"); | ||
131 | ERR(!e, "Load PKCS#11 ENGINE"); | ||
132 | if (ENGINE_init(e)) | ||
133 | drain_openssl_errors(); | ||
134 | else | ||
135 | ERR(1, "ENGINE_init"); | ||
136 | if (key_pass) | ||
137 | ERR(!ENGINE_ctrl_cmd_string(e, "PIN", key_pass, 0), "Set PKCS#11 PIN"); | ||
138 | ENGINE_ctrl_cmd(e, "LOAD_CERT_CTRL", 0, &parms, NULL, 1); | ||
139 | ERR(!parms.cert, "Get X.509 from PKCS#11"); | ||
140 | write_cert(parms.cert); | ||
141 | } else { | ||
142 | BIO *b; | ||
143 | X509 *x509; | ||
144 | |||
145 | b = BIO_new_file(cert_src, "rb"); | ||
146 | ERR(!b, "%s", cert_src); | ||
147 | |||
148 | while (1) { | ||
149 | x509 = PEM_read_bio_X509(b, NULL, NULL, NULL); | ||
150 | if (wb && !x509) { | ||
151 | unsigned long err = ERR_peek_last_error(); | ||
152 | if (ERR_GET_LIB(err) == ERR_LIB_PEM && | ||
153 | ERR_GET_REASON(err) == PEM_R_NO_START_LINE) { | ||
154 | ERR_clear_error(); | ||
155 | break; | ||
156 | } | ||
157 | } | ||
158 | ERR(!x509, "%s", cert_src); | ||
159 | write_cert(x509); | ||
160 | } | ||
161 | } | ||
162 | |||
163 | BIO_free(wb); | ||
164 | |||
165 | return 0; | ||
166 | } | ||
diff --git a/scripts/genksyms/parse.tab.c_shipped b/scripts/genksyms/parse.tab.c_shipped index c9f0f0ce82ff..99950b5afb0d 100644 --- a/scripts/genksyms/parse.tab.c_shipped +++ b/scripts/genksyms/parse.tab.c_shipped | |||
@@ -1,4 +1,4 @@ | |||
1 | /* A Bison parser, made by GNU Bison 2.5.1. */ | 1 | /* A Bison parser, made by GNU Bison 2.7. */ |
2 | 2 | ||
3 | /* Bison implementation for Yacc-like parsers in C | 3 | /* Bison implementation for Yacc-like parsers in C |
4 | 4 | ||
@@ -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.1" | 47 | #define YYBISON_VERSION "2.7" |
48 | 48 | ||
49 | /* Skeleton name. */ | 49 | /* Skeleton name. */ |
50 | #define YYSKELETON_NAME "yacc.c" | 50 | #define YYSKELETON_NAME "yacc.c" |
@@ -58,8 +58,6 @@ | |||
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 | ||
@@ -125,11 +123,6 @@ static void record_compound(struct string_list **keyw, | |||
125 | # endif | 123 | # endif |
126 | # endif | 124 | # endif |
127 | 125 | ||
128 | /* Enabling traces. */ | ||
129 | #ifndef YYDEBUG | ||
130 | # define YYDEBUG 1 | ||
131 | #endif | ||
132 | |||
133 | /* Enabling verbose error messages. */ | 126 | /* Enabling verbose error messages. */ |
134 | #ifdef YYERROR_VERBOSE | 127 | #ifdef YYERROR_VERBOSE |
135 | # undef YYERROR_VERBOSE | 128 | # undef YYERROR_VERBOSE |
@@ -138,11 +131,14 @@ static void record_compound(struct string_list **keyw, | |||
138 | # define YYERROR_VERBOSE 0 | 131 | # define YYERROR_VERBOSE 0 |
139 | #endif | 132 | #endif |
140 | 133 | ||
141 | /* Enabling the token table. */ | ||
142 | #ifndef YYTOKEN_TABLE | ||
143 | # define YYTOKEN_TABLE 0 | ||
144 | #endif | ||
145 | 134 | ||
135 | /* Enabling traces. */ | ||
136 | #ifndef YYDEBUG | ||
137 | # define YYDEBUG 1 | ||
138 | #endif | ||
139 | #if YYDEBUG | ||
140 | extern int yydebug; | ||
141 | #endif | ||
146 | 142 | ||
147 | /* Tokens. */ | 143 | /* Tokens. */ |
148 | #ifndef YYTOKENTYPE | 144 | #ifndef YYTOKENTYPE |
@@ -196,7 +192,6 @@ static void record_compound(struct string_list **keyw, | |||
196 | #endif | 192 | #endif |
197 | 193 | ||
198 | 194 | ||
199 | |||
200 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED | 195 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
201 | typedef int YYSTYPE; | 196 | typedef int YYSTYPE; |
202 | # define YYSTYPE_IS_TRIVIAL 1 | 197 | # define YYSTYPE_IS_TRIVIAL 1 |
@@ -204,6 +199,23 @@ typedef int YYSTYPE; | |||
204 | # define YYSTYPE_IS_DECLARED 1 | 199 | # define YYSTYPE_IS_DECLARED 1 |
205 | #endif | 200 | #endif |
206 | 201 | ||
202 | extern YYSTYPE yylval; | ||
203 | |||
204 | #ifdef YYPARSE_PARAM | ||
205 | #if defined __STDC__ || defined __cplusplus | ||
206 | int yyparse (void *YYPARSE_PARAM); | ||
207 | #else | ||
208 | int yyparse (); | ||
209 | #endif | ||
210 | #else /* ! YYPARSE_PARAM */ | ||
211 | #if defined __STDC__ || defined __cplusplus | ||
212 | int yyparse (void); | ||
213 | #else | ||
214 | int yyparse (); | ||
215 | #endif | ||
216 | #endif /* ! YYPARSE_PARAM */ | ||
217 | |||
218 | |||
207 | 219 | ||
208 | /* Copy the second part of user declarations. */ | 220 | /* Copy the second part of user declarations. */ |
209 | 221 | ||
@@ -260,24 +272,24 @@ typedef short int yytype_int16; | |||
260 | # if defined YYENABLE_NLS && YYENABLE_NLS | 272 | # if defined YYENABLE_NLS && YYENABLE_NLS |
261 | # if ENABLE_NLS | 273 | # if ENABLE_NLS |
262 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ | 274 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
263 | # define YY_(msgid) dgettext ("bison-runtime", msgid) | 275 | # define YY_(Msgid) dgettext ("bison-runtime", Msgid) |
264 | # endif | 276 | # endif |
265 | # endif | 277 | # endif |
266 | # ifndef YY_ | 278 | # ifndef YY_ |
267 | # define YY_(msgid) msgid | 279 | # define YY_(Msgid) Msgid |
268 | # endif | 280 | # endif |
269 | #endif | 281 | #endif |
270 | 282 | ||
271 | /* Suppress unused-variable warnings by "using" E. */ | 283 | /* Suppress unused-variable warnings by "using" E. */ |
272 | #if ! defined lint || defined __GNUC__ | 284 | #if ! defined lint || defined __GNUC__ |
273 | # define YYUSE(e) ((void) (e)) | 285 | # define YYUSE(E) ((void) (E)) |
274 | #else | 286 | #else |
275 | # define YYUSE(e) /* empty */ | 287 | # define YYUSE(E) /* empty */ |
276 | #endif | 288 | #endif |
277 | 289 | ||
278 | /* Identity function, used to suppress warnings about constant conditions. */ | 290 | /* Identity function, used to suppress warnings about constant conditions. */ |
279 | #ifndef lint | 291 | #ifndef lint |
280 | # define YYID(n) (n) | 292 | # define YYID(N) (N) |
281 | #else | 293 | #else |
282 | #if (defined __STDC__ || defined __C99__FUNC__ \ | 294 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
283 | || defined __cplusplus || defined _MSC_VER) | 295 | || defined __cplusplus || defined _MSC_VER) |
@@ -427,16 +439,16 @@ union yyalloc | |||
427 | /* YYFINAL -- State number of the termination state. */ | 439 | /* YYFINAL -- State number of the termination state. */ |
428 | #define YYFINAL 4 | 440 | #define YYFINAL 4 |
429 | /* YYLAST -- Last index in YYTABLE. */ | 441 | /* YYLAST -- Last index in YYTABLE. */ |
430 | #define YYLAST 514 | 442 | #define YYLAST 515 |
431 | 443 | ||
432 | /* YYNTOKENS -- Number of terminals. */ | 444 | /* YYNTOKENS -- Number of terminals. */ |
433 | #define YYNTOKENS 54 | 445 | #define YYNTOKENS 54 |
434 | /* YYNNTS -- Number of nonterminals. */ | 446 | /* YYNNTS -- Number of nonterminals. */ |
435 | #define YYNNTS 49 | 447 | #define YYNNTS 49 |
436 | /* YYNRULES -- Number of rules. */ | 448 | /* YYNRULES -- Number of rules. */ |
437 | #define YYNRULES 132 | 449 | #define YYNRULES 133 |
438 | /* YYNRULES -- Number of states. */ | 450 | /* YYNRULES -- Number of states. */ |
439 | #define YYNSTATES 187 | 451 | #define YYNSTATES 188 |
440 | 452 | ||
441 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ | 453 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
442 | #define YYUNDEFTOK 2 | 454 | #define YYUNDEFTOK 2 |
@@ -492,13 +504,13 @@ static const yytype_uint16 yyprhs[] = | |||
492 | 97, 101, 105, 109, 112, 115, 118, 120, 122, 124, | 504 | 97, 101, 105, 109, 112, 115, 118, 120, 122, 124, |
493 | 126, 128, 130, 132, 134, 136, 138, 140, 143, 144, | 505 | 126, 128, 130, 132, 134, 136, 138, 140, 143, 144, |
494 | 146, 148, 151, 153, 155, 157, 159, 162, 164, 166, | 506 | 146, 148, 151, 153, 155, 157, 159, 162, 164, 166, |
495 | 171, 176, 179, 183, 187, 190, 192, 194, 196, 201, | 507 | 168, 173, 178, 181, 185, 189, 192, 194, 196, 198, |
496 | 206, 209, 213, 217, 220, 222, 226, 227, 229, 231, | 508 | 203, 208, 211, 215, 219, 222, 224, 228, 229, 231, |
497 | 235, 238, 241, 243, 244, 246, 248, 253, 258, 261, | 509 | 233, 237, 240, 243, 245, 246, 248, 250, 255, 260, |
498 | 265, 269, 273, 274, 276, 279, 283, 287, 288, 290, | 510 | 263, 267, 271, 275, 276, 278, 281, 285, 289, 290, |
499 | 292, 295, 299, 302, 303, 305, 307, 311, 314, 317, | 511 | 292, 294, 297, 301, 304, 305, 307, 309, 313, 316, |
500 | 319, 322, 323, 326, 330, 335, 337, 341, 343, 347, | 512 | 319, 321, 324, 325, 328, 332, 337, 339, 343, 345, |
501 | 350, 351, 353 | 513 | 349, 352, 353, 355 |
502 | }; | 514 | }; |
503 | 515 | ||
504 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */ | 516 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
@@ -520,26 +532,27 @@ static const yytype_int8 yyrhs[] = | |||
520 | 13, -1, 9, -1, 26, -1, 6, -1, 42, -1, | 532 | 13, -1, 9, -1, 26, -1, 6, -1, 42, -1, |
521 | 50, 72, -1, -1, 73, -1, 74, -1, 73, 74, | 533 | 50, 72, -1, -1, 73, -1, 74, -1, 73, 74, |
522 | -1, 8, -1, 27, -1, 31, -1, 18, -1, 71, | 534 | -1, 8, -1, 27, -1, 31, -1, 18, -1, 71, |
523 | 75, -1, 76, -1, 38, -1, 76, 48, 79, 49, | 535 | 75, -1, 76, -1, 38, -1, 42, -1, 76, 48, |
524 | -1, 76, 48, 1, 49, -1, 76, 34, -1, 48, | 536 | 79, 49, -1, 76, 48, 1, 49, -1, 76, 34, |
525 | 75, 49, -1, 48, 1, 49, -1, 71, 77, -1, | 537 | -1, 48, 75, 49, -1, 48, 1, 49, -1, 71, |
526 | 78, -1, 38, -1, 42, -1, 78, 48, 79, 49, | 538 | 77, -1, 78, -1, 38, -1, 42, -1, 78, 48, |
527 | -1, 78, 48, 1, 49, -1, 78, 34, -1, 48, | 539 | 79, 49, -1, 78, 48, 1, 49, -1, 78, 34, |
528 | 77, 49, -1, 48, 1, 49, -1, 80, 37, -1, | 540 | -1, 48, 77, 49, -1, 48, 1, 49, -1, 80, |
529 | 80, -1, 81, 47, 37, -1, -1, 81, -1, 82, | 541 | 37, -1, 80, -1, 81, 47, 37, -1, -1, 81, |
530 | -1, 81, 47, 82, -1, 66, 83, -1, 71, 83, | 542 | -1, 82, -1, 81, 47, 82, -1, 66, 83, -1, |
531 | -1, 84, -1, -1, 38, -1, 42, -1, 84, 48, | 543 | 71, 83, -1, 84, -1, -1, 38, -1, 42, -1, |
532 | 79, 49, -1, 84, 48, 1, 49, -1, 84, 34, | 544 | 84, 48, 79, 49, -1, 84, 48, 1, 49, -1, |
533 | -1, 48, 83, 49, -1, 48, 1, 49, -1, 65, | 545 | 84, 34, -1, 48, 83, 49, -1, 48, 1, 49, |
534 | 75, 33, -1, -1, 87, -1, 51, 35, -1, 52, | 546 | -1, 65, 75, 33, -1, -1, 87, -1, 51, 35, |
535 | 89, 46, -1, 52, 1, 46, -1, -1, 90, -1, | 547 | -1, 52, 89, 46, -1, 52, 1, 46, -1, -1, |
536 | 91, -1, 90, 91, -1, 65, 92, 45, -1, 1, | 548 | 90, -1, 91, -1, 90, 91, -1, 65, 92, 45, |
537 | 45, -1, -1, 93, -1, 94, -1, 93, 47, 94, | 549 | -1, 1, 45, -1, -1, 93, -1, 94, -1, 93, |
538 | -1, 77, 96, -1, 38, 95, -1, 95, -1, 53, | 550 | 47, 94, -1, 77, 96, -1, 38, 95, -1, 95, |
539 | 35, -1, -1, 96, 31, -1, 52, 98, 46, -1, | 551 | -1, 53, 35, -1, -1, 96, 31, -1, 52, 98, |
540 | 52, 98, 47, 46, -1, 99, -1, 98, 47, 99, | 552 | 46, -1, 52, 98, 47, 46, -1, 99, -1, 98, |
541 | -1, 38, -1, 38, 51, 35, -1, 30, 45, -1, | 553 | 47, 99, -1, 38, -1, 38, 51, 35, -1, 30, |
542 | -1, 30, -1, 29, 48, 38, 49, 45, -1 | 554 | 45, -1, -1, 30, -1, 29, 48, 38, 49, 45, |
555 | -1 | ||
543 | }; | 556 | }; |
544 | 557 | ||
545 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ | 558 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
@@ -552,17 +565,17 @@ static const yytype_uint16 yyrline[] = | |||
552 | 237, 239, 241, 246, 249, 250, 254, 255, 256, 257, | 565 | 237, 239, 241, 246, 249, 250, 254, 255, 256, 257, |
553 | 258, 259, 260, 261, 262, 263, 264, 268, 273, 274, | 566 | 258, 259, 260, 261, 262, 263, 264, 268, 273, 274, |
554 | 278, 279, 283, 283, 283, 284, 292, 293, 297, 306, | 567 | 278, 279, 283, 283, 283, 284, 292, 293, 297, 306, |
555 | 308, 310, 312, 314, 321, 322, 326, 327, 328, 330, | 568 | 315, 317, 319, 321, 323, 330, 331, 335, 336, 337, |
556 | 332, 334, 336, 341, 342, 343, 347, 348, 352, 353, | 569 | 339, 341, 343, 345, 350, 351, 352, 356, 357, 361, |
557 | 358, 363, 365, 369, 370, 378, 382, 384, 386, 388, | 570 | 362, 367, 372, 374, 378, 379, 387, 391, 393, 395, |
558 | 390, 395, 404, 405, 410, 415, 416, 420, 421, 425, | 571 | 397, 399, 404, 413, 414, 419, 424, 425, 429, 430, |
559 | 426, 430, 432, 437, 438, 442, 443, 447, 448, 449, | 572 | 434, 435, 439, 441, 446, 447, 451, 452, 456, 457, |
560 | 453, 457, 458, 462, 463, 467, 468, 471, 476, 484, | 573 | 458, 462, 466, 467, 471, 472, 476, 477, 480, 485, |
561 | 488, 489, 493 | 574 | 493, 497, 498, 502 |
562 | }; | 575 | }; |
563 | #endif | 576 | #endif |
564 | 577 | ||
565 | #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE | 578 | #if YYDEBUG || YYERROR_VERBOSE || 0 |
566 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. | 579 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
567 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ | 580 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
568 | static const char *const yytname[] = | 581 | static const char *const yytname[] = |
@@ -621,13 +634,13 @@ static const yytype_uint8 yyr1[] = | |||
621 | 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, | 634 | 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, |
622 | 70, 70, 70, 70, 70, 70, 70, 71, 72, 72, | 635 | 70, 70, 70, 70, 70, 70, 70, 71, 72, 72, |
623 | 73, 73, 74, 74, 74, 74, 75, 75, 76, 76, | 636 | 73, 73, 74, 74, 74, 74, 75, 75, 76, 76, |
624 | 76, 76, 76, 76, 77, 77, 78, 78, 78, 78, | 637 | 76, 76, 76, 76, 76, 77, 77, 78, 78, 78, |
625 | 78, 78, 78, 79, 79, 79, 80, 80, 81, 81, | 638 | 78, 78, 78, 78, 79, 79, 79, 80, 80, 81, |
626 | 82, 83, 83, 84, 84, 84, 84, 84, 84, 84, | 639 | 81, 82, 83, 83, 84, 84, 84, 84, 84, 84, |
627 | 84, 85, 86, 86, 87, 88, 88, 89, 89, 90, | 640 | 84, 84, 85, 86, 86, 87, 88, 88, 89, 89, |
628 | 90, 91, 91, 92, 92, 93, 93, 94, 94, 94, | 641 | 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, |
629 | 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, | 642 | 94, 95, 96, 96, 97, 97, 98, 98, 99, 99, |
630 | 101, 101, 102 | 643 | 100, 101, 101, 102 |
631 | }; | 644 | }; |
632 | 645 | ||
633 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ | 646 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
@@ -639,14 +652,14 @@ static const yytype_uint8 yyr2[] = | |||
639 | 1, 1, 1, 1, 1, 4, 1, 2, 2, 2, | 652 | 1, 1, 1, 1, 1, 4, 1, 2, 2, 2, |
640 | 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, | 653 | 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, |
641 | 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, | 654 | 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, |
642 | 1, 2, 1, 1, 1, 1, 2, 1, 1, 4, | 655 | 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, |
643 | 4, 2, 3, 3, 2, 1, 1, 1, 4, 4, | 656 | 4, 4, 2, 3, 3, 2, 1, 1, 1, 4, |
644 | 2, 3, 3, 2, 1, 3, 0, 1, 1, 3, | 657 | 4, 2, 3, 3, 2, 1, 3, 0, 1, 1, |
645 | 2, 2, 1, 0, 1, 1, 4, 4, 2, 3, | 658 | 3, 2, 2, 1, 0, 1, 1, 4, 4, 2, |
646 | 3, 3, 0, 1, 2, 3, 3, 0, 1, 1, | 659 | 3, 3, 3, 0, 1, 2, 3, 3, 0, 1, |
647 | 2, 3, 2, 0, 1, 1, 3, 2, 2, 1, | 660 | 1, 2, 3, 2, 0, 1, 1, 3, 2, 2, |
648 | 2, 0, 2, 3, 4, 1, 3, 1, 3, 2, | 661 | 1, 2, 0, 2, 3, 4, 1, 3, 1, 3, |
649 | 0, 1, 5 | 662 | 2, 0, 1, 5 |
650 | }; | 663 | }; |
651 | 664 | ||
652 | /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. | 665 | /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. |
@@ -660,187 +673,187 @@ static const yytype_uint8 yydefact[] = | |||
660 | 0, 0, 0, 64, 36, 56, 5, 10, 17, 23, | 673 | 0, 0, 0, 64, 36, 56, 5, 10, 17, 23, |
661 | 24, 26, 27, 33, 34, 11, 12, 13, 14, 15, | 674 | 24, 26, 27, 33, 34, 11, 12, 13, 14, 15, |
662 | 39, 0, 43, 6, 37, 0, 44, 22, 38, 45, | 675 | 39, 0, 43, 6, 37, 0, 44, 22, 38, 45, |
663 | 0, 0, 129, 68, 0, 58, 0, 18, 19, 0, | 676 | 0, 0, 130, 68, 69, 0, 58, 0, 18, 19, |
664 | 130, 67, 25, 42, 127, 0, 125, 22, 40, 0, | 677 | 0, 131, 67, 25, 42, 128, 0, 126, 22, 40, |
665 | 113, 0, 0, 109, 9, 17, 41, 93, 0, 0, | 678 | 0, 114, 0, 0, 110, 9, 17, 41, 94, 0, |
666 | 0, 0, 57, 59, 60, 16, 0, 66, 131, 101, | 679 | 0, 0, 0, 57, 59, 60, 16, 0, 66, 132, |
667 | 121, 71, 0, 0, 123, 0, 7, 112, 106, 76, | 680 | 102, 122, 72, 0, 0, 124, 0, 7, 113, 107, |
668 | 77, 0, 0, 0, 121, 75, 0, 114, 115, 119, | 681 | 77, 78, 0, 0, 0, 122, 76, 0, 115, 116, |
669 | 105, 0, 110, 130, 94, 56, 0, 93, 90, 92, | 682 | 120, 106, 0, 111, 131, 95, 56, 0, 94, 91, |
670 | 35, 0, 73, 72, 61, 20, 102, 0, 0, 84, | 683 | 93, 35, 0, 74, 73, 61, 20, 103, 0, 0, |
671 | 87, 88, 128, 124, 126, 118, 0, 76, 0, 120, | 684 | 85, 88, 89, 129, 125, 127, 119, 0, 77, 0, |
672 | 74, 117, 80, 0, 111, 0, 0, 95, 0, 91, | 685 | 121, 75, 118, 81, 0, 112, 0, 0, 96, 0, |
673 | 98, 0, 132, 122, 0, 21, 103, 70, 69, 83, | 686 | 92, 99, 0, 133, 123, 0, 21, 104, 71, 70, |
674 | 0, 82, 81, 0, 0, 116, 100, 99, 0, 0, | 687 | 84, 0, 83, 82, 0, 0, 117, 101, 100, 0, |
675 | 104, 85, 89, 79, 78, 97, 96 | 688 | 0, 105, 86, 90, 80, 79, 98, 97 |
676 | }; | 689 | }; |
677 | 690 | ||
678 | /* YYDEFGOTO[NTERM-NUM]. */ | 691 | /* YYDEFGOTO[NTERM-NUM]. */ |
679 | static const yytype_int16 yydefgoto[] = | 692 | static const yytype_int16 yydefgoto[] = |
680 | { | 693 | { |
681 | -1, 1, 2, 3, 36, 77, 57, 37, 66, 67, | 694 | -1, 1, 2, 3, 36, 78, 57, 37, 67, 68, |
682 | 68, 80, 39, 40, 41, 42, 43, 69, 92, 93, | 695 | 69, 81, 39, 40, 41, 42, 43, 70, 93, 94, |
683 | 44, 123, 71, 114, 115, 138, 139, 140, 141, 128, | 696 | 44, 124, 72, 115, 116, 139, 140, 141, 142, 129, |
684 | 129, 45, 165, 166, 56, 81, 82, 83, 116, 117, | 697 | 130, 45, 166, 167, 56, 82, 83, 84, 117, 118, |
685 | 118, 119, 136, 52, 75, 76, 46, 100, 47 | 698 | 119, 120, 137, 52, 76, 77, 46, 101, 47 |
686 | }; | 699 | }; |
687 | 700 | ||
688 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing | 701 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
689 | STATE-NUM. */ | 702 | STATE-NUM. */ |
690 | #define YYPACT_NINF -140 | 703 | #define YYPACT_NINF -92 |
691 | static const yytype_int16 yypact[] = | 704 | static const yytype_int16 yypact[] = |
692 | { | 705 | { |
693 | -140, 29, -140, 207, -140, -140, 40, -140, -140, -140, | 706 | -92, 19, -92, 208, -92, -92, 39, -92, -92, -92, |
694 | -140, -140, -27, -140, 44, -140, -140, -140, -140, -140, | 707 | -92, -92, -27, -92, 23, -92, -92, -92, -92, -92, |
695 | -140, -140, -140, -140, -22, -140, -18, -140, -140, -140, | 708 | -92, -92, -92, -92, -22, -92, 9, -92, -92, -92, |
696 | -9, 22, 28, -140, -140, -140, -140, -140, 42, 472, | 709 | -6, 16, 25, -92, -92, -92, -92, -92, 31, 473, |
697 | -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, | 710 | -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, |
698 | 46, 43, -140, -140, 47, 107, -140, 472, 47, -140, | 711 | 49, 37, -92, -92, 51, 108, -92, 473, 51, -92, |
699 | 472, 62, -140, -140, 16, -3, 57, 56, -140, 42, | 712 | 473, 59, -92, -92, -92, 12, -3, 60, 57, -92, |
700 | 35, -11, -140, -140, 53, 48, -140, 472, -140, 51, | 713 | 31, -7, 24, -92, -92, 55, 42, -92, 473, -92, |
701 | 21, 59, 157, -140, -140, 42, -140, 388, 58, 60, | 714 | 46, -21, 61, 158, -92, -92, 31, -92, 389, 71, |
702 | 70, 81, -140, -3, -140, -140, 42, -140, -140, -140, | 715 | 82, 88, 89, -92, -3, -92, -92, 31, -92, -92, |
703 | -140, -140, 253, 71, -140, -20, -140, -140, -140, 83, | 716 | -92, -92, -92, 254, 73, -92, -24, -92, -92, -92, |
704 | -140, 5, 102, 34, -140, 12, 95, 94, -140, -140, | 717 | 90, -92, 17, 75, 45, -92, 32, 96, 95, -92, |
705 | -140, 97, -140, 113, -140, -140, 2, 41, -140, 27, | 718 | -92, -92, 99, -92, 115, -92, -92, 3, 48, -92, |
706 | -140, 99, -140, -140, -140, -140, -24, 98, 101, 109, | 719 | 34, -92, 102, -92, -92, -92, -92, -11, 100, 103, |
707 | 104, -140, -140, -140, -140, -140, 105, -140, 110, -140, | 720 | 111, 104, -92, -92, -92, -92, -92, 106, -92, 113, |
708 | -140, 117, -140, 298, -140, 21, 112, -140, 120, -140, | 721 | -92, -92, 126, -92, 299, -92, -21, 121, -92, 132, |
709 | -140, 343, -140, -140, 121, -140, -140, -140, -140, -140, | 722 | -92, -92, 344, -92, -92, 125, -92, -92, -92, -92, |
710 | 434, -140, -140, 131, 137, -140, -140, -140, 138, 141, | 723 | -92, 435, -92, -92, 138, 139, -92, -92, -92, 142, |
711 | -140, -140, -140, -140, -140, -140, -140 | 724 | 143, -92, -92, -92, -92, -92, -92, -92 |
712 | }; | 725 | }; |
713 | 726 | ||
714 | /* YYPGOTO[NTERM-NUM]. */ | 727 | /* YYPGOTO[NTERM-NUM]. */ |
715 | static const yytype_int16 yypgoto[] = | 728 | static const yytype_int16 yypgoto[] = |
716 | { | 729 | { |
717 | -140, -140, 190, -140, -140, -140, -140, -45, -140, -140, | 730 | -92, -92, 192, -92, -92, -92, -92, -47, -92, -92, |
718 | 96, 1, -60, -31, -140, -140, -140, -78, -140, -140, | 731 | 97, 0, -60, -32, -92, -92, -92, -79, -92, -92, |
719 | -55, -7, -140, -92, -140, -139, -140, -140, -59, -39, | 732 | -58, -26, -92, -38, -92, -91, -92, -92, -59, -28, |
720 | -140, -140, -140, -140, -13, -140, -140, 111, -140, -140, | 733 | -92, -92, -92, -92, -20, -92, -92, 112, -92, -92, |
721 | 39, 87, 84, 147, -140, 106, -140, -140, -140 | 734 | 41, 91, 83, 149, -92, 101, -92, -92, -92 |
722 | }; | 735 | }; |
723 | 736 | ||
724 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If | 737 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
725 | positive, shift that token. If negative, reduce the rule which | 738 | positive, shift that token. If negative, reduce the rule which |
726 | number is the opposite. If YYTABLE_NINF, syntax error. */ | 739 | number is the opposite. If YYTABLE_NINF, syntax error. */ |
727 | #define YYTABLE_NINF -109 | 740 | #define YYTABLE_NINF -110 |
728 | static const yytype_int16 yytable[] = | 741 | static const yytype_int16 yytable[] = |
729 | { | 742 | { |
730 | 87, 88, 113, 156, 38, 10, 146, 163, 72, 127, | 743 | 88, 89, 114, 38, 157, 10, 59, 73, 95, 128, |
731 | 94, 50, 84, 59, 174, 20, 54, 90, 74, 148, | 744 | 85, 50, 71, 91, 75, 20, 54, 110, 147, 4, |
732 | 58, 150, 179, 101, 29, 51, 143, 164, 33, 4, | 745 | 164, 111, 144, 99, 29, 51, 100, 112, 33, 66, |
733 | 55, 70, 106, 113, 55, 113, -93, 102, 134, 60, | 746 | 55, 107, 113, 114, 79, 114, 135, -94, 87, 92, |
734 | 124, 78, 87, 147, 157, 86, 152, 110, 127, 127, | 747 | 165, 125, 60, 88, 98, 158, 53, 58, 128, 128, |
735 | 126, -93, 65, 111, 63, 65, 72, 91, 85, 109, | 748 | 63, 127, -94, 66, 64, 148, 73, 86, 102, 111, |
736 | 153, 160, 97, 110, 64, 98, 65, 53, 99, 111, | 749 | 65, 55, 66, 175, 61, 112, 153, 66, 161, 63, |
737 | 61, 65, 147, 62, 112, 161, 110, 113, 85, 124, | 750 | 62, 180, 103, 64, 149, 75, 151, 114, 86, 65, |
738 | 63, 74, 111, 157, 65, 48, 49, 158, 159, 126, | 751 | 154, 66, 162, 148, 48, 49, 125, 111, 105, 106, |
739 | 64, 65, 65, 87, 104, 105, 107, 108, 51, 55, | 752 | 158, 108, 109, 112, 88, 66, 127, 90, 66, 159, |
740 | 89, 87, 95, 96, 103, 120, 142, 130, 79, 131, | 753 | 160, 51, 88, 55, 97, 96, 104, 121, 143, 80, |
741 | 87, 182, 7, 8, 9, 10, 11, 12, 13, 132, | 754 | 150, 88, 183, 7, 8, 9, 10, 11, 12, 13, |
742 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, | 755 | 131, 15, 16, 17, 18, 19, 20, 21, 22, 23, |
743 | 133, 26, 27, 28, 29, 30, 112, 149, 33, 34, | 756 | 24, 132, 26, 27, 28, 29, 30, 133, 134, 33, |
744 | 154, 155, 107, 98, 162, -22, 169, 167, 163, 35, | 757 | 34, 155, 156, 113, 108, 99, -22, 163, 170, 168, |
745 | 168, 170, -22, -107, 171, -22, 180, -22, 121, 172, | 758 | 35, 171, 169, -22, -108, 172, -22, 164, -22, 122, |
746 | -22, 176, 7, 8, 9, 10, 11, 12, 13, 177, | 759 | 181, -22, 173, 7, 8, 9, 10, 11, 12, 13, |
747 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, | 760 | 177, 15, 16, 17, 18, 19, 20, 21, 22, 23, |
748 | 183, 26, 27, 28, 29, 30, 184, 185, 33, 34, | 761 | 24, 178, 26, 27, 28, 29, 30, 184, 185, 33, |
749 | 186, 5, 135, 122, 175, -22, 145, 73, 151, 35, | 762 | 34, 186, 187, 5, 136, 123, -22, 176, 152, 74, |
750 | 0, 0, -22, -108, 0, -22, 0, -22, 6, 0, | 763 | 35, 146, 0, -22, -109, 0, -22, 145, -22, 6, |
751 | -22, 144, 7, 8, 9, 10, 11, 12, 13, 14, | 764 | 0, -22, 0, 7, 8, 9, 10, 11, 12, 13, |
752 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, | 765 | 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, |
753 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, | 766 | 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, |
754 | 0, 0, 0, 0, 0, -22, 0, 0, 0, 35, | 767 | 34, 0, 0, 0, 0, 0, -22, 0, 0, 0, |
755 | 0, 0, -22, 0, 137, -22, 0, -22, 7, 8, | 768 | 35, 0, 0, -22, 0, 138, -22, 0, -22, 7, |
756 | 9, 10, 11, 12, 13, 0, 15, 16, 17, 18, | 769 | 8, 9, 10, 11, 12, 13, 0, 15, 16, 17, |
757 | 19, 20, 21, 22, 23, 24, 0, 26, 27, 28, | 770 | 18, 19, 20, 21, 22, 23, 24, 0, 26, 27, |
758 | 29, 30, 0, 0, 33, 34, 0, 0, 0, 0, | 771 | 28, 29, 30, 0, 0, 33, 34, 0, 0, 0, |
759 | -86, 0, 0, 0, 0, 35, 0, 0, 0, 173, | 772 | 0, -87, 0, 0, 0, 0, 35, 0, 0, 0, |
760 | 0, 0, -86, 7, 8, 9, 10, 11, 12, 13, | 773 | 174, 0, 0, -87, 7, 8, 9, 10, 11, 12, |
761 | 0, 15, 16, 17, 18, 19, 20, 21, 22, 23, | 774 | 13, 0, 15, 16, 17, 18, 19, 20, 21, 22, |
762 | 24, 0, 26, 27, 28, 29, 30, 0, 0, 33, | 775 | 23, 24, 0, 26, 27, 28, 29, 30, 0, 0, |
763 | 34, 0, 0, 0, 0, -86, 0, 0, 0, 0, | 776 | 33, 34, 0, 0, 0, 0, -87, 0, 0, 0, |
764 | 35, 0, 0, 0, 178, 0, 0, -86, 7, 8, | 777 | 0, 35, 0, 0, 0, 179, 0, 0, -87, 7, |
765 | 9, 10, 11, 12, 13, 0, 15, 16, 17, 18, | ||
766 | 19, 20, 21, 22, 23, 24, 0, 26, 27, 28, | ||
767 | 29, 30, 0, 0, 33, 34, 0, 0, 0, 0, | ||
768 | -86, 0, 0, 0, 0, 35, 0, 0, 0, 0, | ||
769 | 0, 0, -86, 7, 8, 9, 10, 11, 12, 13, | ||
770 | 0, 15, 16, 17, 18, 19, 20, 21, 22, 23, | ||
771 | 24, 0, 26, 27, 28, 29, 30, 0, 0, 33, | ||
772 | 34, 0, 0, 0, 0, 0, 124, 0, 0, 0, | ||
773 | 125, 0, 0, 0, 0, 0, 126, 0, 65, 7, | ||
774 | 8, 9, 10, 11, 12, 13, 0, 15, 16, 17, | 778 | 8, 9, 10, 11, 12, 13, 0, 15, 16, 17, |
775 | 18, 19, 20, 21, 22, 23, 24, 0, 26, 27, | 779 | 18, 19, 20, 21, 22, 23, 24, 0, 26, 27, |
776 | 28, 29, 30, 0, 0, 33, 34, 0, 0, 0, | 780 | 28, 29, 30, 0, 0, 33, 34, 0, 0, 0, |
777 | 0, 181, 0, 0, 0, 0, 35, 7, 8, 9, | 781 | 0, -87, 0, 0, 0, 0, 35, 0, 0, 0, |
778 | 10, 11, 12, 13, 0, 15, 16, 17, 18, 19, | 782 | 0, 0, 0, -87, 7, 8, 9, 10, 11, 12, |
779 | 20, 21, 22, 23, 24, 0, 26, 27, 28, 29, | 783 | 13, 0, 15, 16, 17, 18, 19, 20, 21, 22, |
780 | 30, 0, 0, 33, 34, 0, 0, 0, 0, 0, | 784 | 23, 24, 0, 26, 27, 28, 29, 30, 0, 0, |
781 | 0, 0, 0, 0, 35 | 785 | 33, 34, 0, 0, 0, 0, 0, 125, 0, 0, |
786 | 0, 126, 0, 0, 0, 0, 0, 127, 0, 66, | ||
787 | 7, 8, 9, 10, 11, 12, 13, 0, 15, 16, | ||
788 | 17, 18, 19, 20, 21, 22, 23, 24, 0, 26, | ||
789 | 27, 28, 29, 30, 0, 0, 33, 34, 0, 0, | ||
790 | 0, 0, 182, 0, 0, 0, 0, 35, 7, 8, | ||
791 | 9, 10, 11, 12, 13, 0, 15, 16, 17, 18, | ||
792 | 19, 20, 21, 22, 23, 24, 0, 26, 27, 28, | ||
793 | 29, 30, 0, 0, 33, 34, 0, 0, 0, 0, | ||
794 | 0, 0, 0, 0, 0, 35 | ||
782 | }; | 795 | }; |
783 | 796 | ||
784 | #define yypact_value_is_default(yystate) \ | 797 | #define yypact_value_is_default(Yystate) \ |
785 | ((yystate) == (-140)) | 798 | (!!((Yystate) == (-92))) |
786 | 799 | ||
787 | #define yytable_value_is_error(yytable_value) \ | 800 | #define yytable_value_is_error(Yytable_value) \ |
788 | YYID (0) | 801 | YYID (0) |
789 | 802 | ||
790 | static const yytype_int16 yycheck[] = | 803 | static const yytype_int16 yycheck[] = |
791 | { | 804 | { |
792 | 60, 60, 80, 1, 3, 8, 1, 31, 39, 87, | 805 | 60, 60, 81, 3, 1, 8, 26, 39, 66, 88, |
793 | 65, 38, 57, 26, 153, 18, 38, 1, 38, 111, | 806 | 57, 38, 38, 1, 38, 18, 38, 38, 1, 0, |
794 | 38, 113, 161, 34, 27, 52, 46, 51, 31, 0, | 807 | 31, 42, 46, 30, 27, 52, 33, 48, 31, 50, |
795 | 52, 38, 77, 111, 52, 113, 34, 48, 93, 48, | 808 | 52, 78, 53, 112, 54, 114, 94, 34, 58, 65, |
796 | 38, 54, 102, 38, 42, 58, 34, 42, 126, 127, | 809 | 51, 38, 48, 103, 70, 42, 23, 38, 127, 128, |
797 | 48, 49, 50, 48, 38, 50, 87, 64, 57, 38, | 810 | 38, 48, 49, 50, 42, 38, 88, 57, 34, 42, |
798 | 48, 34, 69, 42, 48, 30, 50, 23, 33, 48, | 811 | 48, 52, 50, 154, 48, 48, 34, 50, 34, 38, |
799 | 48, 50, 38, 45, 53, 48, 42, 155, 77, 38, | 812 | 45, 162, 48, 42, 112, 38, 114, 156, 78, 48, |
800 | 38, 38, 48, 42, 50, 45, 46, 126, 127, 48, | 813 | 48, 50, 48, 38, 45, 46, 38, 42, 46, 47, |
801 | 48, 50, 50, 153, 46, 47, 45, 46, 52, 52, | 814 | 42, 45, 46, 48, 154, 50, 48, 38, 50, 127, |
802 | 38, 161, 45, 47, 51, 46, 35, 49, 1, 49, | 815 | 128, 52, 162, 52, 47, 45, 51, 46, 35, 1, |
803 | 170, 170, 5, 6, 7, 8, 9, 10, 11, 49, | 816 | 35, 171, 171, 5, 6, 7, 8, 9, 10, 11, |
804 | 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, | 817 | 49, 13, 14, 15, 16, 17, 18, 19, 20, 21, |
805 | 49, 24, 25, 26, 27, 28, 53, 35, 31, 32, | 818 | 22, 49, 24, 25, 26, 27, 28, 49, 49, 31, |
806 | 45, 47, 45, 30, 45, 38, 37, 49, 31, 42, | 819 | 32, 45, 47, 53, 45, 30, 38, 45, 37, 49, |
807 | 49, 47, 45, 46, 49, 48, 35, 50, 1, 49, | 820 | 42, 47, 49, 45, 46, 49, 48, 31, 50, 1, |
808 | 53, 49, 5, 6, 7, 8, 9, 10, 11, 49, | 821 | 35, 53, 49, 5, 6, 7, 8, 9, 10, 11, |
809 | 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, | 822 | 49, 13, 14, 15, 16, 17, 18, 19, 20, 21, |
810 | 49, 24, 25, 26, 27, 28, 49, 49, 31, 32, | 823 | 22, 49, 24, 25, 26, 27, 28, 49, 49, 31, |
811 | 49, 1, 96, 82, 155, 38, 109, 50, 114, 42, | 824 | 32, 49, 49, 1, 97, 83, 38, 156, 115, 50, |
812 | -1, -1, 45, 46, -1, 48, -1, 50, 1, -1, | 825 | 42, 110, -1, 45, 46, -1, 48, 106, 50, 1, |
813 | 53, 105, 5, 6, 7, 8, 9, 10, 11, 12, | 826 | -1, 53, -1, 5, 6, 7, 8, 9, 10, 11, |
814 | 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, | 827 | 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, |
815 | 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, | 828 | 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, |
816 | -1, -1, -1, -1, -1, 38, -1, -1, -1, 42, | ||
817 | -1, -1, 45, -1, 1, 48, -1, 50, 5, 6, | ||
818 | 7, 8, 9, 10, 11, -1, 13, 14, 15, 16, | ||
819 | 17, 18, 19, 20, 21, 22, -1, 24, 25, 26, | ||
820 | 27, 28, -1, -1, 31, 32, -1, -1, -1, -1, | ||
821 | 37, -1, -1, -1, -1, 42, -1, -1, -1, 1, | ||
822 | -1, -1, 49, 5, 6, 7, 8, 9, 10, 11, | ||
823 | -1, 13, 14, 15, 16, 17, 18, 19, 20, 21, | ||
824 | 22, -1, 24, 25, 26, 27, 28, -1, -1, 31, | ||
825 | 32, -1, -1, -1, -1, 37, -1, -1, -1, -1, | ||
826 | 42, -1, -1, -1, 1, -1, -1, 49, 5, 6, | ||
827 | 7, 8, 9, 10, 11, -1, 13, 14, 15, 16, | ||
828 | 17, 18, 19, 20, 21, 22, -1, 24, 25, 26, | ||
829 | 27, 28, -1, -1, 31, 32, -1, -1, -1, -1, | ||
830 | 37, -1, -1, -1, -1, 42, -1, -1, -1, -1, | ||
831 | -1, -1, 49, 5, 6, 7, 8, 9, 10, 11, | ||
832 | -1, 13, 14, 15, 16, 17, 18, 19, 20, 21, | ||
833 | 22, -1, 24, 25, 26, 27, 28, -1, -1, 31, | ||
834 | 32, -1, -1, -1, -1, -1, 38, -1, -1, -1, | 829 | 32, -1, -1, -1, -1, -1, 38, -1, -1, -1, |
835 | 42, -1, -1, -1, -1, -1, 48, -1, 50, 5, | 830 | 42, -1, -1, 45, -1, 1, 48, -1, 50, 5, |
836 | 6, 7, 8, 9, 10, 11, -1, 13, 14, 15, | 831 | 6, 7, 8, 9, 10, 11, -1, 13, 14, 15, |
837 | 16, 17, 18, 19, 20, 21, 22, -1, 24, 25, | 832 | 16, 17, 18, 19, 20, 21, 22, -1, 24, 25, |
838 | 26, 27, 28, -1, -1, 31, 32, -1, -1, -1, | 833 | 26, 27, 28, -1, -1, 31, 32, -1, -1, -1, |
839 | -1, 37, -1, -1, -1, -1, 42, 5, 6, 7, | 834 | -1, 37, -1, -1, -1, -1, 42, -1, -1, -1, |
840 | 8, 9, 10, 11, -1, 13, 14, 15, 16, 17, | 835 | 1, -1, -1, 49, 5, 6, 7, 8, 9, 10, |
841 | 18, 19, 20, 21, 22, -1, 24, 25, 26, 27, | 836 | 11, -1, 13, 14, 15, 16, 17, 18, 19, 20, |
842 | 28, -1, -1, 31, 32, -1, -1, -1, -1, -1, | 837 | 21, 22, -1, 24, 25, 26, 27, 28, -1, -1, |
843 | -1, -1, -1, -1, 42 | 838 | 31, 32, -1, -1, -1, -1, 37, -1, -1, -1, |
839 | -1, 42, -1, -1, -1, 1, -1, -1, 49, 5, | ||
840 | 6, 7, 8, 9, 10, 11, -1, 13, 14, 15, | ||
841 | 16, 17, 18, 19, 20, 21, 22, -1, 24, 25, | ||
842 | 26, 27, 28, -1, -1, 31, 32, -1, -1, -1, | ||
843 | -1, 37, -1, -1, -1, -1, 42, -1, -1, -1, | ||
844 | -1, -1, -1, 49, 5, 6, 7, 8, 9, 10, | ||
845 | 11, -1, 13, 14, 15, 16, 17, 18, 19, 20, | ||
846 | 21, 22, -1, 24, 25, 26, 27, 28, -1, -1, | ||
847 | 31, 32, -1, -1, -1, -1, -1, 38, -1, -1, | ||
848 | -1, 42, -1, -1, -1, -1, -1, 48, -1, 50, | ||
849 | 5, 6, 7, 8, 9, 10, 11, -1, 13, 14, | ||
850 | 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, | ||
851 | 25, 26, 27, 28, -1, -1, 31, 32, -1, -1, | ||
852 | -1, -1, 37, -1, -1, -1, -1, 42, 5, 6, | ||
853 | 7, 8, 9, 10, 11, -1, 13, 14, 15, 16, | ||
854 | 17, 18, 19, 20, 21, 22, -1, 24, 25, 26, | ||
855 | 27, 28, -1, -1, 31, 32, -1, -1, -1, -1, | ||
856 | -1, -1, -1, -1, -1, 42 | ||
844 | }; | 857 | }; |
845 | 858 | ||
846 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing | 859 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
@@ -853,19 +866,19 @@ static const yytype_uint8 yystos[] = | |||
853 | 28, 29, 30, 31, 32, 42, 58, 61, 65, 66, | 866 | 28, 29, 30, 31, 32, 42, 58, 61, 65, 66, |
854 | 67, 68, 69, 70, 74, 85, 100, 102, 45, 46, | 867 | 67, 68, 69, 70, 74, 85, 100, 102, 45, 46, |
855 | 38, 52, 97, 23, 38, 52, 88, 60, 38, 88, | 868 | 38, 52, 97, 23, 38, 52, 88, 60, 38, 88, |
856 | 48, 48, 45, 38, 48, 50, 62, 63, 64, 71, | 869 | 48, 48, 45, 38, 42, 48, 50, 62, 63, 64, |
857 | 75, 76, 67, 97, 38, 98, 99, 59, 88, 1, | 870 | 71, 75, 76, 67, 97, 38, 98, 99, 59, 88, |
858 | 65, 89, 90, 91, 61, 65, 88, 66, 82, 38, | 871 | 1, 65, 89, 90, 91, 61, 65, 88, 66, 82, |
859 | 1, 75, 72, 73, 74, 45, 47, 75, 30, 33, | 872 | 38, 1, 75, 72, 73, 74, 45, 47, 75, 30, |
860 | 101, 34, 48, 51, 46, 47, 61, 45, 46, 38, | 873 | 33, 101, 34, 48, 51, 46, 47, 61, 45, 46, |
861 | 42, 48, 53, 71, 77, 78, 92, 93, 94, 95, | 874 | 38, 42, 48, 53, 71, 77, 78, 92, 93, 94, |
862 | 46, 1, 91, 75, 38, 42, 48, 71, 83, 84, | 875 | 95, 46, 1, 91, 75, 38, 42, 48, 71, 83, |
863 | 49, 49, 49, 49, 74, 64, 96, 1, 79, 80, | 876 | 84, 49, 49, 49, 49, 74, 64, 96, 1, 79, |
864 | 81, 82, 35, 46, 99, 95, 1, 38, 77, 35, | 877 | 80, 81, 82, 35, 46, 99, 95, 1, 38, 77, |
865 | 77, 96, 34, 48, 45, 47, 1, 42, 83, 83, | 878 | 35, 77, 96, 34, 48, 45, 47, 1, 42, 83, |
866 | 34, 48, 45, 31, 51, 86, 87, 49, 49, 37, | 879 | 83, 34, 48, 45, 31, 51, 86, 87, 49, 49, |
867 | 47, 49, 49, 1, 79, 94, 49, 49, 1, 79, | 880 | 37, 47, 49, 49, 1, 79, 94, 49, 49, 1, |
868 | 35, 37, 82, 49, 49, 49, 49 | 881 | 79, 35, 37, 82, 49, 49, 49, 49 |
869 | }; | 882 | }; |
870 | 883 | ||
871 | #define yyerrok (yyerrstatus = 0) | 884 | #define yyerrok (yyerrstatus = 0) |
@@ -912,46 +925,18 @@ do \ | |||
912 | } \ | 925 | } \ |
913 | while (YYID (0)) | 926 | while (YYID (0)) |
914 | 927 | ||
915 | 928 | /* Error token number */ | |
916 | #define YYTERROR 1 | 929 | #define YYTERROR 1 |
917 | #define YYERRCODE 256 | 930 | #define YYERRCODE 256 |
918 | 931 | ||
919 | 932 | ||
920 | /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. | ||
921 | If N is 0, then set CURRENT to the empty location which ends | ||
922 | the previous symbol: RHS[0] (always defined). */ | ||
923 | |||
924 | #define YYRHSLOC(Rhs, K) ((Rhs)[K]) | ||
925 | #ifndef YYLLOC_DEFAULT | ||
926 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ | ||
927 | do \ | ||
928 | if (YYID (N)) \ | ||
929 | { \ | ||
930 | (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ | ||
931 | (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ | ||
932 | (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ | ||
933 | (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ | ||
934 | } \ | ||
935 | else \ | ||
936 | { \ | ||
937 | (Current).first_line = (Current).last_line = \ | ||
938 | YYRHSLOC (Rhs, 0).last_line; \ | ||
939 | (Current).first_column = (Current).last_column = \ | ||
940 | YYRHSLOC (Rhs, 0).last_column; \ | ||
941 | } \ | ||
942 | while (YYID (0)) | ||
943 | #endif | ||
944 | |||
945 | |||
946 | /* This macro is provided for backward compatibility. */ | 933 | /* This macro is provided for backward compatibility. */ |
947 | |||
948 | #ifndef YY_LOCATION_PRINT | 934 | #ifndef YY_LOCATION_PRINT |
949 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) | 935 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
950 | #endif | 936 | #endif |
951 | 937 | ||
952 | 938 | ||
953 | /* YYLEX -- calling `yylex' with the right arguments. */ | 939 | /* YYLEX -- calling `yylex' with the right arguments. */ |
954 | |||
955 | #ifdef YYLEX_PARAM | 940 | #ifdef YYLEX_PARAM |
956 | # define YYLEX yylex (YYLEX_PARAM) | 941 | # define YYLEX yylex (YYLEX_PARAM) |
957 | #else | 942 | #else |
@@ -1014,7 +999,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) | |||
1014 | switch (yytype) | 999 | switch (yytype) |
1015 | { | 1000 | { |
1016 | default: | 1001 | default: |
1017 | break; | 1002 | break; |
1018 | } | 1003 | } |
1019 | } | 1004 | } |
1020 | 1005 | ||
@@ -1256,7 +1241,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | |||
1256 | { | 1241 | { |
1257 | YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); | 1242 | YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); |
1258 | YYSIZE_T yysize = yysize0; | 1243 | YYSIZE_T yysize = yysize0; |
1259 | YYSIZE_T yysize1; | ||
1260 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; | 1244 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
1261 | /* Internationalized format string. */ | 1245 | /* Internationalized format string. */ |
1262 | const char *yyformat = YY_NULL; | 1246 | const char *yyformat = YY_NULL; |
@@ -1319,11 +1303,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | |||
1319 | break; | 1303 | break; |
1320 | } | 1304 | } |
1321 | yyarg[yycount++] = yytname[yyx]; | 1305 | yyarg[yycount++] = yytname[yyx]; |
1322 | yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); | 1306 | { |
1323 | if (! (yysize <= yysize1 | 1307 | YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); |
1324 | && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | 1308 | if (! (yysize <= yysize1 |
1325 | return 2; | 1309 | && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
1326 | yysize = yysize1; | 1310 | return 2; |
1311 | yysize = yysize1; | ||
1312 | } | ||
1327 | } | 1313 | } |
1328 | } | 1314 | } |
1329 | } | 1315 | } |
@@ -1343,10 +1329,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | |||
1343 | # undef YYCASE_ | 1329 | # undef YYCASE_ |
1344 | } | 1330 | } |
1345 | 1331 | ||
1346 | yysize1 = yysize + yystrlen (yyformat); | 1332 | { |
1347 | if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | 1333 | YYSIZE_T yysize1 = yysize + yystrlen (yyformat); |
1348 | return 2; | 1334 | if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
1349 | yysize = yysize1; | 1335 | return 2; |
1336 | yysize = yysize1; | ||
1337 | } | ||
1350 | 1338 | ||
1351 | if (*yymsg_alloc < yysize) | 1339 | if (*yymsg_alloc < yysize) |
1352 | { | 1340 | { |
@@ -1406,32 +1394,27 @@ yydestruct (yymsg, yytype, yyvaluep) | |||
1406 | { | 1394 | { |
1407 | 1395 | ||
1408 | default: | 1396 | default: |
1409 | break; | 1397 | break; |
1410 | } | 1398 | } |
1411 | } | 1399 | } |
1412 | 1400 | ||
1413 | 1401 | ||
1414 | /* Prevent warnings from -Wmissing-prototypes. */ | ||
1415 | #ifdef YYPARSE_PARAM | ||
1416 | #if defined __STDC__ || defined __cplusplus | ||
1417 | int yyparse (void *YYPARSE_PARAM); | ||
1418 | #else | ||
1419 | int yyparse (); | ||
1420 | #endif | ||
1421 | #else /* ! YYPARSE_PARAM */ | ||
1422 | #if defined __STDC__ || defined __cplusplus | ||
1423 | int yyparse (void); | ||
1424 | #else | ||
1425 | int yyparse (); | ||
1426 | #endif | ||
1427 | #endif /* ! YYPARSE_PARAM */ | ||
1428 | 1402 | ||
1429 | 1403 | ||
1430 | /* The lookahead symbol. */ | 1404 | /* The lookahead symbol. */ |
1431 | int yychar; | 1405 | int yychar; |
1432 | 1406 | ||
1407 | |||
1408 | #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | ||
1409 | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | ||
1410 | # define YY_IGNORE_MAYBE_UNINITIALIZED_END | ||
1411 | #endif | ||
1412 | #ifndef YY_INITIAL_VALUE | ||
1413 | # define YY_INITIAL_VALUE(Value) /* Nothing. */ | ||
1414 | #endif | ||
1415 | |||
1433 | /* The semantic value of the lookahead symbol. */ | 1416 | /* The semantic value of the lookahead symbol. */ |
1434 | YYSTYPE yylval; | 1417 | YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); |
1435 | 1418 | ||
1436 | /* Number of syntax errors so far. */ | 1419 | /* Number of syntax errors so far. */ |
1437 | int yynerrs; | 1420 | int yynerrs; |
@@ -1489,7 +1472,7 @@ yyparse () | |||
1489 | int yyn; | 1472 | int yyn; |
1490 | int yyresult; | 1473 | int yyresult; |
1491 | /* Lookahead token as an internal (translated) token number. */ | 1474 | /* Lookahead token as an internal (translated) token number. */ |
1492 | int yytoken; | 1475 | int yytoken = 0; |
1493 | /* The variables used to return semantic value and location from the | 1476 | /* The variables used to return semantic value and location from the |
1494 | action routines. */ | 1477 | action routines. */ |
1495 | YYSTYPE yyval; | 1478 | YYSTYPE yyval; |
@@ -1507,9 +1490,8 @@ yyparse () | |||
1507 | Keep to zero when no symbol should be popped. */ | 1490 | Keep to zero when no symbol should be popped. */ |
1508 | int yylen = 0; | 1491 | int yylen = 0; |
1509 | 1492 | ||
1510 | yytoken = 0; | 1493 | yyssp = yyss = yyssa; |
1511 | yyss = yyssa; | 1494 | yyvsp = yyvs = yyvsa; |
1512 | yyvs = yyvsa; | ||
1513 | yystacksize = YYINITDEPTH; | 1495 | yystacksize = YYINITDEPTH; |
1514 | 1496 | ||
1515 | YYDPRINTF ((stderr, "Starting parse\n")); | 1497 | YYDPRINTF ((stderr, "Starting parse\n")); |
@@ -1518,14 +1500,6 @@ yyparse () | |||
1518 | yyerrstatus = 0; | 1500 | yyerrstatus = 0; |
1519 | yynerrs = 0; | 1501 | yynerrs = 0; |
1520 | yychar = YYEMPTY; /* Cause a token to be read. */ | 1502 | yychar = YYEMPTY; /* Cause a token to be read. */ |
1521 | |||
1522 | /* Initialize stack pointers. | ||
1523 | Waste one element of value and location stack | ||
1524 | so that they stay on the same level as the state stack. | ||
1525 | The wasted elements are never initialized. */ | ||
1526 | yyssp = yyss; | ||
1527 | yyvsp = yyvs; | ||
1528 | |||
1529 | goto yysetstate; | 1503 | goto yysetstate; |
1530 | 1504 | ||
1531 | /*------------------------------------------------------------. | 1505 | /*------------------------------------------------------------. |
@@ -1666,7 +1640,9 @@ yybackup: | |||
1666 | yychar = YYEMPTY; | 1640 | yychar = YYEMPTY; |
1667 | 1641 | ||
1668 | yystate = yyn; | 1642 | yystate = yyn; |
1643 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | ||
1669 | *++yyvsp = yylval; | 1644 | *++yyvsp = yylval; |
1645 | YY_IGNORE_MAYBE_UNINITIALIZED_END | ||
1670 | 1646 | ||
1671 | goto yynewstate; | 1647 | goto yynewstate; |
1672 | 1648 | ||
@@ -1916,7 +1892,14 @@ yyreduce: | |||
1916 | 1892 | ||
1917 | case 69: | 1893 | case 69: |
1918 | 1894 | ||
1919 | { (yyval) = (yyvsp[(4) - (4)]); } | 1895 | { if (current_name != NULL) { |
1896 | error_with_pos("unexpected second declaration name"); | ||
1897 | YYERROR; | ||
1898 | } else { | ||
1899 | current_name = (*(yyvsp[(1) - (1)]))->string; | ||
1900 | (yyval) = (yyvsp[(1) - (1)]); | ||
1901 | } | ||
1902 | } | ||
1920 | break; | 1903 | break; |
1921 | 1904 | ||
1922 | case 70: | 1905 | case 70: |
@@ -1926,12 +1909,12 @@ yyreduce: | |||
1926 | 1909 | ||
1927 | case 71: | 1910 | case 71: |
1928 | 1911 | ||
1929 | { (yyval) = (yyvsp[(2) - (2)]); } | 1912 | { (yyval) = (yyvsp[(4) - (4)]); } |
1930 | break; | 1913 | break; |
1931 | 1914 | ||
1932 | case 72: | 1915 | case 72: |
1933 | 1916 | ||
1934 | { (yyval) = (yyvsp[(3) - (3)]); } | 1917 | { (yyval) = (yyvsp[(2) - (2)]); } |
1935 | break; | 1918 | break; |
1936 | 1919 | ||
1937 | case 73: | 1920 | case 73: |
@@ -1941,12 +1924,12 @@ yyreduce: | |||
1941 | 1924 | ||
1942 | case 74: | 1925 | case 74: |
1943 | 1926 | ||
1944 | { (yyval) = (yyvsp[(2) - (2)]); } | 1927 | { (yyval) = (yyvsp[(3) - (3)]); } |
1945 | break; | 1928 | break; |
1946 | 1929 | ||
1947 | case 78: | 1930 | case 75: |
1948 | 1931 | ||
1949 | { (yyval) = (yyvsp[(4) - (4)]); } | 1932 | { (yyval) = (yyvsp[(2) - (2)]); } |
1950 | break; | 1933 | break; |
1951 | 1934 | ||
1952 | case 79: | 1935 | case 79: |
@@ -1956,12 +1939,12 @@ yyreduce: | |||
1956 | 1939 | ||
1957 | case 80: | 1940 | case 80: |
1958 | 1941 | ||
1959 | { (yyval) = (yyvsp[(2) - (2)]); } | 1942 | { (yyval) = (yyvsp[(4) - (4)]); } |
1960 | break; | 1943 | break; |
1961 | 1944 | ||
1962 | case 81: | 1945 | case 81: |
1963 | 1946 | ||
1964 | { (yyval) = (yyvsp[(3) - (3)]); } | 1947 | { (yyval) = (yyvsp[(2) - (2)]); } |
1965 | break; | 1948 | break; |
1966 | 1949 | ||
1967 | case 82: | 1950 | case 82: |
@@ -1971,40 +1954,45 @@ yyreduce: | |||
1971 | 1954 | ||
1972 | case 83: | 1955 | case 83: |
1973 | 1956 | ||
1957 | { (yyval) = (yyvsp[(3) - (3)]); } | ||
1958 | break; | ||
1959 | |||
1960 | case 84: | ||
1961 | |||
1974 | { (yyval) = (yyvsp[(2) - (2)]); } | 1962 | { (yyval) = (yyvsp[(2) - (2)]); } |
1975 | break; | 1963 | break; |
1976 | 1964 | ||
1977 | case 85: | 1965 | case 86: |
1978 | 1966 | ||
1979 | { (yyval) = (yyvsp[(3) - (3)]); } | 1967 | { (yyval) = (yyvsp[(3) - (3)]); } |
1980 | break; | 1968 | break; |
1981 | 1969 | ||
1982 | case 86: | 1970 | case 87: |
1983 | 1971 | ||
1984 | { (yyval) = NULL; } | 1972 | { (yyval) = NULL; } |
1985 | break; | 1973 | break; |
1986 | 1974 | ||
1987 | case 89: | 1975 | case 90: |
1988 | 1976 | ||
1989 | { (yyval) = (yyvsp[(3) - (3)]); } | 1977 | { (yyval) = (yyvsp[(3) - (3)]); } |
1990 | break; | 1978 | break; |
1991 | 1979 | ||
1992 | case 90: | 1980 | case 91: |
1993 | 1981 | ||
1994 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); } | 1982 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); } |
1995 | break; | 1983 | break; |
1996 | 1984 | ||
1997 | case 91: | 1985 | case 92: |
1998 | 1986 | ||
1999 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); } | 1987 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); } |
2000 | break; | 1988 | break; |
2001 | 1989 | ||
2002 | case 93: | 1990 | case 94: |
2003 | 1991 | ||
2004 | { (yyval) = NULL; } | 1992 | { (yyval) = NULL; } |
2005 | break; | 1993 | break; |
2006 | 1994 | ||
2007 | case 94: | 1995 | case 95: |
2008 | 1996 | ||
2009 | { /* For version 2 checksums, we don't want to remember | 1997 | { /* For version 2 checksums, we don't want to remember |
2010 | private parameter names. */ | 1998 | private parameter names. */ |
@@ -2013,39 +2001,39 @@ yyreduce: | |||
2013 | } | 2001 | } |
2014 | break; | 2002 | break; |
2015 | 2003 | ||
2016 | case 95: | 2004 | case 96: |
2017 | 2005 | ||
2018 | { remove_node((yyvsp[(1) - (1)])); | 2006 | { remove_node((yyvsp[(1) - (1)])); |
2019 | (yyval) = (yyvsp[(1) - (1)]); | 2007 | (yyval) = (yyvsp[(1) - (1)]); |
2020 | } | 2008 | } |
2021 | break; | 2009 | break; |
2022 | 2010 | ||
2023 | case 96: | 2011 | case 97: |
2024 | 2012 | ||
2025 | { (yyval) = (yyvsp[(4) - (4)]); } | 2013 | { (yyval) = (yyvsp[(4) - (4)]); } |
2026 | break; | 2014 | break; |
2027 | 2015 | ||
2028 | case 97: | 2016 | case 98: |
2029 | 2017 | ||
2030 | { (yyval) = (yyvsp[(4) - (4)]); } | 2018 | { (yyval) = (yyvsp[(4) - (4)]); } |
2031 | break; | 2019 | break; |
2032 | 2020 | ||
2033 | case 98: | 2021 | case 99: |
2034 | 2022 | ||
2035 | { (yyval) = (yyvsp[(2) - (2)]); } | 2023 | { (yyval) = (yyvsp[(2) - (2)]); } |
2036 | break; | 2024 | break; |
2037 | 2025 | ||
2038 | case 99: | 2026 | case 100: |
2039 | 2027 | ||
2040 | { (yyval) = (yyvsp[(3) - (3)]); } | 2028 | { (yyval) = (yyvsp[(3) - (3)]); } |
2041 | break; | 2029 | break; |
2042 | 2030 | ||
2043 | case 100: | 2031 | case 101: |
2044 | 2032 | ||
2045 | { (yyval) = (yyvsp[(3) - (3)]); } | 2033 | { (yyval) = (yyvsp[(3) - (3)]); } |
2046 | break; | 2034 | break; |
2047 | 2035 | ||
2048 | case 101: | 2036 | case 102: |
2049 | 2037 | ||
2050 | { struct string_list *decl = *(yyvsp[(2) - (3)]); | 2038 | { struct string_list *decl = *(yyvsp[(2) - (3)]); |
2051 | *(yyvsp[(2) - (3)]) = NULL; | 2039 | *(yyvsp[(2) - (3)]) = NULL; |
@@ -2054,87 +2042,87 @@ yyreduce: | |||
2054 | } | 2042 | } |
2055 | break; | 2043 | break; |
2056 | 2044 | ||
2057 | case 102: | 2045 | case 103: |
2058 | 2046 | ||
2059 | { (yyval) = NULL; } | 2047 | { (yyval) = NULL; } |
2060 | break; | 2048 | break; |
2061 | 2049 | ||
2062 | case 104: | 2050 | case 105: |
2063 | 2051 | ||
2064 | { remove_list((yyvsp[(2) - (2)]), &(*(yyvsp[(1) - (2)]))->next); (yyval) = (yyvsp[(2) - (2)]); } | 2052 | { remove_list((yyvsp[(2) - (2)]), &(*(yyvsp[(1) - (2)]))->next); (yyval) = (yyvsp[(2) - (2)]); } |
2065 | break; | 2053 | break; |
2066 | 2054 | ||
2067 | case 105: | 2055 | case 106: |
2068 | 2056 | ||
2069 | { (yyval) = (yyvsp[(3) - (3)]); } | 2057 | { (yyval) = (yyvsp[(3) - (3)]); } |
2070 | break; | 2058 | break; |
2071 | 2059 | ||
2072 | case 106: | 2060 | case 107: |
2073 | 2061 | ||
2074 | { (yyval) = (yyvsp[(3) - (3)]); } | 2062 | { (yyval) = (yyvsp[(3) - (3)]); } |
2075 | break; | 2063 | break; |
2076 | 2064 | ||
2077 | case 107: | 2065 | case 108: |
2078 | 2066 | ||
2079 | { (yyval) = NULL; } | 2067 | { (yyval) = NULL; } |
2080 | break; | 2068 | break; |
2081 | 2069 | ||
2082 | case 110: | 2070 | case 111: |
2083 | 2071 | ||
2084 | { (yyval) = (yyvsp[(2) - (2)]); } | 2072 | { (yyval) = (yyvsp[(2) - (2)]); } |
2085 | break; | 2073 | break; |
2086 | 2074 | ||
2087 | case 111: | 2075 | case 112: |
2088 | 2076 | ||
2089 | { (yyval) = (yyvsp[(3) - (3)]); } | 2077 | { (yyval) = (yyvsp[(3) - (3)]); } |
2090 | break; | 2078 | break; |
2091 | 2079 | ||
2092 | case 112: | 2080 | case 113: |
2093 | 2081 | ||
2094 | { (yyval) = (yyvsp[(2) - (2)]); } | 2082 | { (yyval) = (yyvsp[(2) - (2)]); } |
2095 | break; | 2083 | break; |
2096 | 2084 | ||
2097 | case 113: | 2085 | case 114: |
2098 | 2086 | ||
2099 | { (yyval) = NULL; } | 2087 | { (yyval) = NULL; } |
2100 | break; | 2088 | break; |
2101 | 2089 | ||
2102 | case 116: | 2090 | case 117: |
2103 | 2091 | ||
2104 | { (yyval) = (yyvsp[(3) - (3)]); } | 2092 | { (yyval) = (yyvsp[(3) - (3)]); } |
2105 | break; | 2093 | break; |
2106 | 2094 | ||
2107 | case 117: | 2095 | case 118: |
2108 | 2096 | ||
2109 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); } | 2097 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); } |
2110 | break; | 2098 | break; |
2111 | 2099 | ||
2112 | case 118: | 2100 | case 119: |
2113 | 2101 | ||
2114 | { (yyval) = (yyvsp[(2) - (2)]); } | 2102 | { (yyval) = (yyvsp[(2) - (2)]); } |
2115 | break; | 2103 | break; |
2116 | 2104 | ||
2117 | case 120: | 2105 | case 121: |
2118 | 2106 | ||
2119 | { (yyval) = (yyvsp[(2) - (2)]); } | 2107 | { (yyval) = (yyvsp[(2) - (2)]); } |
2120 | break; | 2108 | break; |
2121 | 2109 | ||
2122 | case 121: | 2110 | case 122: |
2123 | 2111 | ||
2124 | { (yyval) = NULL; } | 2112 | { (yyval) = NULL; } |
2125 | break; | 2113 | break; |
2126 | 2114 | ||
2127 | case 123: | 2115 | case 124: |
2128 | 2116 | ||
2129 | { (yyval) = (yyvsp[(3) - (3)]); } | 2117 | { (yyval) = (yyvsp[(3) - (3)]); } |
2130 | break; | 2118 | break; |
2131 | 2119 | ||
2132 | case 124: | 2120 | case 125: |
2133 | 2121 | ||
2134 | { (yyval) = (yyvsp[(4) - (4)]); } | 2122 | { (yyval) = (yyvsp[(4) - (4)]); } |
2135 | break; | 2123 | break; |
2136 | 2124 | ||
2137 | case 127: | 2125 | case 128: |
2138 | 2126 | ||
2139 | { | 2127 | { |
2140 | const char *name = strdup((*(yyvsp[(1) - (1)]))->string); | 2128 | const char *name = strdup((*(yyvsp[(1) - (1)]))->string); |
@@ -2142,7 +2130,7 @@ yyreduce: | |||
2142 | } | 2130 | } |
2143 | break; | 2131 | break; |
2144 | 2132 | ||
2145 | case 128: | 2133 | case 129: |
2146 | 2134 | ||
2147 | { | 2135 | { |
2148 | const char *name = strdup((*(yyvsp[(1) - (3)]))->string); | 2136 | const char *name = strdup((*(yyvsp[(1) - (3)]))->string); |
@@ -2151,17 +2139,17 @@ yyreduce: | |||
2151 | } | 2139 | } |
2152 | break; | 2140 | break; |
2153 | 2141 | ||
2154 | case 129: | 2142 | case 130: |
2155 | 2143 | ||
2156 | { (yyval) = (yyvsp[(2) - (2)]); } | 2144 | { (yyval) = (yyvsp[(2) - (2)]); } |
2157 | break; | 2145 | break; |
2158 | 2146 | ||
2159 | case 130: | 2147 | case 131: |
2160 | 2148 | ||
2161 | { (yyval) = NULL; } | 2149 | { (yyval) = NULL; } |
2162 | break; | 2150 | break; |
2163 | 2151 | ||
2164 | case 132: | 2152 | case 133: |
2165 | 2153 | ||
2166 | { export_symbol((*(yyvsp[(3) - (5)]))->string); (yyval) = (yyvsp[(5) - (5)]); } | 2154 | { export_symbol((*(yyvsp[(3) - (5)]))->string); (yyval) = (yyvsp[(5) - (5)]); } |
2167 | break; | 2155 | break; |
@@ -2330,7 +2318,9 @@ yyerrlab1: | |||
2330 | YY_STACK_PRINT (yyss, yyssp); | 2318 | YY_STACK_PRINT (yyss, yyssp); |
2331 | } | 2319 | } |
2332 | 2320 | ||
2321 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | ||
2333 | *++yyvsp = yylval; | 2322 | *++yyvsp = yylval; |
2323 | YY_IGNORE_MAYBE_UNINITIALIZED_END | ||
2334 | 2324 | ||
2335 | 2325 | ||
2336 | /* Shift the error token. */ | 2326 | /* Shift the error token. */ |
@@ -2404,4 +2394,3 @@ yyerror(const char *e) | |||
2404 | { | 2394 | { |
2405 | error_with_pos("%s", e); | 2395 | error_with_pos("%s", e); |
2406 | } | 2396 | } |
2407 | |||
diff --git a/scripts/genksyms/parse.tab.h_shipped b/scripts/genksyms/parse.tab.h_shipped index a4737dec4532..4c00cef6d71d 100644 --- a/scripts/genksyms/parse.tab.h_shipped +++ b/scripts/genksyms/parse.tab.h_shipped | |||
@@ -1,4 +1,4 @@ | |||
1 | /* A Bison parser, made by GNU Bison 2.5.1. */ | 1 | /* A Bison parser, made by GNU Bison 2.7. */ |
2 | 2 | ||
3 | /* Bison interface for Yacc-like parsers in C | 3 | /* Bison interface for Yacc-like parsers in C |
4 | 4 | ||
@@ -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_SCRIPTS_GENKSYMS_PARSE_TAB_H_SHIPPED_INCLUDED | ||
34 | # define YY_YY_SCRIPTS_GENKSYMS_PARSE_TAB_H_SHIPPED_INCLUDED | ||
35 | /* Enabling traces. */ | ||
36 | #ifndef YYDEBUG | ||
37 | # define YYDEBUG 1 | ||
38 | #endif | ||
39 | #if YYDEBUG | ||
40 | extern int yydebug; | ||
41 | #endif | ||
33 | 42 | ||
34 | /* Tokens. */ | 43 | /* Tokens. */ |
35 | #ifndef YYTOKENTYPE | 44 | #ifndef YYTOKENTYPE |
@@ -83,7 +92,6 @@ | |||
83 | #endif | 92 | #endif |
84 | 93 | ||
85 | 94 | ||
86 | |||
87 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED | 95 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
88 | typedef int YYSTYPE; | 96 | typedef int YYSTYPE; |
89 | # define YYSTYPE_IS_TRIVIAL 1 | 97 | # define YYSTYPE_IS_TRIVIAL 1 |
@@ -93,4 +101,18 @@ typedef int YYSTYPE; | |||
93 | 101 | ||
94 | extern YYSTYPE yylval; | 102 | extern YYSTYPE yylval; |
95 | 103 | ||
104 | #ifdef YYPARSE_PARAM | ||
105 | #if defined __STDC__ || defined __cplusplus | ||
106 | int yyparse (void *YYPARSE_PARAM); | ||
107 | #else | ||
108 | int yyparse (); | ||
109 | #endif | ||
110 | #else /* ! YYPARSE_PARAM */ | ||
111 | #if defined __STDC__ || defined __cplusplus | ||
112 | int yyparse (void); | ||
113 | #else | ||
114 | int yyparse (); | ||
115 | #endif | ||
116 | #endif /* ! YYPARSE_PARAM */ | ||
96 | 117 | ||
118 | #endif /* !YY_YY_SCRIPTS_GENKSYMS_PARSE_TAB_H_SHIPPED_INCLUDED */ | ||
diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y index b9f4cf202302..723ab30fe9d4 100644 --- a/scripts/genksyms/parse.y +++ b/scripts/genksyms/parse.y | |||
@@ -303,6 +303,15 @@ direct_declarator: | |||
303 | $$ = $1; | 303 | $$ = $1; |
304 | } | 304 | } |
305 | } | 305 | } |
306 | | TYPE | ||
307 | { if (current_name != NULL) { | ||
308 | error_with_pos("unexpected second declaration name"); | ||
309 | YYERROR; | ||
310 | } else { | ||
311 | current_name = (*$1)->string; | ||
312 | $$ = $1; | ||
313 | } | ||
314 | } | ||
306 | | direct_declarator '(' parameter_declaration_clause ')' | 315 | | direct_declarator '(' parameter_declaration_clause ')' |
307 | { $$ = $4; } | 316 | { $$ = $4; } |
308 | | direct_declarator '(' error ')' | 317 | | direct_declarator '(' error ')' |
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index c814f57672fc..0b7dc2fd7bac 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -268,8 +268,7 @@ int conf_read_simple(const char *name, int def) | |||
268 | goto load; | 268 | goto load; |
269 | sym_add_change_count(1); | 269 | sym_add_change_count(1); |
270 | if (!sym_defconfig_list) { | 270 | if (!sym_defconfig_list) { |
271 | if (modules_sym) | 271 | sym_calc_value(modules_sym); |
272 | sym_calc_value(modules_sym); | ||
273 | return 1; | 272 | return 1; |
274 | } | 273 | } |
275 | 274 | ||
@@ -404,9 +403,7 @@ setsym: | |||
404 | } | 403 | } |
405 | free(line); | 404 | free(line); |
406 | fclose(in); | 405 | fclose(in); |
407 | 406 | sym_calc_value(modules_sym); | |
408 | if (modules_sym) | ||
409 | sym_calc_value(modules_sym); | ||
410 | return 0; | 407 | return 0; |
411 | } | 408 | } |
412 | 409 | ||
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh index ec8e20350a64..0d883b37882a 100755 --- a/scripts/kconfig/merge_config.sh +++ b/scripts/kconfig/merge_config.sh | |||
@@ -100,6 +100,10 @@ cat $INITFILE > $TMP_FILE | |||
100 | # Merge files, printing warnings on overridden values | 100 | # Merge files, printing warnings on overridden values |
101 | for MERGE_FILE in $MERGE_LIST ; do | 101 | for MERGE_FILE in $MERGE_LIST ; do |
102 | echo "Merging $MERGE_FILE" | 102 | echo "Merging $MERGE_FILE" |
103 | if [ ! -r "$MERGE_FILE" ]; then | ||
104 | echo "The merge file '$MERGE_FILE' does not exist. Exit." >&2 | ||
105 | exit 1 | ||
106 | fi | ||
103 | CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE) | 107 | CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE) |
104 | 108 | ||
105 | for CFG in $CFG_LIST ; do | 109 | for CFG in $CFG_LIST ; do |
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 70c5ee189dce..50878dc025a5 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c | |||
@@ -467,8 +467,7 @@ void sym_clear_all_valid(void) | |||
467 | for_all_symbols(i, sym) | 467 | for_all_symbols(i, sym) |
468 | sym->flags &= ~SYMBOL_VALID; | 468 | sym->flags &= ~SYMBOL_VALID; |
469 | sym_add_change_count(1); | 469 | sym_add_change_count(1); |
470 | if (modules_sym) | 470 | sym_calc_value(modules_sym); |
471 | sym_calc_value(modules_sym); | ||
472 | } | 471 | } |
473 | 472 | ||
474 | bool sym_tristate_within_range(struct symbol *sym, tristate val) | 473 | bool sym_tristate_within_range(struct symbol *sym, tristate val) |
diff --git a/scripts/kconfig/zconf.gperf b/scripts/kconfig/zconf.gperf index b6ac02d604f1..ac498f01b449 100644 --- a/scripts/kconfig/zconf.gperf +++ b/scripts/kconfig/zconf.gperf | |||
@@ -22,6 +22,7 @@ comment, T_COMMENT, TF_COMMAND | |||
22 | config, T_CONFIG, TF_COMMAND | 22 | config, T_CONFIG, TF_COMMAND |
23 | menuconfig, T_MENUCONFIG, TF_COMMAND | 23 | menuconfig, T_MENUCONFIG, TF_COMMAND |
24 | help, T_HELP, TF_COMMAND | 24 | help, T_HELP, TF_COMMAND |
25 | ---help---, T_HELP, TF_COMMAND | ||
25 | if, T_IF, TF_COMMAND|TF_PARAM | 26 | if, T_IF, TF_COMMAND|TF_PARAM |
26 | endif, T_ENDIF, TF_COMMAND | 27 | endif, T_ENDIF, TF_COMMAND |
27 | depends, T_DEPENDS, TF_COMMAND | 28 | depends, T_DEPENDS, TF_COMMAND |
diff --git a/scripts/kconfig/zconf.hash.c_shipped b/scripts/kconfig/zconf.hash.c_shipped index c77a8eff1ef2..360a62df2b5e 100644 --- a/scripts/kconfig/zconf.hash.c_shipped +++ b/scripts/kconfig/zconf.hash.c_shipped | |||
@@ -50,7 +50,7 @@ kconf_id_hash (register const char *str, register unsigned int len) | |||
50 | 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, | 50 | 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, |
51 | 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, | 51 | 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, |
52 | 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, | 52 | 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, |
53 | 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, | 53 | 73, 73, 73, 73, 73, 0, 73, 73, 73, 73, |
54 | 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, | 54 | 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, |
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, |
@@ -96,6 +96,7 @@ struct kconf_id_strings_t | |||
96 | char kconf_id_strings_str7[sizeof("default")]; | 96 | char kconf_id_strings_str7[sizeof("default")]; |
97 | char kconf_id_strings_str8[sizeof("tristate")]; | 97 | char kconf_id_strings_str8[sizeof("tristate")]; |
98 | char kconf_id_strings_str9[sizeof("endchoice")]; | 98 | char kconf_id_strings_str9[sizeof("endchoice")]; |
99 | char kconf_id_strings_str10[sizeof("---help---")]; | ||
99 | char kconf_id_strings_str12[sizeof("def_tristate")]; | 100 | char kconf_id_strings_str12[sizeof("def_tristate")]; |
100 | char kconf_id_strings_str13[sizeof("def_bool")]; | 101 | char kconf_id_strings_str13[sizeof("def_bool")]; |
101 | char kconf_id_strings_str14[sizeof("defconfig_list")]; | 102 | char kconf_id_strings_str14[sizeof("defconfig_list")]; |
@@ -132,6 +133,7 @@ static const struct kconf_id_strings_t kconf_id_strings_contents = | |||
132 | "default", | 133 | "default", |
133 | "tristate", | 134 | "tristate", |
134 | "endchoice", | 135 | "endchoice", |
136 | "---help---", | ||
135 | "def_tristate", | 137 | "def_tristate", |
136 | "def_bool", | 138 | "def_bool", |
137 | "defconfig_list", | 139 | "defconfig_list", |
@@ -172,7 +174,7 @@ kconf_id_lookup (register const char *str, register unsigned int len) | |||
172 | { | 174 | { |
173 | enum | 175 | enum |
174 | { | 176 | { |
175 | TOTAL_KEYWORDS = 33, | 177 | TOTAL_KEYWORDS = 34, |
176 | MIN_WORD_LENGTH = 2, | 178 | MIN_WORD_LENGTH = 2, |
177 | MAX_WORD_LENGTH = 14, | 179 | MAX_WORD_LENGTH = 14, |
178 | MIN_HASH_VALUE = 2, | 180 | MIN_HASH_VALUE = 2, |
@@ -182,34 +184,36 @@ kconf_id_lookup (register const char *str, register unsigned int len) | |||
182 | static const struct kconf_id wordlist[] = | 184 | static const struct kconf_id wordlist[] = |
183 | { | 185 | { |
184 | {-1}, {-1}, | 186 | {-1}, {-1}, |
185 | #line 25 "scripts/kconfig/zconf.gperf" | 187 | #line 26 "scripts/kconfig/zconf.gperf" |
186 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_IF, TF_COMMAND|TF_PARAM}, | 188 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_IF, TF_COMMAND|TF_PARAM}, |
187 | #line 36 "scripts/kconfig/zconf.gperf" | 189 | #line 37 "scripts/kconfig/zconf.gperf" |
188 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3, T_TYPE, TF_COMMAND, S_INT}, | 190 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3, T_TYPE, TF_COMMAND, S_INT}, |
189 | {-1}, | 191 | {-1}, |
190 | #line 26 "scripts/kconfig/zconf.gperf" | 192 | #line 27 "scripts/kconfig/zconf.gperf" |
191 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str5, T_ENDIF, TF_COMMAND}, | 193 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str5, T_ENDIF, TF_COMMAND}, |
192 | {-1}, | 194 | {-1}, |
193 | #line 29 "scripts/kconfig/zconf.gperf" | 195 | #line 30 "scripts/kconfig/zconf.gperf" |
194 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_DEFAULT, TF_COMMAND, S_UNKNOWN}, | 196 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_DEFAULT, TF_COMMAND, S_UNKNOWN}, |
195 | #line 31 "scripts/kconfig/zconf.gperf" | 197 | #line 32 "scripts/kconfig/zconf.gperf" |
196 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_TYPE, TF_COMMAND, S_TRISTATE}, | 198 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_TYPE, TF_COMMAND, S_TRISTATE}, |
197 | #line 20 "scripts/kconfig/zconf.gperf" | 199 | #line 20 "scripts/kconfig/zconf.gperf" |
198 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str9, T_ENDCHOICE, TF_COMMAND}, | 200 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str9, T_ENDCHOICE, TF_COMMAND}, |
199 | {-1}, {-1}, | 201 | #line 25 "scripts/kconfig/zconf.gperf" |
200 | #line 32 "scripts/kconfig/zconf.gperf" | 202 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str10, T_HELP, TF_COMMAND}, |
203 | {-1}, | ||
204 | #line 33 "scripts/kconfig/zconf.gperf" | ||
201 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_TRISTATE}, | 205 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_TRISTATE}, |
202 | #line 35 "scripts/kconfig/zconf.gperf" | 206 | #line 36 "scripts/kconfig/zconf.gperf" |
203 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN}, | 207 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN}, |
204 | #line 45 "scripts/kconfig/zconf.gperf" | 208 | #line 46 "scripts/kconfig/zconf.gperf" |
205 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_OPT_DEFCONFIG_LIST,TF_OPTION}, | 209 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_OPT_DEFCONFIG_LIST,TF_OPTION}, |
206 | {-1}, {-1}, | 210 | {-1}, {-1}, |
207 | #line 43 "scripts/kconfig/zconf.gperf" | 211 | #line 44 "scripts/kconfig/zconf.gperf" |
208 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_ON, TF_PARAM}, | 212 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_ON, TF_PARAM}, |
209 | #line 28 "scripts/kconfig/zconf.gperf" | 213 | #line 29 "scripts/kconfig/zconf.gperf" |
210 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_OPTIONAL, TF_COMMAND}, | 214 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_OPTIONAL, TF_COMMAND}, |
211 | {-1}, {-1}, | 215 | {-1}, {-1}, |
212 | #line 42 "scripts/kconfig/zconf.gperf" | 216 | #line 43 "scripts/kconfig/zconf.gperf" |
213 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_OPTION, TF_COMMAND}, | 217 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_OPTION, TF_COMMAND}, |
214 | #line 17 "scripts/kconfig/zconf.gperf" | 218 | #line 17 "scripts/kconfig/zconf.gperf" |
215 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_ENDMENU, TF_COMMAND}, | 219 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_ENDMENU, TF_COMMAND}, |
@@ -219,51 +223,51 @@ kconf_id_lookup (register const char *str, register unsigned int len) | |||
219 | #line 23 "scripts/kconfig/zconf.gperf" | 223 | #line 23 "scripts/kconfig/zconf.gperf" |
220 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str25, T_MENUCONFIG, TF_COMMAND}, | 224 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str25, T_MENUCONFIG, TF_COMMAND}, |
221 | {-1}, | 225 | {-1}, |
222 | #line 44 "scripts/kconfig/zconf.gperf" | 226 | #line 45 "scripts/kconfig/zconf.gperf" |
223 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION}, | 227 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION}, |
224 | #line 47 "scripts/kconfig/zconf.gperf" | 228 | #line 48 "scripts/kconfig/zconf.gperf" |
225 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_OPT_ALLNOCONFIG_Y,TF_OPTION}, | 229 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_OPT_ALLNOCONFIG_Y,TF_OPTION}, |
226 | #line 16 "scripts/kconfig/zconf.gperf" | 230 | #line 16 "scripts/kconfig/zconf.gperf" |
227 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND}, | 231 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND}, |
228 | {-1}, | 232 | {-1}, |
229 | #line 39 "scripts/kconfig/zconf.gperf" | 233 | #line 40 "scripts/kconfig/zconf.gperf" |
230 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_SELECT, TF_COMMAND}, | 234 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_SELECT, TF_COMMAND}, |
231 | #line 21 "scripts/kconfig/zconf.gperf" | 235 | #line 21 "scripts/kconfig/zconf.gperf" |
232 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND}, | 236 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND}, |
233 | #line 46 "scripts/kconfig/zconf.gperf" | 237 | #line 47 "scripts/kconfig/zconf.gperf" |
234 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_OPT_ENV, TF_OPTION}, | 238 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_OPT_ENV, TF_OPTION}, |
235 | {-1}, | 239 | {-1}, |
236 | #line 40 "scripts/kconfig/zconf.gperf" | 240 | #line 41 "scripts/kconfig/zconf.gperf" |
237 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35, T_RANGE, TF_COMMAND}, | 241 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35, T_RANGE, TF_COMMAND}, |
238 | #line 19 "scripts/kconfig/zconf.gperf" | 242 | #line 19 "scripts/kconfig/zconf.gperf" |
239 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36, T_CHOICE, TF_COMMAND}, | 243 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36, T_CHOICE, TF_COMMAND}, |
240 | {-1}, {-1}, | 244 | {-1}, {-1}, |
241 | #line 33 "scripts/kconfig/zconf.gperf" | 245 | #line 34 "scripts/kconfig/zconf.gperf" |
242 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str39, T_TYPE, TF_COMMAND, S_BOOLEAN}, | 246 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str39, T_TYPE, TF_COMMAND, S_BOOLEAN}, |
243 | {-1}, | 247 | {-1}, |
244 | #line 18 "scripts/kconfig/zconf.gperf" | 248 | #line 18 "scripts/kconfig/zconf.gperf" |
245 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_SOURCE, TF_COMMAND}, | 249 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_SOURCE, TF_COMMAND}, |
246 | #line 41 "scripts/kconfig/zconf.gperf" | 250 | #line 42 "scripts/kconfig/zconf.gperf" |
247 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str42, T_VISIBLE, TF_COMMAND}, | 251 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str42, T_VISIBLE, TF_COMMAND}, |
248 | #line 37 "scripts/kconfig/zconf.gperf" | 252 | #line 38 "scripts/kconfig/zconf.gperf" |
249 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str43, T_TYPE, TF_COMMAND, S_HEX}, | 253 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str43, T_TYPE, TF_COMMAND, S_HEX}, |
250 | {-1}, {-1}, | 254 | {-1}, {-1}, |
251 | #line 22 "scripts/kconfig/zconf.gperf" | 255 | #line 22 "scripts/kconfig/zconf.gperf" |
252 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_CONFIG, TF_COMMAND}, | 256 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_CONFIG, TF_COMMAND}, |
253 | #line 34 "scripts/kconfig/zconf.gperf" | 257 | #line 35 "scripts/kconfig/zconf.gperf" |
254 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str47, T_TYPE, TF_COMMAND, S_BOOLEAN}, | 258 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str47, T_TYPE, TF_COMMAND, S_BOOLEAN}, |
255 | {-1}, {-1}, {-1}, | 259 | {-1}, {-1}, {-1}, |
256 | #line 38 "scripts/kconfig/zconf.gperf" | 260 | #line 39 "scripts/kconfig/zconf.gperf" |
257 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str51, T_TYPE, TF_COMMAND, S_STRING}, | 261 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str51, T_TYPE, TF_COMMAND, S_STRING}, |
258 | {-1}, {-1}, | 262 | {-1}, {-1}, |
259 | #line 24 "scripts/kconfig/zconf.gperf" | 263 | #line 24 "scripts/kconfig/zconf.gperf" |
260 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str54, T_HELP, TF_COMMAND}, | 264 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str54, T_HELP, TF_COMMAND}, |
261 | {-1}, | 265 | {-1}, |
262 | #line 30 "scripts/kconfig/zconf.gperf" | 266 | #line 31 "scripts/kconfig/zconf.gperf" |
263 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str56, T_PROMPT, TF_COMMAND}, | 267 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str56, T_PROMPT, TF_COMMAND}, |
264 | {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, | 268 | {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, |
265 | {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, | 269 | {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, |
266 | #line 27 "scripts/kconfig/zconf.gperf" | 270 | #line 28 "scripts/kconfig/zconf.gperf" |
267 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str72, T_DEPENDS, TF_COMMAND} | 271 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str72, T_DEPENDS, TF_COMMAND} |
268 | }; | 272 | }; |
269 | 273 | ||
@@ -285,5 +289,5 @@ kconf_id_lookup (register const char *str, register unsigned int len) | |||
285 | } | 289 | } |
286 | return 0; | 290 | return 0; |
287 | } | 291 | } |
288 | #line 48 "scripts/kconfig/zconf.gperf" | 292 | #line 49 "scripts/kconfig/zconf.gperf" |
289 | 293 | ||
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 200a3fe30091..c410d257da06 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l | |||
@@ -66,9 +66,16 @@ static void alloc_string(const char *str, int size) | |||
66 | memcpy(text, str, size); | 66 | memcpy(text, str, size); |
67 | text[size] = 0; | 67 | text[size] = 0; |
68 | } | 68 | } |
69 | |||
70 | static void warn_ignored_character(char chr) | ||
71 | { | ||
72 | fprintf(stderr, | ||
73 | "%s:%d:warning: ignoring unsupported character '%c'\n", | ||
74 | zconf_curname(), zconf_lineno(), chr); | ||
75 | } | ||
69 | %} | 76 | %} |
70 | 77 | ||
71 | n [A-Za-z0-9_] | 78 | n [A-Za-z0-9_-] |
72 | 79 | ||
73 | %% | 80 | %% |
74 | int str = 0; | 81 | int str = 0; |
@@ -106,7 +113,7 @@ n [A-Za-z0-9_] | |||
106 | zconflval.string = text; | 113 | zconflval.string = text; |
107 | return T_WORD; | 114 | return T_WORD; |
108 | } | 115 | } |
109 | . | 116 | . warn_ignored_character(*yytext); |
110 | \n { | 117 | \n { |
111 | BEGIN(INITIAL); | 118 | BEGIN(INITIAL); |
112 | current_file->lineno++; | 119 | current_file->lineno++; |
@@ -132,8 +139,7 @@ n [A-Za-z0-9_] | |||
132 | BEGIN(STRING); | 139 | BEGIN(STRING); |
133 | } | 140 | } |
134 | \n BEGIN(INITIAL); current_file->lineno++; return T_EOL; | 141 | \n BEGIN(INITIAL); current_file->lineno++; return T_EOL; |
135 | --- /* ignore */ | 142 | ({n}|[/.])+ { |
136 | ({n}|[-/.])+ { | ||
137 | const struct kconf_id *id = kconf_id_lookup(yytext, yyleng); | 143 | const struct kconf_id *id = kconf_id_lookup(yytext, yyleng); |
138 | if (id && id->flags & TF_PARAM) { | 144 | if (id && id->flags & TF_PARAM) { |
139 | zconflval.id = id; | 145 | zconflval.id = id; |
@@ -146,11 +152,7 @@ n [A-Za-z0-9_] | |||
146 | #.* /* comment */ | 152 | #.* /* comment */ |
147 | \\\n current_file->lineno++; | 153 | \\\n current_file->lineno++; |
148 | [[:blank:]]+ | 154 | [[:blank:]]+ |
149 | . { | 155 | . warn_ignored_character(*yytext); |
150 | fprintf(stderr, | ||
151 | "%s:%d:warning: ignoring unsupported character '%c'\n", | ||
152 | zconf_curname(), zconf_lineno(), *yytext); | ||
153 | } | ||
154 | <<EOF>> { | 156 | <<EOF>> { |
155 | BEGIN(INITIAL); | 157 | BEGIN(INITIAL); |
156 | } | 158 | } |
diff --git a/scripts/kconfig/zconf.lex.c_shipped b/scripts/kconfig/zconf.lex.c_shipped index dd4e86c82521..37fdf6123505 100644 --- a/scripts/kconfig/zconf.lex.c_shipped +++ b/scripts/kconfig/zconf.lex.c_shipped | |||
@@ -72,7 +72,6 @@ typedef int flex_int32_t; | |||
72 | typedef unsigned char flex_uint8_t; | 72 | typedef unsigned char flex_uint8_t; |
73 | typedef unsigned short int flex_uint16_t; | 73 | typedef unsigned short int flex_uint16_t; |
74 | typedef unsigned int flex_uint32_t; | 74 | typedef unsigned int flex_uint32_t; |
75 | #endif /* ! C99 */ | ||
76 | 75 | ||
77 | /* Limits of integral types. */ | 76 | /* Limits of integral types. */ |
78 | #ifndef INT8_MIN | 77 | #ifndef INT8_MIN |
@@ -103,6 +102,8 @@ typedef unsigned int flex_uint32_t; | |||
103 | #define UINT32_MAX (4294967295U) | 102 | #define UINT32_MAX (4294967295U) |
104 | #endif | 103 | #endif |
105 | 104 | ||
105 | #endif /* ! C99 */ | ||
106 | |||
106 | #endif /* ! FLEXINT_H */ | 107 | #endif /* ! FLEXINT_H */ |
107 | 108 | ||
108 | #ifdef __cplusplus | 109 | #ifdef __cplusplus |
@@ -159,7 +160,15 @@ typedef unsigned int flex_uint32_t; | |||
159 | 160 | ||
160 | /* Size of default input buffer. */ | 161 | /* Size of default input buffer. */ |
161 | #ifndef YY_BUF_SIZE | 162 | #ifndef YY_BUF_SIZE |
163 | #ifdef __ia64__ | ||
164 | /* On IA-64, the buffer size is 16k, not 8k. | ||
165 | * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. | ||
166 | * Ditto for the __ia64__ case accordingly. | ||
167 | */ | ||
168 | #define YY_BUF_SIZE 32768 | ||
169 | #else | ||
162 | #define YY_BUF_SIZE 16384 | 170 | #define YY_BUF_SIZE 16384 |
171 | #endif /* __ia64__ */ | ||
163 | #endif | 172 | #endif |
164 | 173 | ||
165 | /* The state buf must be large enough to hold one state per character in the main buffer. | 174 | /* The state buf must be large enough to hold one state per character in the main buffer. |
@@ -365,354 +374,338 @@ int zconflineno = 1; | |||
365 | 374 | ||
366 | extern char *zconftext; | 375 | extern char *zconftext; |
367 | #define yytext_ptr zconftext | 376 | #define yytext_ptr zconftext |
368 | static yyconst flex_int16_t yy_nxt[][19] = | 377 | static yyconst flex_int16_t yy_nxt[][18] = |
369 | { | 378 | { |
370 | { | 379 | { |
371 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 380 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
372 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | 381 | 0, 0, 0, 0, 0, 0, 0, 0 |
373 | }, | 382 | }, |
374 | 383 | ||
375 | { | 384 | { |
376 | 11, 12, 13, 14, 12, 12, 15, 12, 12, 12, | 385 | 11, 12, 13, 14, 12, 12, 15, 12, 12, 12, |
377 | 12, 12, 12, 12, 12, 12, 12, 12, 12 | 386 | 12, 12, 12, 12, 12, 12, 12, 12 |
378 | }, | 387 | }, |
379 | 388 | ||
380 | { | 389 | { |
381 | 11, 12, 13, 14, 12, 12, 15, 12, 12, 12, | 390 | 11, 12, 13, 14, 12, 12, 15, 12, 12, 12, |
382 | 12, 12, 12, 12, 12, 12, 12, 12, 12 | 391 | 12, 12, 12, 12, 12, 12, 12, 12 |
383 | }, | 392 | }, |
384 | 393 | ||
385 | { | 394 | { |
386 | 11, 16, 16, 17, 16, 16, 16, 16, 16, 16, | 395 | 11, 16, 16, 17, 16, 16, 16, 16, 16, 16, |
387 | 16, 16, 16, 18, 16, 16, 16, 16, 16 | 396 | 16, 18, 16, 16, 16, 16, 16, 16 |
388 | }, | 397 | }, |
389 | 398 | ||
390 | { | 399 | { |
391 | 11, 16, 16, 17, 16, 16, 16, 16, 16, 16, | 400 | 11, 16, 16, 17, 16, 16, 16, 16, 16, 16, |
392 | 16, 16, 16, 18, 16, 16, 16, 16, 16 | 401 | 16, 18, 16, 16, 16, 16, 16, 16 |
393 | 402 | ||
394 | }, | 403 | }, |
395 | 404 | ||
396 | { | 405 | { |
397 | 11, 19, 20, 21, 19, 19, 19, 19, 19, 19, | 406 | 11, 19, 20, 21, 19, 19, 19, 19, 19, 19, |
398 | 19, 19, 19, 19, 19, 19, 19, 19, 19 | 407 | 19, 19, 19, 19, 19, 19, 19, 19 |
399 | }, | 408 | }, |
400 | 409 | ||
401 | { | 410 | { |
402 | 11, 19, 20, 21, 19, 19, 19, 19, 19, 19, | 411 | 11, 19, 20, 21, 19, 19, 19, 19, 19, 19, |
403 | 19, 19, 19, 19, 19, 19, 19, 19, 19 | 412 | 19, 19, 19, 19, 19, 19, 19, 19 |
404 | }, | 413 | }, |
405 | 414 | ||
406 | { | 415 | { |
407 | 11, 22, 22, 23, 22, 24, 22, 22, 24, 22, | 416 | 11, 22, 22, 23, 22, 24, 22, 22, 24, 22, |
408 | 22, 22, 22, 22, 22, 22, 22, 25, 22 | 417 | 22, 22, 22, 22, 22, 22, 25, 22 |
409 | }, | 418 | }, |
410 | 419 | ||
411 | { | 420 | { |
412 | 11, 22, 22, 23, 22, 24, 22, 22, 24, 22, | 421 | 11, 22, 22, 23, 22, 24, 22, 22, 24, 22, |
413 | 22, 22, 22, 22, 22, 22, 22, 25, 22 | 422 | 22, 22, 22, 22, 22, 22, 25, 22 |
414 | }, | 423 | }, |
415 | 424 | ||
416 | { | 425 | { |
417 | 11, 26, 27, 28, 29, 30, 31, 32, 30, 33, | 426 | 11, 26, 27, 28, 29, 30, 31, 32, 30, 33, |
418 | 34, 35, 36, 36, 37, 38, 39, 40, 41 | 427 | 34, 35, 35, 36, 37, 38, 39, 40 |
419 | 428 | ||
420 | }, | 429 | }, |
421 | 430 | ||
422 | { | 431 | { |
423 | 11, 26, 27, 28, 29, 30, 31, 32, 30, 33, | 432 | 11, 26, 27, 28, 29, 30, 31, 32, 30, 33, |
424 | 34, 35, 36, 36, 37, 38, 39, 40, 41 | 433 | 34, 35, 35, 36, 37, 38, 39, 40 |
425 | }, | 434 | }, |
426 | 435 | ||
427 | { | 436 | { |
428 | -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, | 437 | -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, |
429 | -11, -11, -11, -11, -11, -11, -11, -11, -11 | 438 | -11, -11, -11, -11, -11, -11, -11, -11 |
430 | }, | 439 | }, |
431 | 440 | ||
432 | { | 441 | { |
433 | 11, -12, -12, -12, -12, -12, -12, -12, -12, -12, | 442 | 11, -12, -12, -12, -12, -12, -12, -12, -12, -12, |
434 | -12, -12, -12, -12, -12, -12, -12, -12, -12 | 443 | -12, -12, -12, -12, -12, -12, -12, -12 |
435 | }, | 444 | }, |
436 | 445 | ||
437 | { | 446 | { |
438 | 11, -13, 42, 43, -13, -13, 44, -13, -13, -13, | 447 | 11, -13, 41, 42, -13, -13, 43, -13, -13, -13, |
439 | -13, -13, -13, -13, -13, -13, -13, -13, -13 | 448 | -13, -13, -13, -13, -13, -13, -13, -13 |
440 | }, | 449 | }, |
441 | 450 | ||
442 | { | 451 | { |
443 | 11, -14, -14, -14, -14, -14, -14, -14, -14, -14, | 452 | 11, -14, -14, -14, -14, -14, -14, -14, -14, -14, |
444 | -14, -14, -14, -14, -14, -14, -14, -14, -14 | 453 | -14, -14, -14, -14, -14, -14, -14, -14 |
445 | 454 | ||
446 | }, | 455 | }, |
447 | 456 | ||
448 | { | 457 | { |
449 | 11, 45, 45, 46, 45, 45, 45, 45, 45, 45, | 458 | 11, 44, 44, 45, 44, 44, 44, 44, 44, 44, |
450 | 45, 45, 45, 45, 45, 45, 45, 45, 45 | 459 | 44, 44, 44, 44, 44, 44, 44, 44 |
451 | }, | 460 | }, |
452 | 461 | ||
453 | { | 462 | { |
454 | 11, -16, -16, -16, -16, -16, -16, -16, -16, -16, | 463 | 11, -16, -16, -16, -16, -16, -16, -16, -16, -16, |
455 | -16, -16, -16, -16, -16, -16, -16, -16, -16 | 464 | -16, -16, -16, -16, -16, -16, -16, -16 |
456 | }, | 465 | }, |
457 | 466 | ||
458 | { | 467 | { |
459 | 11, -17, -17, -17, -17, -17, -17, -17, -17, -17, | 468 | 11, -17, -17, -17, -17, -17, -17, -17, -17, -17, |
460 | -17, -17, -17, -17, -17, -17, -17, -17, -17 | 469 | -17, -17, -17, -17, -17, -17, -17, -17 |
461 | }, | 470 | }, |
462 | 471 | ||
463 | { | 472 | { |
464 | 11, -18, -18, -18, -18, -18, -18, -18, -18, -18, | 473 | 11, -18, -18, -18, -18, -18, -18, -18, -18, -18, |
465 | -18, -18, -18, 47, -18, -18, -18, -18, -18 | 474 | -18, 46, -18, -18, -18, -18, -18, -18 |
466 | }, | 475 | }, |
467 | 476 | ||
468 | { | 477 | { |
469 | 11, 48, 48, -19, 48, 48, 48, 48, 48, 48, | 478 | 11, 47, 47, -19, 47, 47, 47, 47, 47, 47, |
470 | 48, 48, 48, 48, 48, 48, 48, 48, 48 | 479 | 47, 47, 47, 47, 47, 47, 47, 47 |
471 | 480 | ||
472 | }, | 481 | }, |
473 | 482 | ||
474 | { | 483 | { |
475 | 11, -20, 49, 50, -20, -20, -20, -20, -20, -20, | 484 | 11, -20, 48, 49, -20, -20, -20, -20, -20, -20, |
476 | -20, -20, -20, -20, -20, -20, -20, -20, -20 | 485 | -20, -20, -20, -20, -20, -20, -20, -20 |
477 | }, | 486 | }, |
478 | 487 | ||
479 | { | 488 | { |
480 | 11, 51, -21, -21, 51, 51, 51, 51, 51, 51, | 489 | 11, 50, -21, -21, 50, 50, 50, 50, 50, 50, |
481 | 51, 51, 51, 51, 51, 51, 51, 51, 51 | 490 | 50, 50, 50, 50, 50, 50, 50, 50 |
482 | }, | 491 | }, |
483 | 492 | ||
484 | { | 493 | { |
485 | 11, 52, 52, 53, 52, -22, 52, 52, -22, 52, | 494 | 11, 51, 51, 52, 51, -22, 51, 51, -22, 51, |
486 | 52, 52, 52, 52, 52, 52, 52, -22, 52 | 495 | 51, 51, 51, 51, 51, 51, -22, 51 |
487 | }, | 496 | }, |
488 | 497 | ||
489 | { | 498 | { |
490 | 11, -23, -23, -23, -23, -23, -23, -23, -23, -23, | 499 | 11, -23, -23, -23, -23, -23, -23, -23, -23, -23, |
491 | -23, -23, -23, -23, -23, -23, -23, -23, -23 | 500 | -23, -23, -23, -23, -23, -23, -23, -23 |
492 | }, | 501 | }, |
493 | 502 | ||
494 | { | 503 | { |
495 | 11, -24, -24, -24, -24, -24, -24, -24, -24, -24, | 504 | 11, -24, -24, -24, -24, -24, -24, -24, -24, -24, |
496 | -24, -24, -24, -24, -24, -24, -24, -24, -24 | 505 | -24, -24, -24, -24, -24, -24, -24, -24 |
497 | 506 | ||
498 | }, | 507 | }, |
499 | 508 | ||
500 | { | 509 | { |
501 | 11, 54, 54, 55, 54, 54, 54, 54, 54, 54, | 510 | 11, 53, 53, 54, 53, 53, 53, 53, 53, 53, |
502 | 54, 54, 54, 54, 54, 54, 54, 54, 54 | 511 | 53, 53, 53, 53, 53, 53, 53, 53 |
503 | }, | 512 | }, |
504 | 513 | ||
505 | { | 514 | { |
506 | 11, -26, -26, -26, -26, -26, -26, -26, -26, -26, | 515 | 11, -26, -26, -26, -26, -26, -26, -26, -26, -26, |
507 | -26, -26, -26, -26, -26, -26, -26, -26, -26 | 516 | -26, -26, -26, -26, -26, -26, -26, -26 |
508 | }, | 517 | }, |
509 | 518 | ||
510 | { | 519 | { |
511 | 11, -27, 56, -27, -27, -27, -27, -27, -27, -27, | 520 | 11, -27, 55, -27, -27, -27, -27, -27, -27, -27, |
512 | -27, -27, -27, -27, -27, -27, -27, -27, -27 | 521 | -27, -27, -27, -27, -27, -27, -27, -27 |
513 | }, | 522 | }, |
514 | 523 | ||
515 | { | 524 | { |
516 | 11, -28, -28, -28, -28, -28, -28, -28, -28, -28, | 525 | 11, -28, -28, -28, -28, -28, -28, -28, -28, -28, |
517 | -28, -28, -28, -28, -28, -28, -28, -28, -28 | 526 | -28, -28, -28, -28, -28, -28, -28, -28 |
518 | }, | 527 | }, |
519 | 528 | ||
520 | { | 529 | { |
521 | 11, -29, -29, -29, -29, -29, -29, -29, -29, -29, | 530 | 11, -29, -29, -29, -29, -29, -29, -29, -29, -29, |
522 | -29, -29, -29, -29, -29, 57, -29, -29, -29 | 531 | -29, -29, -29, -29, 56, -29, -29, -29 |
523 | 532 | ||
524 | }, | 533 | }, |
525 | 534 | ||
526 | { | 535 | { |
527 | 11, -30, -30, -30, -30, -30, -30, -30, -30, -30, | 536 | 11, -30, -30, -30, -30, -30, -30, -30, -30, -30, |
528 | -30, -30, -30, -30, -30, -30, -30, -30, -30 | 537 | -30, -30, -30, -30, -30, -30, -30, -30 |
529 | }, | 538 | }, |
530 | 539 | ||
531 | { | 540 | { |
532 | 11, 58, 58, -31, 58, 58, 58, 58, 58, 58, | 541 | 11, 57, 57, -31, 57, 57, 57, 57, 57, 57, |
533 | 58, 58, 58, 58, 58, 58, 58, 58, 58 | 542 | 57, 57, 57, 57, 57, 57, 57, 57 |
534 | }, | 543 | }, |
535 | 544 | ||
536 | { | 545 | { |
537 | 11, -32, -32, -32, -32, -32, -32, 59, -32, -32, | 546 | 11, -32, -32, -32, -32, -32, -32, 58, -32, -32, |
538 | -32, -32, -32, -32, -32, -32, -32, -32, -32 | 547 | -32, -32, -32, -32, -32, -32, -32, -32 |
539 | }, | 548 | }, |
540 | 549 | ||
541 | { | 550 | { |
542 | 11, -33, -33, -33, -33, -33, -33, -33, -33, -33, | 551 | 11, -33, -33, -33, -33, -33, -33, -33, -33, -33, |
543 | -33, -33, -33, -33, -33, -33, -33, -33, -33 | 552 | -33, -33, -33, -33, -33, -33, -33, -33 |
544 | }, | 553 | }, |
545 | 554 | ||
546 | { | 555 | { |
547 | 11, -34, -34, -34, -34, -34, -34, -34, -34, -34, | 556 | 11, -34, -34, -34, -34, -34, -34, -34, -34, -34, |
548 | -34, -34, -34, -34, -34, -34, -34, -34, -34 | 557 | -34, -34, -34, -34, -34, -34, -34, -34 |
549 | 558 | ||
550 | }, | 559 | }, |
551 | 560 | ||
552 | { | 561 | { |
553 | 11, -35, -35, -35, -35, -35, -35, -35, -35, -35, | 562 | 11, -35, -35, -35, -35, -35, -35, -35, -35, -35, |
554 | -35, 60, 61, 61, -35, -35, -35, -35, -35 | 563 | -35, 59, 59, -35, -35, -35, -35, -35 |
555 | }, | 564 | }, |
556 | 565 | ||
557 | { | 566 | { |
558 | 11, -36, -36, -36, -36, -36, -36, -36, -36, -36, | 567 | 11, -36, -36, -36, -36, -36, -36, -36, -36, -36, |
559 | -36, 61, 61, 61, -36, -36, -36, -36, -36 | 568 | -36, -36, -36, -36, 60, -36, -36, -36 |
560 | }, | 569 | }, |
561 | 570 | ||
562 | { | 571 | { |
563 | 11, -37, -37, -37, -37, -37, -37, -37, -37, -37, | 572 | 11, -37, -37, -37, -37, -37, -37, -37, -37, -37, |
564 | -37, -37, -37, -37, -37, 62, -37, -37, -37 | 573 | -37, -37, -37, -37, -37, -37, -37, -37 |
565 | }, | 574 | }, |
566 | 575 | ||
567 | { | 576 | { |
568 | 11, -38, -38, -38, -38, -38, -38, -38, -38, -38, | 577 | 11, -38, -38, -38, -38, -38, -38, -38, -38, -38, |
569 | -38, -38, -38, -38, -38, -38, -38, -38, -38 | 578 | -38, -38, -38, -38, 61, -38, -38, -38 |
570 | }, | 579 | }, |
571 | 580 | ||
572 | { | 581 | { |
573 | 11, -39, -39, -39, -39, -39, -39, -39, -39, -39, | 582 | 11, -39, -39, 62, -39, -39, -39, -39, -39, -39, |
574 | -39, -39, -39, -39, -39, 63, -39, -39, -39 | 583 | -39, -39, -39, -39, -39, -39, -39, -39 |
575 | 584 | ||
576 | }, | 585 | }, |
577 | 586 | ||
578 | { | 587 | { |
579 | 11, -40, -40, 64, -40, -40, -40, -40, -40, -40, | 588 | 11, -40, -40, -40, -40, -40, -40, -40, -40, -40, |
580 | -40, -40, -40, -40, -40, -40, -40, -40, -40 | 589 | -40, -40, -40, -40, -40, -40, -40, 63 |
581 | }, | 590 | }, |
582 | 591 | ||
583 | { | 592 | { |
584 | 11, -41, -41, -41, -41, -41, -41, -41, -41, -41, | 593 | 11, -41, 41, 42, -41, -41, 43, -41, -41, -41, |
585 | -41, -41, -41, -41, -41, -41, -41, -41, 65 | 594 | -41, -41, -41, -41, -41, -41, -41, -41 |
586 | }, | 595 | }, |
587 | 596 | ||
588 | { | 597 | { |
589 | 11, -42, 42, 43, -42, -42, 44, -42, -42, -42, | 598 | 11, -42, -42, -42, -42, -42, -42, -42, -42, -42, |
590 | -42, -42, -42, -42, -42, -42, -42, -42, -42 | 599 | -42, -42, -42, -42, -42, -42, -42, -42 |
591 | }, | 600 | }, |
592 | 601 | ||
593 | { | 602 | { |
594 | 11, -43, -43, -43, -43, -43, -43, -43, -43, -43, | 603 | 11, 44, 44, 45, 44, 44, 44, 44, 44, 44, |
595 | -43, -43, -43, -43, -43, -43, -43, -43, -43 | 604 | 44, 44, 44, 44, 44, 44, 44, 44 |
596 | }, | 605 | }, |
597 | 606 | ||
598 | { | 607 | { |
599 | 11, 45, 45, 46, 45, 45, 45, 45, 45, 45, | 608 | 11, 44, 44, 45, 44, 44, 44, 44, 44, 44, |
600 | 45, 45, 45, 45, 45, 45, 45, 45, 45 | 609 | 44, 44, 44, 44, 44, 44, 44, 44 |
601 | 610 | ||
602 | }, | 611 | }, |
603 | 612 | ||
604 | { | 613 | { |
605 | 11, 45, 45, 46, 45, 45, 45, 45, 45, 45, | 614 | 11, -45, -45, -45, -45, -45, -45, -45, -45, -45, |
606 | 45, 45, 45, 45, 45, 45, 45, 45, 45 | 615 | -45, -45, -45, -45, -45, -45, -45, -45 |
607 | }, | 616 | }, |
608 | 617 | ||
609 | { | 618 | { |
610 | 11, -46, -46, -46, -46, -46, -46, -46, -46, -46, | 619 | 11, -46, -46, -46, -46, -46, -46, -46, -46, -46, |
611 | -46, -46, -46, -46, -46, -46, -46, -46, -46 | 620 | -46, 46, -46, -46, -46, -46, -46, -46 |
612 | }, | 621 | }, |
613 | 622 | ||
614 | { | 623 | { |
615 | 11, -47, -47, -47, -47, -47, -47, -47, -47, -47, | 624 | 11, 47, 47, -47, 47, 47, 47, 47, 47, 47, |
616 | -47, -47, -47, 47, -47, -47, -47, -47, -47 | 625 | 47, 47, 47, 47, 47, 47, 47, 47 |
617 | }, | 626 | }, |
618 | 627 | ||
619 | { | 628 | { |
620 | 11, 48, 48, -48, 48, 48, 48, 48, 48, 48, | 629 | 11, -48, 48, 49, -48, -48, -48, -48, -48, -48, |
621 | 48, 48, 48, 48, 48, 48, 48, 48, 48 | 630 | -48, -48, -48, -48, -48, -48, -48, -48 |
622 | }, | 631 | }, |
623 | 632 | ||
624 | { | 633 | { |
625 | 11, -49, 49, 50, -49, -49, -49, -49, -49, -49, | 634 | 11, 50, -49, -49, 50, 50, 50, 50, 50, 50, |
626 | -49, -49, -49, -49, -49, -49, -49, -49, -49 | 635 | 50, 50, 50, 50, 50, 50, 50, 50 |
627 | 636 | ||
628 | }, | 637 | }, |
629 | 638 | ||
630 | { | 639 | { |
631 | 11, 51, -50, -50, 51, 51, 51, 51, 51, 51, | 640 | 11, -50, -50, -50, -50, -50, -50, -50, -50, -50, |
632 | 51, 51, 51, 51, 51, 51, 51, 51, 51 | 641 | -50, -50, -50, -50, -50, -50, -50, -50 |
633 | }, | 642 | }, |
634 | 643 | ||
635 | { | 644 | { |
636 | 11, -51, -51, -51, -51, -51, -51, -51, -51, -51, | 645 | 11, 51, 51, 52, 51, -51, 51, 51, -51, 51, |
637 | -51, -51, -51, -51, -51, -51, -51, -51, -51 | 646 | 51, 51, 51, 51, 51, 51, -51, 51 |
638 | }, | 647 | }, |
639 | 648 | ||
640 | { | 649 | { |
641 | 11, 52, 52, 53, 52, -52, 52, 52, -52, 52, | 650 | 11, -52, -52, -52, -52, -52, -52, -52, -52, -52, |
642 | 52, 52, 52, 52, 52, 52, 52, -52, 52 | 651 | -52, -52, -52, -52, -52, -52, -52, -52 |
643 | }, | 652 | }, |
644 | 653 | ||
645 | { | 654 | { |
646 | 11, -53, -53, -53, -53, -53, -53, -53, -53, -53, | 655 | 11, -53, -53, 54, -53, -53, -53, -53, -53, -53, |
647 | -53, -53, -53, -53, -53, -53, -53, -53, -53 | 656 | -53, -53, -53, -53, -53, -53, -53, -53 |
648 | }, | 657 | }, |
649 | 658 | ||
650 | { | 659 | { |
651 | 11, -54, -54, 55, -54, -54, -54, -54, -54, -54, | 660 | 11, -54, -54, -54, -54, -54, -54, -54, -54, -54, |
652 | -54, -54, -54, -54, -54, -54, -54, -54, -54 | 661 | -54, -54, -54, -54, -54, -54, -54, -54 |
653 | 662 | ||
654 | }, | 663 | }, |
655 | 664 | ||
656 | { | 665 | { |
657 | 11, -55, -55, -55, -55, -55, -55, -55, -55, -55, | 666 | 11, -55, 55, -55, -55, -55, -55, -55, -55, -55, |
658 | -55, -55, -55, -55, -55, -55, -55, -55, -55 | 667 | -55, -55, -55, -55, -55, -55, -55, -55 |
659 | }, | 668 | }, |
660 | 669 | ||
661 | { | 670 | { |
662 | 11, -56, 56, -56, -56, -56, -56, -56, -56, -56, | 671 | 11, -56, -56, -56, -56, -56, -56, -56, -56, -56, |
663 | -56, -56, -56, -56, -56, -56, -56, -56, -56 | 672 | -56, -56, -56, -56, -56, -56, -56, -56 |
664 | }, | 673 | }, |
665 | 674 | ||
666 | { | 675 | { |
667 | 11, -57, -57, -57, -57, -57, -57, -57, -57, -57, | 676 | 11, 57, 57, -57, 57, 57, 57, 57, 57, 57, |
668 | -57, -57, -57, -57, -57, -57, -57, -57, -57 | 677 | 57, 57, 57, 57, 57, 57, 57, 57 |
669 | }, | 678 | }, |
670 | 679 | ||
671 | { | 680 | { |
672 | 11, 58, 58, -58, 58, 58, 58, 58, 58, 58, | 681 | 11, -58, -58, -58, -58, -58, -58, -58, -58, -58, |
673 | 58, 58, 58, 58, 58, 58, 58, 58, 58 | 682 | -58, -58, -58, -58, -58, -58, -58, -58 |
674 | }, | 683 | }, |
675 | 684 | ||
676 | { | 685 | { |
677 | 11, -59, -59, -59, -59, -59, -59, -59, -59, -59, | 686 | 11, -59, -59, -59, -59, -59, -59, -59, -59, -59, |
678 | -59, -59, -59, -59, -59, -59, -59, -59, -59 | 687 | -59, 59, 59, -59, -59, -59, -59, -59 |
679 | 688 | ||
680 | }, | 689 | }, |
681 | 690 | ||
682 | { | 691 | { |
683 | 11, -60, -60, -60, -60, -60, -60, -60, -60, -60, | 692 | 11, -60, -60, -60, -60, -60, -60, -60, -60, -60, |
684 | -60, 66, 61, 61, -60, -60, -60, -60, -60 | 693 | -60, -60, -60, -60, -60, -60, -60, -60 |
685 | }, | 694 | }, |
686 | 695 | ||
687 | { | 696 | { |
688 | 11, -61, -61, -61, -61, -61, -61, -61, -61, -61, | 697 | 11, -61, -61, -61, -61, -61, -61, -61, -61, -61, |
689 | -61, 61, 61, 61, -61, -61, -61, -61, -61 | 698 | -61, -61, -61, -61, -61, -61, -61, -61 |
690 | }, | 699 | }, |
691 | 700 | ||
692 | { | 701 | { |
693 | 11, -62, -62, -62, -62, -62, -62, -62, -62, -62, | 702 | 11, -62, -62, -62, -62, -62, -62, -62, -62, -62, |
694 | -62, -62, -62, -62, -62, -62, -62, -62, -62 | 703 | -62, -62, -62, -62, -62, -62, -62, -62 |
695 | }, | 704 | }, |
696 | 705 | ||
697 | { | 706 | { |
698 | 11, -63, -63, -63, -63, -63, -63, -63, -63, -63, | 707 | 11, -63, -63, -63, -63, -63, -63, -63, -63, -63, |
699 | -63, -63, -63, -63, -63, -63, -63, -63, -63 | 708 | -63, -63, -63, -63, -63, -63, -63, -63 |
700 | }, | ||
701 | |||
702 | { | ||
703 | 11, -64, -64, -64, -64, -64, -64, -64, -64, -64, | ||
704 | -64, -64, -64, -64, -64, -64, -64, -64, -64 | ||
705 | |||
706 | }, | ||
707 | |||
708 | { | ||
709 | 11, -65, -65, -65, -65, -65, -65, -65, -65, -65, | ||
710 | -65, -65, -65, -65, -65, -65, -65, -65, -65 | ||
711 | }, | ||
712 | |||
713 | { | ||
714 | 11, -66, -66, -66, -66, -66, -66, -66, -66, -66, | ||
715 | -66, 61, 61, 61, -66, -66, -66, -66, -66 | ||
716 | }, | 709 | }, |
717 | 710 | ||
718 | } ; | 711 | } ; |
@@ -732,8 +725,8 @@ static void yy_fatal_error (yyconst char msg[] ); | |||
732 | *yy_cp = '\0'; \ | 725 | *yy_cp = '\0'; \ |
733 | (yy_c_buf_p) = yy_cp; | 726 | (yy_c_buf_p) = yy_cp; |
734 | 727 | ||
735 | #define YY_NUM_RULES 38 | 728 | #define YY_NUM_RULES 37 |
736 | #define YY_END_OF_BUFFER 39 | 729 | #define YY_END_OF_BUFFER 38 |
737 | /* This struct is not used in this scanner, | 730 | /* This struct is not used in this scanner, |
738 | but its presence is necessary. */ | 731 | but its presence is necessary. */ |
739 | struct yy_trans_info | 732 | struct yy_trans_info |
@@ -741,15 +734,15 @@ struct yy_trans_info | |||
741 | flex_int32_t yy_verify; | 734 | flex_int32_t yy_verify; |
742 | flex_int32_t yy_nxt; | 735 | flex_int32_t yy_nxt; |
743 | }; | 736 | }; |
744 | static yyconst flex_int16_t yy_accept[67] = | 737 | static yyconst flex_int16_t yy_accept[64] = |
745 | { 0, | 738 | { 0, |
746 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 739 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
747 | 39, 5, 4, 2, 3, 7, 8, 6, 37, 34, | 740 | 38, 5, 4, 2, 3, 7, 8, 6, 36, 33, |
748 | 36, 29, 33, 32, 31, 27, 26, 21, 13, 20, | 741 | 35, 28, 32, 31, 30, 26, 25, 21, 13, 20, |
749 | 24, 27, 11, 12, 23, 23, 18, 14, 19, 27, | 742 | 23, 26, 11, 12, 22, 18, 14, 19, 26, 26, |
750 | 27, 4, 2, 3, 3, 1, 6, 37, 34, 36, | 743 | 4, 2, 3, 3, 1, 6, 36, 33, 35, 34, |
751 | 35, 29, 28, 31, 30, 26, 15, 24, 9, 23, | 744 | 28, 27, 30, 29, 25, 15, 23, 9, 22, 16, |
752 | 23, 16, 17, 25, 10, 22 | 745 | 17, 24, 10 |
753 | } ; | 746 | } ; |
754 | 747 | ||
755 | static yyconst flex_int32_t yy_ec[256] = | 748 | static yyconst flex_int32_t yy_ec[256] = |
@@ -758,16 +751,16 @@ static yyconst flex_int32_t yy_ec[256] = | |||
758 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | 751 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
759 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | 752 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
760 | 1, 2, 4, 5, 6, 1, 1, 7, 8, 9, | 753 | 1, 2, 4, 5, 6, 1, 1, 7, 8, 9, |
761 | 10, 1, 1, 1, 11, 12, 12, 13, 13, 13, | 754 | 10, 1, 1, 1, 11, 12, 12, 11, 11, 11, |
762 | 13, 13, 13, 13, 13, 13, 13, 1, 1, 14, | 755 | 11, 11, 11, 11, 11, 11, 11, 1, 1, 13, |
763 | 15, 16, 1, 1, 13, 13, 13, 13, 13, 13, | 756 | 14, 15, 1, 1, 11, 11, 11, 11, 11, 11, |
764 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | 757 | 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, |
765 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | 758 | 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, |
766 | 1, 17, 1, 1, 13, 1, 13, 13, 13, 13, | 759 | 1, 16, 1, 1, 11, 1, 11, 11, 11, 11, |
767 | 760 | ||
768 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | 761 | 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, |
769 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | 762 | 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, |
770 | 13, 13, 1, 18, 1, 1, 1, 1, 1, 1, | 763 | 11, 11, 1, 17, 1, 1, 1, 1, 1, 1, |
771 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | 764 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
772 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | 765 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
773 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | 766 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
@@ -861,6 +854,13 @@ static void alloc_string(const char *str, int size) | |||
861 | text[size] = 0; | 854 | text[size] = 0; |
862 | } | 855 | } |
863 | 856 | ||
857 | static void warn_ignored_character(char chr) | ||
858 | { | ||
859 | fprintf(stderr, | ||
860 | "%s:%d:warning: ignoring unsupported character '%c'\n", | ||
861 | zconf_curname(), zconf_lineno(), chr); | ||
862 | } | ||
863 | |||
864 | #define INITIAL 0 | 864 | #define INITIAL 0 |
865 | #define COMMAND 1 | 865 | #define COMMAND 1 |
866 | #define HELP 2 | 866 | #define HELP 2 |
@@ -944,7 +944,12 @@ static int input (void ); | |||
944 | 944 | ||
945 | /* Amount of stuff to slurp up with each read. */ | 945 | /* Amount of stuff to slurp up with each read. */ |
946 | #ifndef YY_READ_BUF_SIZE | 946 | #ifndef YY_READ_BUF_SIZE |
947 | #ifdef __ia64__ | ||
948 | /* On IA-64, the buffer size is 16k, not 8k */ | ||
949 | #define YY_READ_BUF_SIZE 16384 | ||
950 | #else | ||
947 | #define YY_READ_BUF_SIZE 8192 | 951 | #define YY_READ_BUF_SIZE 8192 |
952 | #endif /* __ia64__ */ | ||
948 | #endif | 953 | #endif |
949 | 954 | ||
950 | /* Copy whatever the last rule matched to the standard output. */ | 955 | /* Copy whatever the last rule matched to the standard output. */ |
@@ -952,7 +957,7 @@ static int input (void ); | |||
952 | /* This used to be an fputs(), but since the string might contain NUL's, | 957 | /* This used to be an fputs(), but since the string might contain NUL's, |
953 | * we now use fwrite(). | 958 | * we now use fwrite(). |
954 | */ | 959 | */ |
955 | #define ECHO fwrite( zconftext, zconfleng, 1, zconfout ) | 960 | #define ECHO do { if (fwrite( zconftext, zconfleng, 1, zconfout )) {} } while (0) |
956 | #endif | 961 | #endif |
957 | 962 | ||
958 | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, | 963 | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
@@ -1132,7 +1137,7 @@ YY_RULE_SETUP | |||
1132 | YY_BREAK | 1137 | YY_BREAK |
1133 | case 7: | 1138 | case 7: |
1134 | YY_RULE_SETUP | 1139 | YY_RULE_SETUP |
1135 | 1140 | warn_ignored_character(*zconftext); | |
1136 | YY_BREAK | 1141 | YY_BREAK |
1137 | case 8: | 1142 | case 8: |
1138 | /* rule 8 can match eol */ | 1143 | /* rule 8 can match eol */ |
@@ -1203,10 +1208,6 @@ BEGIN(INITIAL); current_file->lineno++; return T_EOL; | |||
1203 | YY_BREAK | 1208 | YY_BREAK |
1204 | case 22: | 1209 | case 22: |
1205 | YY_RULE_SETUP | 1210 | YY_RULE_SETUP |
1206 | /* ignore */ | ||
1207 | YY_BREAK | ||
1208 | case 23: | ||
1209 | YY_RULE_SETUP | ||
1210 | { | 1211 | { |
1211 | const struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng); | 1212 | const struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng); |
1212 | if (id && id->flags & TF_PARAM) { | 1213 | if (id && id->flags & TF_PARAM) { |
@@ -1218,26 +1219,22 @@ YY_RULE_SETUP | |||
1218 | return T_WORD; | 1219 | return T_WORD; |
1219 | } | 1220 | } |
1220 | YY_BREAK | 1221 | YY_BREAK |
1221 | case 24: | 1222 | case 23: |
1222 | YY_RULE_SETUP | 1223 | YY_RULE_SETUP |
1223 | /* comment */ | 1224 | /* comment */ |
1224 | YY_BREAK | 1225 | YY_BREAK |
1225 | case 25: | 1226 | case 24: |
1226 | /* rule 25 can match eol */ | 1227 | /* rule 24 can match eol */ |
1227 | YY_RULE_SETUP | 1228 | YY_RULE_SETUP |
1228 | current_file->lineno++; | 1229 | current_file->lineno++; |
1229 | YY_BREAK | 1230 | YY_BREAK |
1230 | case 26: | 1231 | case 25: |
1231 | YY_RULE_SETUP | 1232 | YY_RULE_SETUP |
1232 | 1233 | ||
1233 | YY_BREAK | 1234 | YY_BREAK |
1234 | case 27: | 1235 | case 26: |
1235 | YY_RULE_SETUP | 1236 | YY_RULE_SETUP |
1236 | { | 1237 | warn_ignored_character(*zconftext); |
1237 | fprintf(stderr, | ||
1238 | "%s:%d:warning: ignoring unsupported character '%c'\n", | ||
1239 | zconf_curname(), zconf_lineno(), *zconftext); | ||
1240 | } | ||
1241 | YY_BREAK | 1238 | YY_BREAK |
1242 | case YY_STATE_EOF(PARAM): | 1239 | case YY_STATE_EOF(PARAM): |
1243 | { | 1240 | { |
@@ -1245,8 +1242,8 @@ case YY_STATE_EOF(PARAM): | |||
1245 | } | 1242 | } |
1246 | YY_BREAK | 1243 | YY_BREAK |
1247 | 1244 | ||
1248 | case 28: | 1245 | case 27: |
1249 | /* rule 28 can match eol */ | 1246 | /* rule 27 can match eol */ |
1250 | *yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */ | 1247 | *yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */ |
1251 | (yy_c_buf_p) = yy_cp -= 1; | 1248 | (yy_c_buf_p) = yy_cp -= 1; |
1252 | YY_DO_BEFORE_ACTION; /* set up zconftext again */ | 1249 | YY_DO_BEFORE_ACTION; /* set up zconftext again */ |
@@ -1257,14 +1254,14 @@ YY_RULE_SETUP | |||
1257 | return T_WORD_QUOTE; | 1254 | return T_WORD_QUOTE; |
1258 | } | 1255 | } |
1259 | YY_BREAK | 1256 | YY_BREAK |
1260 | case 29: | 1257 | case 28: |
1261 | YY_RULE_SETUP | 1258 | YY_RULE_SETUP |
1262 | { | 1259 | { |
1263 | append_string(zconftext, zconfleng); | 1260 | append_string(zconftext, zconfleng); |
1264 | } | 1261 | } |
1265 | YY_BREAK | 1262 | YY_BREAK |
1266 | case 30: | 1263 | case 29: |
1267 | /* rule 30 can match eol */ | 1264 | /* rule 29 can match eol */ |
1268 | *yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */ | 1265 | *yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */ |
1269 | (yy_c_buf_p) = yy_cp -= 1; | 1266 | (yy_c_buf_p) = yy_cp -= 1; |
1270 | YY_DO_BEFORE_ACTION; /* set up zconftext again */ | 1267 | YY_DO_BEFORE_ACTION; /* set up zconftext again */ |
@@ -1275,13 +1272,13 @@ YY_RULE_SETUP | |||
1275 | return T_WORD_QUOTE; | 1272 | return T_WORD_QUOTE; |
1276 | } | 1273 | } |
1277 | YY_BREAK | 1274 | YY_BREAK |
1278 | case 31: | 1275 | case 30: |
1279 | YY_RULE_SETUP | 1276 | YY_RULE_SETUP |
1280 | { | 1277 | { |
1281 | append_string(zconftext + 1, zconfleng - 1); | 1278 | append_string(zconftext + 1, zconfleng - 1); |
1282 | } | 1279 | } |
1283 | YY_BREAK | 1280 | YY_BREAK |
1284 | case 32: | 1281 | case 31: |
1285 | YY_RULE_SETUP | 1282 | YY_RULE_SETUP |
1286 | { | 1283 | { |
1287 | if (str == zconftext[0]) { | 1284 | if (str == zconftext[0]) { |
@@ -1292,8 +1289,8 @@ YY_RULE_SETUP | |||
1292 | append_string(zconftext, 1); | 1289 | append_string(zconftext, 1); |
1293 | } | 1290 | } |
1294 | YY_BREAK | 1291 | YY_BREAK |
1295 | case 33: | 1292 | case 32: |
1296 | /* rule 33 can match eol */ | 1293 | /* rule 32 can match eol */ |
1297 | YY_RULE_SETUP | 1294 | YY_RULE_SETUP |
1298 | { | 1295 | { |
1299 | printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno()); | 1296 | printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno()); |
@@ -1308,7 +1305,7 @@ case YY_STATE_EOF(STRING): | |||
1308 | } | 1305 | } |
1309 | YY_BREAK | 1306 | YY_BREAK |
1310 | 1307 | ||
1311 | case 34: | 1308 | case 33: |
1312 | YY_RULE_SETUP | 1309 | YY_RULE_SETUP |
1313 | { | 1310 | { |
1314 | ts = 0; | 1311 | ts = 0; |
@@ -1333,8 +1330,8 @@ YY_RULE_SETUP | |||
1333 | } | 1330 | } |
1334 | } | 1331 | } |
1335 | YY_BREAK | 1332 | YY_BREAK |
1336 | case 35: | 1333 | case 34: |
1337 | /* rule 35 can match eol */ | 1334 | /* rule 34 can match eol */ |
1338 | *yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */ | 1335 | *yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */ |
1339 | (yy_c_buf_p) = yy_cp -= 1; | 1336 | (yy_c_buf_p) = yy_cp -= 1; |
1340 | YY_DO_BEFORE_ACTION; /* set up zconftext again */ | 1337 | YY_DO_BEFORE_ACTION; /* set up zconftext again */ |
@@ -1345,15 +1342,15 @@ YY_RULE_SETUP | |||
1345 | return T_HELPTEXT; | 1342 | return T_HELPTEXT; |
1346 | } | 1343 | } |
1347 | YY_BREAK | 1344 | YY_BREAK |
1348 | case 36: | 1345 | case 35: |
1349 | /* rule 36 can match eol */ | 1346 | /* rule 35 can match eol */ |
1350 | YY_RULE_SETUP | 1347 | YY_RULE_SETUP |
1351 | { | 1348 | { |
1352 | current_file->lineno++; | 1349 | current_file->lineno++; |
1353 | append_string("\n", 1); | 1350 | append_string("\n", 1); |
1354 | } | 1351 | } |
1355 | YY_BREAK | 1352 | YY_BREAK |
1356 | case 37: | 1353 | case 36: |
1357 | YY_RULE_SETUP | 1354 | YY_RULE_SETUP |
1358 | { | 1355 | { |
1359 | while (zconfleng) { | 1356 | while (zconfleng) { |
@@ -1384,7 +1381,7 @@ case YY_STATE_EOF(COMMAND): | |||
1384 | yyterminate(); | 1381 | yyterminate(); |
1385 | } | 1382 | } |
1386 | YY_BREAK | 1383 | YY_BREAK |
1387 | case 38: | 1384 | case 37: |
1388 | YY_RULE_SETUP | 1385 | YY_RULE_SETUP |
1389 | YY_FATAL_ERROR( "flex scanner jammed" ); | 1386 | YY_FATAL_ERROR( "flex scanner jammed" ); |
1390 | YY_BREAK | 1387 | YY_BREAK |
@@ -2114,8 +2111,8 @@ YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr ) | |||
2114 | 2111 | ||
2115 | /** Setup the input buffer state to scan the given bytes. The next call to zconflex() will | 2112 | /** Setup the input buffer state to scan the given bytes. The next call to zconflex() will |
2116 | * scan from a @e copy of @a bytes. | 2113 | * scan from a @e copy of @a bytes. |
2117 | * @param bytes the byte buffer to scan | 2114 | * @param yybytes the byte buffer to scan |
2118 | * @param len the number of bytes in the buffer pointed to by @a bytes. | 2115 | * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. |
2119 | * | 2116 | * |
2120 | * @return the newly allocated buffer state object. | 2117 | * @return the newly allocated buffer state object. |
2121 | */ | 2118 | */ |
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 9922e66883a5..9a08fb5c1af6 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -133,6 +133,30 @@ use strict; | |||
133 | # | 133 | # |
134 | # All descriptions can be multiline, except the short function description. | 134 | # All descriptions can be multiline, except the short function description. |
135 | # | 135 | # |
136 | # For really longs structs, you can also describe arguments inside the | ||
137 | # body of the struct. | ||
138 | # eg. | ||
139 | # /** | ||
140 | # * struct my_struct - short description | ||
141 | # * @a: first member | ||
142 | # * @b: second member | ||
143 | # * | ||
144 | # * Longer description | ||
145 | # */ | ||
146 | # struct my_struct { | ||
147 | # int a; | ||
148 | # int b; | ||
149 | # /** | ||
150 | # * @c: This is longer description of C | ||
151 | # * | ||
152 | # * You can use paragraphs to describe arguments | ||
153 | # * using this method. | ||
154 | # */ | ||
155 | # int c; | ||
156 | # }; | ||
157 | # | ||
158 | # This should be use only for struct/enum members. | ||
159 | # | ||
136 | # You can also add additional sections. When documenting kernel functions you | 160 | # You can also add additional sections. When documenting kernel functions you |
137 | # should document the "Context:" of the function, e.g. whether the functions | 161 | # should document the "Context:" of the function, e.g. whether the functions |
138 | # can be called form interrupts. Unlike other sections you can end it with an | 162 | # can be called form interrupts. Unlike other sections you can end it with an |
@@ -253,11 +277,20 @@ my %highlights = %highlights_man; | |||
253 | my $blankline = $blankline_man; | 277 | my $blankline = $blankline_man; |
254 | my $modulename = "Kernel API"; | 278 | my $modulename = "Kernel API"; |
255 | my $function_only = 0; | 279 | my $function_only = 0; |
280 | my $show_not_found = 0; | ||
281 | |||
282 | my @build_time; | ||
283 | if (defined($ENV{'KBUILD_BUILD_TIMESTAMP'}) && | ||
284 | (my $seconds = `date -d"${ENV{'KBUILD_BUILD_TIMESTAMP'}}" +%s`) ne '') { | ||
285 | @build_time = gmtime($seconds); | ||
286 | } else { | ||
287 | @build_time = localtime; | ||
288 | } | ||
289 | |||
256 | my $man_date = ('January', 'February', 'March', 'April', 'May', 'June', | 290 | my $man_date = ('January', 'February', 'March', 'April', 'May', 'June', |
257 | 'July', 'August', 'September', 'October', | 291 | 'July', 'August', 'September', 'October', |
258 | 'November', 'December')[(localtime)[4]] . | 292 | 'November', 'December')[$build_time[4]] . |
259 | " " . ((localtime)[5]+1900); | 293 | " " . ($build_time[5]+1900); |
260 | my $show_not_found = 0; | ||
261 | 294 | ||
262 | # Essentially these are globals. | 295 | # Essentially these are globals. |
263 | # They probably want to be tidied up, made more localised or something. | 296 | # They probably want to be tidied up, made more localised or something. |
@@ -287,9 +320,19 @@ my $lineprefix=""; | |||
287 | # 2 - scanning field start. | 320 | # 2 - scanning field start. |
288 | # 3 - scanning prototype. | 321 | # 3 - scanning prototype. |
289 | # 4 - documentation block | 322 | # 4 - documentation block |
323 | # 5 - gathering documentation outside main block | ||
290 | my $state; | 324 | my $state; |
291 | my $in_doc_sect; | 325 | my $in_doc_sect; |
292 | 326 | ||
327 | # Split Doc State | ||
328 | # 0 - Invalid (Before start or after finish) | ||
329 | # 1 - Is started (the /** was found inside a struct) | ||
330 | # 2 - The @parameter header was found, start accepting multi paragraph text. | ||
331 | # 3 - Finished (the */ was found) | ||
332 | # 4 - Error - Comment without header was found. Spit a warning as it's not | ||
333 | # proper kernel-doc and ignore the rest. | ||
334 | my $split_doc_state; | ||
335 | |||
293 | #declaration types: can be | 336 | #declaration types: can be |
294 | # 'function', 'struct', 'union', 'enum', 'typedef' | 337 | # 'function', 'struct', 'union', 'enum', 'typedef' |
295 | my $decl_type; | 338 | my $decl_type; |
@@ -304,6 +347,9 @@ my $doc_decl = $doc_com . '(\w+)'; | |||
304 | my $doc_sect = $doc_com . '([' . $doc_special . ']?[\w\s]+):(.*)'; | 347 | my $doc_sect = $doc_com . '([' . $doc_special . ']?[\w\s]+):(.*)'; |
305 | my $doc_content = $doc_com_body . '(.*)'; | 348 | my $doc_content = $doc_com_body . '(.*)'; |
306 | my $doc_block = $doc_com . 'DOC:\s*(.*)?'; | 349 | my $doc_block = $doc_com . 'DOC:\s*(.*)?'; |
350 | my $doc_split_start = '^\s*/\*\*\s*$'; | ||
351 | my $doc_split_sect = '\s*\*\s*(@[\w\s]+):(.*)'; | ||
352 | my $doc_split_end = '^\s*\*/\s*$'; | ||
307 | 353 | ||
308 | my %constants; | 354 | my %constants; |
309 | my %parameterdescs; | 355 | my %parameterdescs; |
@@ -423,7 +469,7 @@ sub dump_section { | |||
423 | } else { | 469 | } else { |
424 | # print STDERR "other section '$name' = '$contents'\n"; | 470 | # print STDERR "other section '$name' = '$contents'\n"; |
425 | if (defined($sections{$name}) && ($sections{$name} ne "")) { | 471 | if (defined($sections{$name}) && ($sections{$name} ne "")) { |
426 | print STDERR "Error(${file}:$.): duplicate section name '$name'\n"; | 472 | print STDERR "${file}:$.: error: duplicate section name '$name'\n"; |
427 | ++$errors; | 473 | ++$errors; |
428 | } | 474 | } |
429 | $sections{$name} = $contents; | 475 | $sections{$name} = $contents; |
@@ -1753,7 +1799,9 @@ sub dump_struct($$) { | |||
1753 | # strip kmemcheck_bitfield_{begin,end}.*; | 1799 | # strip kmemcheck_bitfield_{begin,end}.*; |
1754 | $members =~ s/kmemcheck_bitfield_.*?;//gos; | 1800 | $members =~ s/kmemcheck_bitfield_.*?;//gos; |
1755 | # strip attributes | 1801 | # strip attributes |
1802 | $members =~ s/__attribute__\s*\(\([a-z,_\*\s\(\)]*\)\)//i; | ||
1756 | $members =~ s/__aligned\s*\([^;]*\)//gos; | 1803 | $members =~ s/__aligned\s*\([^;]*\)//gos; |
1804 | $members =~ s/\s*CRYPTO_MINALIGN_ATTR//gos; | ||
1757 | 1805 | ||
1758 | create_parameterlist($members, ';', $file); | 1806 | create_parameterlist($members, ';', $file); |
1759 | check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested); | 1807 | check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested); |
@@ -1772,7 +1820,7 @@ sub dump_struct($$) { | |||
1772 | }); | 1820 | }); |
1773 | } | 1821 | } |
1774 | else { | 1822 | else { |
1775 | print STDERR "Error(${file}:$.): Cannot parse struct or union!\n"; | 1823 | print STDERR "${file}:$.: error: Cannot parse struct or union!\n"; |
1776 | ++$errors; | 1824 | ++$errors; |
1777 | } | 1825 | } |
1778 | } | 1826 | } |
@@ -1793,7 +1841,7 @@ sub dump_enum($$) { | |||
1793 | push @parameterlist, $arg; | 1841 | push @parameterlist, $arg; |
1794 | if (!$parameterdescs{$arg}) { | 1842 | if (!$parameterdescs{$arg}) { |
1795 | $parameterdescs{$arg} = $undescribed; | 1843 | $parameterdescs{$arg} = $undescribed; |
1796 | print STDERR "Warning(${file}:$.): Enum value '$arg' ". | 1844 | print STDERR "${file}:$.: warning: Enum value '$arg' ". |
1797 | "not described in enum '$declaration_name'\n"; | 1845 | "not described in enum '$declaration_name'\n"; |
1798 | } | 1846 | } |
1799 | 1847 | ||
@@ -1811,7 +1859,7 @@ sub dump_enum($$) { | |||
1811 | }); | 1859 | }); |
1812 | } | 1860 | } |
1813 | else { | 1861 | else { |
1814 | print STDERR "Error(${file}:$.): Cannot parse enum!\n"; | 1862 | print STDERR "${file}:$.: error: Cannot parse enum!\n"; |
1815 | ++$errors; | 1863 | ++$errors; |
1816 | } | 1864 | } |
1817 | } | 1865 | } |
@@ -1839,7 +1887,7 @@ sub dump_typedef($$) { | |||
1839 | }); | 1887 | }); |
1840 | } | 1888 | } |
1841 | else { | 1889 | else { |
1842 | print STDERR "Error(${file}:$.): Cannot parse typedef!\n"; | 1890 | print STDERR "${file}:$.: error: Cannot parse typedef!\n"; |
1843 | ++$errors; | 1891 | ++$errors; |
1844 | } | 1892 | } |
1845 | } | 1893 | } |
@@ -1971,11 +2019,11 @@ sub push_parameter($$$) { | |||
1971 | $parameterdescs{$param_name} = $undescribed; | 2019 | $parameterdescs{$param_name} = $undescribed; |
1972 | 2020 | ||
1973 | if (($type eq 'function') || ($type eq 'enum')) { | 2021 | if (($type eq 'function') || ($type eq 'enum')) { |
1974 | print STDERR "Warning(${file}:$.): Function parameter ". | 2022 | print STDERR "${file}:$.: warning: Function parameter ". |
1975 | "or member '$param' not " . | 2023 | "or member '$param' not " . |
1976 | "described in '$declaration_name'\n"; | 2024 | "described in '$declaration_name'\n"; |
1977 | } | 2025 | } |
1978 | print STDERR "Warning(${file}:$.):" . | 2026 | print STDERR "${file}:$.: warning:" . |
1979 | " No description found for parameter '$param'\n"; | 2027 | " No description found for parameter '$param'\n"; |
1980 | ++$warnings; | 2028 | ++$warnings; |
1981 | } | 2029 | } |
@@ -2026,14 +2074,14 @@ sub check_sections($$$$$$) { | |||
2026 | } | 2074 | } |
2027 | if ($err) { | 2075 | if ($err) { |
2028 | if ($decl_type eq "function") { | 2076 | if ($decl_type eq "function") { |
2029 | print STDERR "Warning(${file}:$.): " . | 2077 | print STDERR "${file}:$.: warning: " . |
2030 | "Excess function parameter " . | 2078 | "Excess function parameter " . |
2031 | "'$sects[$sx]' " . | 2079 | "'$sects[$sx]' " . |
2032 | "description in '$decl_name'\n"; | 2080 | "description in '$decl_name'\n"; |
2033 | ++$warnings; | 2081 | ++$warnings; |
2034 | } else { | 2082 | } else { |
2035 | if ($nested !~ m/\Q$sects[$sx]\E/) { | 2083 | if ($nested !~ m/\Q$sects[$sx]\E/) { |
2036 | print STDERR "Warning(${file}:$.): " . | 2084 | print STDERR "${file}:$.: warning: " . |
2037 | "Excess struct/union/enum/typedef member " . | 2085 | "Excess struct/union/enum/typedef member " . |
2038 | "'$sects[$sx]' " . | 2086 | "'$sects[$sx]' " . |
2039 | "description in '$decl_name'\n"; | 2087 | "description in '$decl_name'\n"; |
@@ -2059,7 +2107,7 @@ sub check_return_section { | |||
2059 | 2107 | ||
2060 | if (!defined($sections{$section_return}) || | 2108 | if (!defined($sections{$section_return}) || |
2061 | $sections{$section_return} eq "") { | 2109 | $sections{$section_return} eq "") { |
2062 | print STDERR "Warning(${file}:$.): " . | 2110 | print STDERR "${file}:$.: warning: " . |
2063 | "No description found for return value of " . | 2111 | "No description found for return value of " . |
2064 | "'$declaration_name'\n"; | 2112 | "'$declaration_name'\n"; |
2065 | ++$warnings; | 2113 | ++$warnings; |
@@ -2138,7 +2186,7 @@ sub dump_function($$) { | |||
2138 | 2186 | ||
2139 | create_parameterlist($args, ',', $file); | 2187 | create_parameterlist($args, ',', $file); |
2140 | } else { | 2188 | } else { |
2141 | print STDERR "Warning(${file}:$.): cannot understand function prototype: '$prototype'\n"; | 2189 | print STDERR "${file}:$.: warning: cannot understand function prototype: '$prototype'\n"; |
2142 | return; | 2190 | return; |
2143 | } | 2191 | } |
2144 | 2192 | ||
@@ -2181,6 +2229,7 @@ sub reset_state { | |||
2181 | $prototype = ""; | 2229 | $prototype = ""; |
2182 | 2230 | ||
2183 | $state = 0; | 2231 | $state = 0; |
2232 | $split_doc_state = 0; | ||
2184 | } | 2233 | } |
2185 | 2234 | ||
2186 | sub tracepoint_munge($) { | 2235 | sub tracepoint_munge($) { |
@@ -2202,7 +2251,7 @@ sub tracepoint_munge($) { | |||
2202 | $tracepointargs = $1; | 2251 | $tracepointargs = $1; |
2203 | } | 2252 | } |
2204 | if (($tracepointname eq 0) || ($tracepointargs eq 0)) { | 2253 | if (($tracepointname eq 0) || ($tracepointargs eq 0)) { |
2205 | print STDERR "Warning(${file}:$.): Unrecognized tracepoint format: \n". | 2254 | print STDERR "${file}:$.: warning: Unrecognized tracepoint format: \n". |
2206 | "$prototype\n"; | 2255 | "$prototype\n"; |
2207 | } else { | 2256 | } else { |
2208 | $prototype = "static inline void trace_$tracepointname($tracepointargs)"; | 2257 | $prototype = "static inline void trace_$tracepointname($tracepointargs)"; |
@@ -2401,7 +2450,7 @@ sub process_file($) { | |||
2401 | } | 2450 | } |
2402 | 2451 | ||
2403 | if (($declaration_purpose eq "") && $verbose) { | 2452 | if (($declaration_purpose eq "") && $verbose) { |
2404 | print STDERR "Warning(${file}:$.): missing initial short description on line:\n"; | 2453 | print STDERR "${file}:$.: warning: missing initial short description on line:\n"; |
2405 | print STDERR $_; | 2454 | print STDERR $_; |
2406 | ++$warnings; | 2455 | ++$warnings; |
2407 | } | 2456 | } |
@@ -2419,10 +2468,10 @@ sub process_file($) { | |||
2419 | } | 2468 | } |
2420 | 2469 | ||
2421 | if ($verbose) { | 2470 | if ($verbose) { |
2422 | print STDERR "Info(${file}:$.): Scanning doc for $identifier\n"; | 2471 | print STDERR "${file}:$.: info: Scanning doc for $identifier\n"; |
2423 | } | 2472 | } |
2424 | } else { | 2473 | } else { |
2425 | print STDERR "Warning(${file}:$.): Cannot understand $_ on line $.", | 2474 | print STDERR "${file}:$.: warning: Cannot understand $_ on line $.", |
2426 | " - I thought it was a doc line\n"; | 2475 | " - I thought it was a doc line\n"; |
2427 | ++$warnings; | 2476 | ++$warnings; |
2428 | $state = 0; | 2477 | $state = 0; |
@@ -2434,7 +2483,7 @@ sub process_file($) { | |||
2434 | 2483 | ||
2435 | if (($contents ne "") && ($contents ne "\n")) { | 2484 | if (($contents ne "") && ($contents ne "\n")) { |
2436 | if (!$in_doc_sect && $verbose) { | 2485 | if (!$in_doc_sect && $verbose) { |
2437 | print STDERR "Warning(${file}:$.): contents before sections\n"; | 2486 | print STDERR "${file}:$.: warning: contents before sections\n"; |
2438 | ++$warnings; | 2487 | ++$warnings; |
2439 | } | 2488 | } |
2440 | dump_section($file, $section, xml_escape($contents)); | 2489 | dump_section($file, $section, xml_escape($contents)); |
@@ -2453,7 +2502,6 @@ sub process_file($) { | |||
2453 | } | 2502 | } |
2454 | $section = $newsection; | 2503 | $section = $newsection; |
2455 | } elsif (/$doc_end/) { | 2504 | } elsif (/$doc_end/) { |
2456 | |||
2457 | if (($contents ne "") && ($contents ne "\n")) { | 2505 | if (($contents ne "") && ($contents ne "\n")) { |
2458 | dump_section($file, $section, xml_escape($contents)); | 2506 | dump_section($file, $section, xml_escape($contents)); |
2459 | $section = $section_default; | 2507 | $section = $section_default; |
@@ -2461,7 +2509,7 @@ sub process_file($) { | |||
2461 | } | 2509 | } |
2462 | # look for doc_com + <text> + doc_end: | 2510 | # look for doc_com + <text> + doc_end: |
2463 | if ($_ =~ m'\s*\*\s*[a-zA-Z_0-9:\.]+\*/') { | 2511 | if ($_ =~ m'\s*\*\s*[a-zA-Z_0-9:\.]+\*/') { |
2464 | print STDERR "Warning(${file}:$.): suspicious ending line: $_"; | 2512 | print STDERR "${file}:$.: warning: suspicious ending line: $_"; |
2465 | ++$warnings; | 2513 | ++$warnings; |
2466 | } | 2514 | } |
2467 | 2515 | ||
@@ -2491,11 +2539,47 @@ sub process_file($) { | |||
2491 | } | 2539 | } |
2492 | } else { | 2540 | } else { |
2493 | # i dont know - bad line? ignore. | 2541 | # i dont know - bad line? ignore. |
2494 | print STDERR "Warning(${file}:$.): bad line: $_"; | 2542 | print STDERR "${file}:$.: warning: bad line: $_"; |
2495 | ++$warnings; | 2543 | ++$warnings; |
2496 | } | 2544 | } |
2545 | } elsif ($state == 5) { # scanning for split parameters | ||
2546 | # First line (state 1) needs to be a @parameter | ||
2547 | if ($split_doc_state == 1 && /$doc_split_sect/o) { | ||
2548 | $section = $1; | ||
2549 | $contents = $2; | ||
2550 | if ($contents ne "") { | ||
2551 | while ((substr($contents, 0, 1) eq " ") || | ||
2552 | substr($contents, 0, 1) eq "\t") { | ||
2553 | $contents = substr($contents, 1); | ||
2554 | } | ||
2555 | $contents .= "\n"; | ||
2556 | } | ||
2557 | $split_doc_state = 2; | ||
2558 | # Documentation block end */ | ||
2559 | } elsif (/$doc_split_end/) { | ||
2560 | if (($contents ne "") && ($contents ne "\n")) { | ||
2561 | dump_section($file, $section, xml_escape($contents)); | ||
2562 | $section = $section_default; | ||
2563 | $contents = ""; | ||
2564 | } | ||
2565 | $state = 3; | ||
2566 | $split_doc_state = 0; | ||
2567 | # Regular text | ||
2568 | } elsif (/$doc_content/) { | ||
2569 | if ($split_doc_state == 2) { | ||
2570 | $contents .= $1 . "\n"; | ||
2571 | } elsif ($split_doc_state == 1) { | ||
2572 | $split_doc_state = 4; | ||
2573 | print STDERR "Warning(${file}:$.): "; | ||
2574 | print STDERR "Incorrect use of kernel-doc format: $_"; | ||
2575 | ++$warnings; | ||
2576 | } | ||
2577 | } | ||
2497 | } elsif ($state == 3) { # scanning for function '{' (end of prototype) | 2578 | } elsif ($state == 3) { # scanning for function '{' (end of prototype) |
2498 | if ($decl_type eq 'function') { | 2579 | if (/$doc_split_start/) { |
2580 | $state = 5; | ||
2581 | $split_doc_state = 1; | ||
2582 | } elsif ($decl_type eq 'function') { | ||
2499 | process_state3_function($_, $file); | 2583 | process_state3_function($_, $file); |
2500 | } else { | 2584 | } else { |
2501 | process_state3_type($_, $file); | 2585 | process_state3_type($_, $file); |
@@ -2547,7 +2631,7 @@ sub process_file($) { | |||
2547 | } | 2631 | } |
2548 | } | 2632 | } |
2549 | if ($initial_section_counter == $section_counter) { | 2633 | if ($initial_section_counter == $section_counter) { |
2550 | print STDERR "Warning(${file}): no structured comments found\n"; | 2634 | print STDERR "${file}:1: warning: no structured comments found\n"; |
2551 | if (($function_only == 1) && ($show_not_found == 1)) { | 2635 | if (($function_only == 1) && ($show_not_found == 1)) { |
2552 | print STDERR " Was looking for '$_'.\n" for keys %function_table; | 2636 | print STDERR " Was looking for '$_'.\n" for keys %function_table; |
2553 | } | 2637 | } |
@@ -2587,7 +2671,7 @@ $kernelversion = get_kernel_version(); | |||
2587 | 2671 | ||
2588 | # generate a sequence of code that will splice in highlighting information | 2672 | # generate a sequence of code that will splice in highlighting information |
2589 | # using the s// operator. | 2673 | # using the s// operator. |
2590 | foreach my $pattern (keys %highlights) { | 2674 | foreach my $pattern (sort keys %highlights) { |
2591 | # print STDERR "scanning pattern:$pattern, highlight:($highlights{$pattern})\n"; | 2675 | # print STDERR "scanning pattern:$pattern, highlight:($highlights{$pattern})\n"; |
2592 | $dohighlight .= "\$contents =~ s:$pattern:$highlights{$pattern}:gs;\n"; | 2676 | $dohighlight .= "\$contents =~ s:$pattern:$highlights{$pattern}:gs;\n"; |
2593 | } | 2677 | } |
diff --git a/scripts/kernel-doc-xml-ref b/scripts/kernel-doc-xml-ref new file mode 100755 index 000000000000..104a5a5ba2c8 --- /dev/null +++ b/scripts/kernel-doc-xml-ref | |||
@@ -0,0 +1,198 @@ | |||
1 | #!/usr/bin/perl -w | ||
2 | |||
3 | use strict; | ||
4 | |||
5 | ## Copyright (C) 2015 Intel Corporation ## | ||
6 | # ## | ||
7 | ## This software falls under the GNU General Public License. ## | ||
8 | ## Please read the COPYING file for more information ## | ||
9 | # | ||
10 | # | ||
11 | # This software reads a XML file and a list of valid interal | ||
12 | # references to replace Docbook tags with links. | ||
13 | # | ||
14 | # The list of "valid internal references" must be one-per-line in the following format: | ||
15 | # API-struct-foo | ||
16 | # API-enum-bar | ||
17 | # API-my-function | ||
18 | # | ||
19 | # The software walks over the XML file looking for xml tags representing possible references | ||
20 | # to the Document. Each reference will be cross checked against the "Valid Internal Reference" list. If | ||
21 | # the referece is found it replaces its content by a <link> tag. | ||
22 | # | ||
23 | # usage: | ||
24 | # kernel-doc-xml-ref -db filename | ||
25 | # xml filename > outputfile | ||
26 | |||
27 | # read arguments | ||
28 | if ($#ARGV != 2) { | ||
29 | usage(); | ||
30 | } | ||
31 | |||
32 | #Holds the database filename | ||
33 | my $databasefile; | ||
34 | my @database; | ||
35 | |||
36 | #holds the inputfile | ||
37 | my $inputfile; | ||
38 | my $errors = 0; | ||
39 | |||
40 | my %highlights = ( | ||
41 | "<function>(.*?)</function>", | ||
42 | "\"<function>\" . convert_function(\$1, \$line) . \"</function>\"", | ||
43 | "<structname>(.*?)</structname>", | ||
44 | "\"<structname>\" . convert_struct(\$1) . \"</structname>\"", | ||
45 | "<funcdef>(.*?)<function>(.*?)</function></funcdef>", | ||
46 | "\"<funcdef>\" . convert_param(\$1) . \"<function>\$2</function></funcdef>\"", | ||
47 | "<paramdef>(.*?)<parameter>(.*?)</parameter></paramdef>", | ||
48 | "\"<paramdef>\" . convert_param(\$1) . \"<parameter>\$2</parameter></paramdef>\""); | ||
49 | |||
50 | while($ARGV[0] =~ m/^-(.*)/) { | ||
51 | my $cmd = shift @ARGV; | ||
52 | if ($cmd eq "-db") { | ||
53 | $databasefile = shift @ARGV | ||
54 | } else { | ||
55 | usage(); | ||
56 | } | ||
57 | } | ||
58 | $inputfile = shift @ARGV; | ||
59 | |||
60 | sub open_database { | ||
61 | open (my $handle, '<', $databasefile) or die "Cannot open $databasefile"; | ||
62 | chomp(my @lines = <$handle>); | ||
63 | close $handle; | ||
64 | |||
65 | @database = @lines; | ||
66 | } | ||
67 | |||
68 | sub process_file { | ||
69 | open_database(); | ||
70 | |||
71 | my $dohighlight; | ||
72 | foreach my $pattern (keys %highlights) { | ||
73 | $dohighlight .= "\$line =~ s:$pattern:$highlights{$pattern}:eg;\n"; | ||
74 | } | ||
75 | |||
76 | open(FILE, $inputfile) or die("Could not open $inputfile") or die ("Cannot open $inputfile"); | ||
77 | foreach my $line (<FILE>) { | ||
78 | eval $dohighlight; | ||
79 | print $line; | ||
80 | } | ||
81 | } | ||
82 | |||
83 | sub trim($_) | ||
84 | { | ||
85 | my $str = $_[0]; | ||
86 | $str =~ s/^\s+|\s+$//g; | ||
87 | return $str | ||
88 | } | ||
89 | |||
90 | sub has_key_defined($_) | ||
91 | { | ||
92 | if ( grep( /^$_[0]$/, @database)) { | ||
93 | return 1; | ||
94 | } | ||
95 | return 0; | ||
96 | } | ||
97 | |||
98 | # Gets a <function> content and add it a hyperlink if possible. | ||
99 | sub convert_function($_) | ||
100 | { | ||
101 | my $arg = $_[0]; | ||
102 | my $key = $_[0]; | ||
103 | |||
104 | my $line = $_[1]; | ||
105 | |||
106 | $key = trim($key); | ||
107 | |||
108 | $key =~ s/[^A-Za-z0-9]/-/g; | ||
109 | $key = "API-" . $key; | ||
110 | |||
111 | # We shouldn't add links to <funcdef> prototype | ||
112 | if (!has_key_defined($key) || $line =~ m/\s+<funcdef/i) { | ||
113 | return $arg; | ||
114 | } | ||
115 | |||
116 | my $head = $arg; | ||
117 | my $tail = ""; | ||
118 | if ($arg =~ /(.*?)( ?)$/) { | ||
119 | $head = $1; | ||
120 | $tail = $2; | ||
121 | } | ||
122 | return "<link linkend=\"$key\">$head</link>$tail"; | ||
123 | } | ||
124 | |||
125 | # Converting a struct text to link | ||
126 | sub convert_struct($_) | ||
127 | { | ||
128 | my $arg = $_[0]; | ||
129 | my $key = $_[0]; | ||
130 | $key =~ s/(struct )?(\w)/$2/g; | ||
131 | $key =~ s/[^A-Za-z0-9]/-/g; | ||
132 | $key = "API-struct-" . $key; | ||
133 | |||
134 | if (!has_key_defined($key)) { | ||
135 | return $arg; | ||
136 | } | ||
137 | |||
138 | my ($head, $tail) = split_pointer($arg); | ||
139 | return "<link linkend=\"$key\">$head</link>$tail"; | ||
140 | } | ||
141 | |||
142 | # Identify "object *" elements | ||
143 | sub split_pointer($_) | ||
144 | { | ||
145 | my $arg = $_[0]; | ||
146 | if ($arg =~ /(.*?)( ?\* ?)/) { | ||
147 | return ($1, $2); | ||
148 | } | ||
149 | return ($arg, ""); | ||
150 | } | ||
151 | |||
152 | sub convert_param($_) | ||
153 | { | ||
154 | my $type = $_[0]; | ||
155 | my $keyname = convert_key_name($type); | ||
156 | |||
157 | if (!has_key_defined($keyname)) { | ||
158 | return $type; | ||
159 | } | ||
160 | |||
161 | my ($head, $tail) = split_pointer($type); | ||
162 | return "<link linkend=\"$keyname\">$head</link>$tail"; | ||
163 | |||
164 | } | ||
165 | |||
166 | # DocBook links are in the API-<TYPE>-<STRUCT-NAME> format | ||
167 | # This method gets an element and returns a valid DocBook reference for it. | ||
168 | sub convert_key_name($_) | ||
169 | { | ||
170 | #Pattern $2 is optional and might be uninitialized | ||
171 | no warnings 'uninitialized'; | ||
172 | |||
173 | my $str = $_[0]; | ||
174 | $str =~ s/(const|static)? ?(struct)? ?([a-zA-Z0-9_]+) ?(\*|&)?/$2 $3/g ; | ||
175 | |||
176 | # trim | ||
177 | $str =~ s/^\s+|\s+$//g; | ||
178 | |||
179 | # spaces and _ to - | ||
180 | $str =~ s/[^A-Za-z0-9]/-/g; | ||
181 | |||
182 | return "API-" . $str; | ||
183 | } | ||
184 | |||
185 | sub usage { | ||
186 | print "Usage: $0 -db database filename\n"; | ||
187 | print " xml source file(s) > outputfile\n"; | ||
188 | exit 1; | ||
189 | } | ||
190 | |||
191 | # starting point | ||
192 | process_file(); | ||
193 | |||
194 | if ($errors) { | ||
195 | print STDERR "$errors errors\n"; | ||
196 | } | ||
197 | |||
198 | exit($errors); | ||
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h index 168b43dc0a59..6a5e1515123b 100644 --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h | |||
@@ -11,6 +11,12 @@ | |||
11 | 11 | ||
12 | #include "elfconfig.h" | 12 | #include "elfconfig.h" |
13 | 13 | ||
14 | /* On BSD-alike OSes elf.h defines these according to host's word size */ | ||
15 | #undef ELF_ST_BIND | ||
16 | #undef ELF_ST_TYPE | ||
17 | #undef ELF_R_SYM | ||
18 | #undef ELF_R_TYPE | ||
19 | |||
14 | #if KERNEL_ELFCLASS == ELFCLASS32 | 20 | #if KERNEL_ELFCLASS == ELFCLASS32 |
15 | 21 | ||
16 | #define Elf_Ehdr Elf32_Ehdr | 22 | #define Elf_Ehdr Elf32_Ehdr |
diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 99ca6e76eb0a..1aca224e8597 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile | |||
@@ -21,37 +21,38 @@ | |||
21 | # Note that the rpm-pkg target cannot be used with KBUILD_OUTPUT, | 21 | # Note that the rpm-pkg target cannot be used with KBUILD_OUTPUT, |
22 | # but the binrpm-pkg target can; for some reason O= gets ignored. | 22 | # but the binrpm-pkg target can; for some reason O= gets ignored. |
23 | 23 | ||
24 | # Do we have rpmbuild, otherwise fall back to the older rpm | ||
25 | RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \ | ||
26 | else echo rpm; fi) | ||
27 | |||
28 | # Remove hyphens since they have special meaning in RPM filenames | 24 | # Remove hyphens since they have special meaning in RPM filenames |
29 | KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE)) | 25 | KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE)) |
26 | KDEB_SOURCENAME ?= linux-$(KERNELRELEASE) | ||
27 | export KDEB_SOURCENAME | ||
30 | # Include only those top-level files that are needed by make, plus the GPL copy | 28 | # Include only those top-level files that are needed by make, plus the GPL copy |
31 | TAR_CONTENT := $(KBUILD_ALLDIRS) kernel.spec .config .scmversion Makefile \ | 29 | TAR_CONTENT := $(KBUILD_ALLDIRS) .config .scmversion Makefile \ |
32 | Kbuild Kconfig COPYING $(wildcard localversion*) | 30 | Kbuild Kconfig COPYING $(wildcard localversion*) |
33 | TAR_CONTENT := $(addprefix $(KERNELPATH)/,$(TAR_CONTENT)) | ||
34 | MKSPEC := $(srctree)/scripts/package/mkspec | 31 | MKSPEC := $(srctree)/scripts/package/mkspec |
35 | 32 | ||
33 | quiet_cmd_src_tar = TAR $(2).tar.gz | ||
34 | cmd_src_tar = \ | ||
35 | if test "$(objtree)" != "$(srctree)"; then \ | ||
36 | echo "Building source tarball is not possible outside the"; \ | ||
37 | echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \ | ||
38 | echo "binrpm-pkg or bindeb-pkg target instead."; \ | ||
39 | false; \ | ||
40 | fi ; \ | ||
41 | $(srctree)/scripts/setlocalversion --save-scmversion; \ | ||
42 | ln -sf $(srctree) $(2); \ | ||
43 | tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \ | ||
44 | $(addprefix $(2)/,$(TAR_CONTENT) $(3)); \ | ||
45 | rm -f $(2) $(objtree)/.scmversion | ||
46 | |||
36 | # rpm-pkg | 47 | # rpm-pkg |
37 | # --------------------------------------------------------------------------- | 48 | # --------------------------------------------------------------------------- |
38 | rpm-pkg rpm: FORCE | 49 | rpm-pkg rpm: FORCE |
39 | @if test "$(objtree)" != "$(srctree)"; then \ | ||
40 | echo "Building source + binary RPM is not possible outside the"; \ | ||
41 | echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \ | ||
42 | echo "binrpm-pkg target instead."; \ | ||
43 | false; \ | ||
44 | fi | ||
45 | $(MAKE) clean | 50 | $(MAKE) clean |
46 | ln -sf $(srctree) $(KERNELPATH) | ||
47 | $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec | 51 | $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec |
48 | $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --save-scmversion | 52 | $(call cmd,src_tar,$(KERNELPATH),kernel.spec) |
49 | tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(TAR_CONTENT) | ||
50 | rm $(KERNELPATH) | ||
51 | rm -f $(objtree)/.scmversion | ||
52 | $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version | 53 | $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version |
53 | mv -f $(objtree)/.tmp_version $(objtree)/.version | 54 | mv -f $(objtree)/.tmp_version $(objtree)/.version |
54 | $(RPM) $(RPMOPTS) --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz | 55 | rpmbuild --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz |
55 | rm $(KERNELPATH).tar.gz kernel.spec | 56 | rm $(KERNELPATH).tar.gz kernel.spec |
56 | 57 | ||
57 | # binrpm-pkg | 58 | # binrpm-pkg |
@@ -62,7 +63,7 @@ binrpm-pkg: FORCE | |||
62 | $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version | 63 | $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version |
63 | mv -f $(objtree)/.tmp_version $(objtree)/.version | 64 | mv -f $(objtree)/.tmp_version $(objtree)/.version |
64 | 65 | ||
65 | $(RPM) $(RPMOPTS) --define "_builddir $(objtree)" --target \ | 66 | rpmbuild --define "_builddir $(objtree)" --target \ |
66 | $(UTS_MACHINE) -bb $(objtree)/binkernel.spec | 67 | $(UTS_MACHINE) -bb $(objtree)/binkernel.spec |
67 | rm binkernel.spec | 68 | rm binkernel.spec |
68 | 69 | ||
@@ -84,11 +85,17 @@ quiet_cmd_builddeb = BUILDDEB | |||
84 | } && \ | 85 | } && \ |
85 | \ | 86 | \ |
86 | $$KBUILD_PKG_ROOTCMD $(CONFIG_SHELL) \ | 87 | $$KBUILD_PKG_ROOTCMD $(CONFIG_SHELL) \ |
87 | $(srctree)/scripts/package/builddeb | 88 | $(srctree)/scripts/package/builddeb $@ |
88 | 89 | ||
89 | deb-pkg: FORCE | 90 | deb-pkg: FORCE |
91 | $(MAKE) clean | ||
92 | $(call cmd,src_tar,$(KDEB_SOURCENAME)) | ||
93 | $(MAKE) KBUILD_SRC= | ||
94 | +$(call cmd,builddeb) | ||
95 | |||
96 | bindeb-pkg: FORCE | ||
90 | $(MAKE) KBUILD_SRC= | 97 | $(MAKE) KBUILD_SRC= |
91 | $(call cmd,builddeb) | 98 | +$(call cmd,builddeb) |
92 | 99 | ||
93 | clean-dirs += $(objtree)/debian/ | 100 | clean-dirs += $(objtree)/debian/ |
94 | 101 | ||
@@ -133,8 +140,9 @@ perf-%pkg: FORCE | |||
133 | # --------------------------------------------------------------------------- | 140 | # --------------------------------------------------------------------------- |
134 | help: FORCE | 141 | help: FORCE |
135 | @echo ' rpm-pkg - Build both source and binary RPM kernel packages' | 142 | @echo ' rpm-pkg - Build both source and binary RPM kernel packages' |
136 | @echo ' binrpm-pkg - Build only the binary kernel package' | 143 | @echo ' binrpm-pkg - Build only the binary kernel RPM package' |
137 | @echo ' deb-pkg - Build the kernel as a deb package' | 144 | @echo ' deb-pkg - Build both source and binary deb kernel packages' |
145 | @echo ' bindeb-pkg - Build only the binary kernel deb package' | ||
138 | @echo ' tar-pkg - Build the kernel as an uncompressed tarball' | 146 | @echo ' tar-pkg - Build the kernel as an uncompressed tarball' |
139 | @echo ' targz-pkg - Build the kernel as a gzip compressed tarball' | 147 | @echo ' targz-pkg - Build the kernel as a gzip compressed tarball' |
140 | @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball' | 148 | @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball' |
diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 88dbf23b6970..0cd46e129920 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb | |||
@@ -15,6 +15,8 @@ set -e | |||
15 | create_package() { | 15 | create_package() { |
16 | local pname="$1" pdir="$2" | 16 | local pname="$1" pdir="$2" |
17 | 17 | ||
18 | mkdir -m 755 -p "$pdir/DEBIAN" | ||
19 | mkdir -p "$pdir/usr/share/doc/$pname" | ||
18 | cp debian/copyright "$pdir/usr/share/doc/$pname/" | 20 | cp debian/copyright "$pdir/usr/share/doc/$pname/" |
19 | cp debian/changelog "$pdir/usr/share/doc/$pname/changelog.Debian" | 21 | cp debian/changelog "$pdir/usr/share/doc/$pname/changelog.Debian" |
20 | gzip -9 "$pdir/usr/share/doc/$pname/changelog.Debian" | 22 | gzip -9 "$pdir/usr/share/doc/$pname/changelog.Debian" |
@@ -25,8 +27,13 @@ create_package() { | |||
25 | chown -R root:root "$pdir" | 27 | chown -R root:root "$pdir" |
26 | chmod -R go-w "$pdir" | 28 | chmod -R go-w "$pdir" |
27 | 29 | ||
30 | # Create the package | ||
31 | dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch}" -p$pname -P"$pdir" | ||
32 | dpkg --build "$pdir" .. | ||
33 | } | ||
34 | |||
35 | set_debarch() { | ||
28 | # Attempt to find the correct Debian architecture | 36 | # Attempt to find the correct Debian architecture |
29 | local forcearch="" debarch="" | ||
30 | case "$UTS_MACHINE" in | 37 | case "$UTS_MACHINE" in |
31 | i386|ia64|alpha) | 38 | i386|ia64|alpha) |
32 | debarch="$UTS_MACHINE" ;; | 39 | debarch="$UTS_MACHINE" ;; |
@@ -47,6 +54,7 @@ create_package() { | |||
47 | arm*) | 54 | arm*) |
48 | debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el || true) ;; | 55 | debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el || true) ;; |
49 | *) | 56 | *) |
57 | debarch=$(dpkg --print-architecture) | ||
50 | echo "" >&2 | 58 | echo "" >&2 |
51 | echo "** ** ** WARNING ** ** **" >&2 | 59 | echo "** ** ** WARNING ** ** **" >&2 |
52 | echo "" >&2 | 60 | echo "" >&2 |
@@ -59,13 +67,8 @@ create_package() { | |||
59 | if [ -n "$KBUILD_DEBARCH" ] ; then | 67 | if [ -n "$KBUILD_DEBARCH" ] ; then |
60 | debarch="$KBUILD_DEBARCH" | 68 | debarch="$KBUILD_DEBARCH" |
61 | fi | 69 | fi |
62 | if [ -n "$debarch" ] ; then | 70 | forcearch="-DArchitecture=$debarch" |
63 | forcearch="-DArchitecture=$debarch" | ||
64 | fi | ||
65 | 71 | ||
66 | # Create the package | ||
67 | dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir" | ||
68 | dpkg --build "$pdir" .. | ||
69 | } | 72 | } |
70 | 73 | ||
71 | # Some variables and settings used throughout the script | 74 | # Some variables and settings used throughout the script |
@@ -76,6 +79,7 @@ if [ -n "$KDEB_PKGVERSION" ]; then | |||
76 | else | 79 | else |
77 | packageversion=$version-$revision | 80 | packageversion=$version-$revision |
78 | fi | 81 | fi |
82 | sourcename=$KDEB_SOURCENAME | ||
79 | tmpdir="$objtree/debian/tmp" | 83 | tmpdir="$objtree/debian/tmp" |
80 | fwdir="$objtree/debian/fwtmp" | 84 | fwdir="$objtree/debian/fwtmp" |
81 | kernel_headers_dir="$objtree/debian/hdrtmp" | 85 | kernel_headers_dir="$objtree/debian/hdrtmp" |
@@ -86,6 +90,9 @@ fwpackagename=linux-firmware-image-$version | |||
86 | kernel_headers_packagename=linux-headers-$version | 90 | kernel_headers_packagename=linux-headers-$version |
87 | libc_headers_packagename=linux-libc-dev | 91 | libc_headers_packagename=linux-libc-dev |
88 | dbg_packagename=$packagename-dbg | 92 | dbg_packagename=$packagename-dbg |
93 | debarch= | ||
94 | forcearch= | ||
95 | set_debarch | ||
89 | 96 | ||
90 | if [ "$ARCH" = "um" ] ; then | 97 | if [ "$ARCH" = "um" ] ; then |
91 | packagename=user-mode-linux-$version | 98 | packagename=user-mode-linux-$version |
@@ -110,24 +117,13 @@ BUILD_DEBUG="$(grep -s '^CONFIG_DEBUG_INFO=y' $KCONFIG_CONFIG || true)" | |||
110 | # Setup the directory structure | 117 | # Setup the directory structure |
111 | rm -rf "$tmpdir" "$fwdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" | 118 | rm -rf "$tmpdir" "$fwdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" |
112 | mkdir -m 755 -p "$tmpdir/DEBIAN" | 119 | mkdir -m 755 -p "$tmpdir/DEBIAN" |
113 | mkdir -p "$tmpdir/lib" "$tmpdir/boot" "$tmpdir/usr/share/doc/$packagename" | 120 | mkdir -p "$tmpdir/lib" "$tmpdir/boot" |
114 | mkdir -m 755 -p "$fwdir/DEBIAN" | 121 | mkdir -p "$fwdir/lib/firmware/$version/" |
115 | mkdir -p "$fwdir/lib/firmware/$version/" "$fwdir/usr/share/doc/$fwpackagename" | ||
116 | mkdir -m 755 -p "$libc_headers_dir/DEBIAN" | ||
117 | mkdir -p "$libc_headers_dir/usr/share/doc/$libc_headers_packagename" | ||
118 | mkdir -m 755 -p "$kernel_headers_dir/DEBIAN" | ||
119 | mkdir -p "$kernel_headers_dir/usr/share/doc/$kernel_headers_packagename" | ||
120 | mkdir -p "$kernel_headers_dir/lib/modules/$version/" | 122 | mkdir -p "$kernel_headers_dir/lib/modules/$version/" |
121 | if [ "$ARCH" = "um" ] ; then | ||
122 | mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/bin" | ||
123 | fi | ||
124 | if [ -n "$BUILD_DEBUG" ] ; then | ||
125 | mkdir -p "$dbg_dir/usr/share/doc/$dbg_packagename" | ||
126 | mkdir -m 755 -p "$dbg_dir/DEBIAN" | ||
127 | fi | ||
128 | 123 | ||
129 | # Build and install the kernel | 124 | # Build and install the kernel |
130 | if [ "$ARCH" = "um" ] ; then | 125 | if [ "$ARCH" = "um" ] ; then |
126 | mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/bin" "$tmpdir/usr/share/doc/$packagename" | ||
131 | $MAKE linux | 127 | $MAKE linux |
132 | cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map" | 128 | cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map" |
133 | cp $KCONFIG_CONFIG "$tmpdir/usr/share/doc/$packagename/config" | 129 | cp $KCONFIG_CONFIG "$tmpdir/usr/share/doc/$packagename/config" |
@@ -143,6 +139,13 @@ else | |||
143 | cp arch/$ARCH/boot/$KBUILD_IMAGE "$tmpdir/$installed_image_path" | 139 | cp arch/$ARCH/boot/$KBUILD_IMAGE "$tmpdir/$installed_image_path" |
144 | fi | 140 | fi |
145 | 141 | ||
142 | if grep -q "^CONFIG_OF=y" $KCONFIG_CONFIG ; then | ||
143 | # Only some architectures with OF support have this target | ||
144 | if grep -q dtbs_install "${srctree}/arch/$SRCARCH/Makefile"; then | ||
145 | $MAKE KBUILD_SRC= INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install | ||
146 | fi | ||
147 | fi | ||
148 | |||
146 | if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then | 149 | if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then |
147 | INSTALL_MOD_PATH="$tmpdir" $MAKE KBUILD_SRC= modules_install | 150 | INSTALL_MOD_PATH="$tmpdir" $MAKE KBUILD_SRC= modules_install |
148 | rm -f "$tmpdir/lib/modules/$version/build" | 151 | rm -f "$tmpdir/lib/modules/$version/build" |
@@ -162,6 +165,12 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then | |||
162 | # then add a link to those | 165 | # then add a link to those |
163 | $OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $tmpdir/$module | 166 | $OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $tmpdir/$module |
164 | done | 167 | done |
168 | |||
169 | # resign stripped modules | ||
170 | MODULE_SIG_ALL="$(grep -s '^CONFIG_MODULE_SIG_ALL=y' $KCONFIG_CONFIG || true)" | ||
171 | if [ -n "$MODULE_SIG_ALL" ]; then | ||
172 | INSTALL_MOD_PATH="$tmpdir" $MAKE KBUILD_SRC= modules_sign | ||
173 | fi | ||
165 | fi | 174 | fi |
166 | fi | 175 | fi |
167 | 176 | ||
@@ -206,7 +215,7 @@ if [ -n "$DEBEMAIL" ]; then | |||
206 | elif [ -n "$EMAIL" ]; then | 215 | elif [ -n "$EMAIL" ]; then |
207 | email=$EMAIL | 216 | email=$EMAIL |
208 | else | 217 | else |
209 | email=$(id -nu)@$(hostname -f) | 218 | email=$(id -nu)@$(hostname -f 2>/dev/null || hostname) |
210 | fi | 219 | fi |
211 | if [ -n "$DEBFULLNAME" ]; then | 220 | if [ -n "$DEBFULLNAME" ]; then |
212 | name=$DEBFULLNAME | 221 | name=$DEBFULLNAME |
@@ -230,7 +239,7 @@ fi | |||
230 | 239 | ||
231 | # Generate a simple changelog template | 240 | # Generate a simple changelog template |
232 | cat <<EOF > debian/changelog | 241 | cat <<EOF > debian/changelog |
233 | linux-upstream ($packageversion) $distribution; urgency=low | 242 | $sourcename ($packageversion) $distribution; urgency=low |
234 | 243 | ||
235 | * Custom built Linux kernel. | 244 | * Custom built Linux kernel. |
236 | 245 | ||
@@ -257,12 +266,16 @@ On Debian GNU/Linux systems, the complete text of the GNU General Public | |||
257 | License version 2 can be found in \`/usr/share/common-licenses/GPL-2'. | 266 | License version 2 can be found in \`/usr/share/common-licenses/GPL-2'. |
258 | EOF | 267 | EOF |
259 | 268 | ||
269 | |||
270 | build_depends="bc, kmod, cpio " | ||
271 | |||
260 | # Generate a control file | 272 | # Generate a control file |
261 | cat <<EOF > debian/control | 273 | cat <<EOF > debian/control |
262 | Source: linux-upstream | 274 | Source: $sourcename |
263 | Section: kernel | 275 | Section: kernel |
264 | Priority: optional | 276 | Priority: optional |
265 | Maintainer: $maintainer | 277 | Maintainer: $maintainer |
278 | Build-Depends: $build_depends | ||
266 | Standards-Version: 3.8.4 | 279 | Standards-Version: 3.8.4 |
267 | Homepage: http://www.kernel.org/ | 280 | Homepage: http://www.kernel.org/ |
268 | EOF | 281 | EOF |
@@ -383,4 +396,33 @@ EOF | |||
383 | create_package "$dbg_packagename" "$dbg_dir" | 396 | create_package "$dbg_packagename" "$dbg_dir" |
384 | fi | 397 | fi |
385 | 398 | ||
399 | if [ "x$1" = "xdeb-pkg" ] | ||
400 | then | ||
401 | cat <<EOF > debian/rules | ||
402 | #!/usr/bin/make -f | ||
403 | |||
404 | build: | ||
405 | \$(MAKE) | ||
406 | |||
407 | binary-arch: | ||
408 | \$(MAKE) KDEB_SOURCENAME=${sourcename} KDEB_PKGVERSION=${packageversion} bindeb-pkg | ||
409 | |||
410 | clean: | ||
411 | rm -rf debian/*tmp | ||
412 | mv debian/ debian.backup # debian/ might be cleaned away | ||
413 | \$(MAKE) clean | ||
414 | mv debian.backup debian | ||
415 | |||
416 | binary: binary-arch | ||
417 | EOF | ||
418 | mv ${sourcename}.tar.gz ../${sourcename}_${version}.orig.tar.gz | ||
419 | tar caf ../${sourcename}_${packageversion}.debian.tar.gz debian/{copyright,rules,changelog,control} | ||
420 | dpkg-source -cdebian/control -ldebian/changelog --format="3.0 (custom)" --target-format="3.0 (quilt)" \ | ||
421 | -b / ../${sourcename}_${version}.orig.tar.gz ../${sourcename}_${packageversion}.debian.tar.gz | ||
422 | mv ${sourcename}_${packageversion}*dsc .. | ||
423 | dpkg-genchanges > ../${sourcename}_${packageversion}_${debarch}.changes | ||
424 | else | ||
425 | dpkg-genchanges -b > ../${sourcename}_${packageversion}_${debarch}.changes | ||
426 | fi | ||
427 | |||
386 | exit 0 | 428 | exit 0 |
diff --git a/scripts/package/mkspec b/scripts/package/mkspec index d9ab94b17de0..71004daefe31 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec | |||
@@ -111,10 +111,8 @@ echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE" | |||
111 | echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$KERNELRELEASE" | 111 | echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$KERNELRELEASE" |
112 | 112 | ||
113 | echo "%ifnarch ppc64" | 113 | echo "%ifnarch ppc64" |
114 | echo 'cp vmlinux vmlinux.orig' | 114 | echo 'bzip2 -9 --keep vmlinux' |
115 | echo 'bzip2 -9 vmlinux' | ||
116 | echo 'mv vmlinux.bz2 $RPM_BUILD_ROOT'"/boot/vmlinux-$KERNELRELEASE.bz2" | 115 | echo 'mv vmlinux.bz2 $RPM_BUILD_ROOT'"/boot/vmlinux-$KERNELRELEASE.bz2" |
117 | echo 'mv vmlinux.orig vmlinux' | ||
118 | echo "%endif" | 116 | echo "%endif" |
119 | 117 | ||
120 | if ! $PREBUILT; then | 118 | if ! $PREBUILT; then |
@@ -142,7 +140,6 @@ echo "fi" | |||
142 | echo "" | 140 | echo "" |
143 | echo "%files" | 141 | echo "%files" |
144 | echo '%defattr (-, root, root)' | 142 | echo '%defattr (-, root, root)' |
145 | echo "%dir /lib/modules" | ||
146 | echo "/lib/modules/$KERNELRELEASE" | 143 | echo "/lib/modules/$KERNELRELEASE" |
147 | echo "%exclude /lib/modules/$KERNELRELEASE/build" | 144 | echo "%exclude /lib/modules/$KERNELRELEASE/build" |
148 | echo "%exclude /lib/modules/$KERNELRELEASE/source" | 145 | echo "%exclude /lib/modules/$KERNELRELEASE/source" |
diff --git a/scripts/rt-tester/check-all.sh b/scripts/rt-tester/check-all.sh deleted file mode 100644 index 6b5c83baf148..000000000000 --- a/scripts/rt-tester/check-all.sh +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | |||
2 | |||
3 | function testit () | ||
4 | { | ||
5 | printf "%-30s: " $1 | ||
6 | ./rt-tester.py $1 | grep Pass | ||
7 | } | ||
8 | |||
9 | testit t2-l1-2rt-sameprio.tst | ||
10 | testit t2-l1-pi.tst | ||
11 | testit t2-l1-signal.tst | ||
12 | #testit t2-l2-2rt-deadlock.tst | ||
13 | testit t3-l1-pi-1rt.tst | ||
14 | testit t3-l1-pi-2rt.tst | ||
15 | testit t3-l1-pi-3rt.tst | ||
16 | testit t3-l1-pi-signal.tst | ||
17 | testit t3-l1-pi-steal.tst | ||
18 | testit t3-l2-pi.tst | ||
19 | testit t4-l2-pi-deboost.tst | ||
20 | testit t5-l4-pi-boost-deboost.tst | ||
21 | testit t5-l4-pi-boost-deboost-setsched.tst | ||
diff --git a/scripts/rt-tester/rt-tester.py b/scripts/rt-tester/rt-tester.py deleted file mode 100755 index 6d916c2a45a5..000000000000 --- a/scripts/rt-tester/rt-tester.py +++ /dev/null | |||
@@ -1,218 +0,0 @@ | |||
1 | #!/usr/bin/python | ||
2 | # | ||
3 | # rt-mutex tester | ||
4 | # | ||
5 | # (C) 2006 Thomas Gleixner <tglx@linutronix.de> | ||
6 | # | ||
7 | # This program is free software; you can redistribute it and/or modify | ||
8 | # it under the terms of the GNU General Public License version 2 as | ||
9 | # published by the Free Software Foundation. | ||
10 | # | ||
11 | import os | ||
12 | import sys | ||
13 | import getopt | ||
14 | import shutil | ||
15 | import string | ||
16 | |||
17 | # Globals | ||
18 | quiet = 0 | ||
19 | test = 0 | ||
20 | comments = 0 | ||
21 | |||
22 | sysfsprefix = "/sys/devices/system/rttest/rttest" | ||
23 | statusfile = "/status" | ||
24 | commandfile = "/command" | ||
25 | |||
26 | # Command opcodes | ||
27 | cmd_opcodes = { | ||
28 | "schedother" : "1", | ||
29 | "schedfifo" : "2", | ||
30 | "lock" : "3", | ||
31 | "locknowait" : "4", | ||
32 | "lockint" : "5", | ||
33 | "lockintnowait" : "6", | ||
34 | "lockcont" : "7", | ||
35 | "unlock" : "8", | ||
36 | "signal" : "11", | ||
37 | "resetevent" : "98", | ||
38 | "reset" : "99", | ||
39 | } | ||
40 | |||
41 | test_opcodes = { | ||
42 | "prioeq" : ["P" , "eq" , None], | ||
43 | "priolt" : ["P" , "lt" , None], | ||
44 | "priogt" : ["P" , "gt" , None], | ||
45 | "nprioeq" : ["N" , "eq" , None], | ||
46 | "npriolt" : ["N" , "lt" , None], | ||
47 | "npriogt" : ["N" , "gt" , None], | ||
48 | "unlocked" : ["M" , "eq" , 0], | ||
49 | "trylock" : ["M" , "eq" , 1], | ||
50 | "blocked" : ["M" , "eq" , 2], | ||
51 | "blockedwake" : ["M" , "eq" , 3], | ||
52 | "locked" : ["M" , "eq" , 4], | ||
53 | "opcodeeq" : ["O" , "eq" , None], | ||
54 | "opcodelt" : ["O" , "lt" , None], | ||
55 | "opcodegt" : ["O" , "gt" , None], | ||
56 | "eventeq" : ["E" , "eq" , None], | ||
57 | "eventlt" : ["E" , "lt" , None], | ||
58 | "eventgt" : ["E" , "gt" , None], | ||
59 | } | ||
60 | |||
61 | # Print usage information | ||
62 | def usage(): | ||
63 | print "rt-tester.py <-c -h -q -t> <testfile>" | ||
64 | print " -c display comments after first command" | ||
65 | print " -h help" | ||
66 | print " -q quiet mode" | ||
67 | print " -t test mode (syntax check)" | ||
68 | print " testfile: read test specification from testfile" | ||
69 | print " otherwise from stdin" | ||
70 | return | ||
71 | |||
72 | # Print progress when not in quiet mode | ||
73 | def progress(str): | ||
74 | if not quiet: | ||
75 | print str | ||
76 | |||
77 | # Analyse a status value | ||
78 | def analyse(val, top, arg): | ||
79 | |||
80 | intval = int(val) | ||
81 | |||
82 | if top[0] == "M": | ||
83 | intval = intval / (10 ** int(arg)) | ||
84 | intval = intval % 10 | ||
85 | argval = top[2] | ||
86 | elif top[0] == "O": | ||
87 | argval = int(cmd_opcodes.get(arg, arg)) | ||
88 | else: | ||
89 | argval = int(arg) | ||
90 | |||
91 | # progress("%d %s %d" %(intval, top[1], argval)) | ||
92 | |||
93 | if top[1] == "eq" and intval == argval: | ||
94 | return 1 | ||
95 | if top[1] == "lt" and intval < argval: | ||
96 | return 1 | ||
97 | if top[1] == "gt" and intval > argval: | ||
98 | return 1 | ||
99 | return 0 | ||
100 | |||
101 | # Parse the commandline | ||
102 | try: | ||
103 | (options, arguments) = getopt.getopt(sys.argv[1:],'chqt') | ||
104 | except getopt.GetoptError, ex: | ||
105 | usage() | ||
106 | sys.exit(1) | ||
107 | |||
108 | # Parse commandline options | ||
109 | for option, value in options: | ||
110 | if option == "-c": | ||
111 | comments = 1 | ||
112 | elif option == "-q": | ||
113 | quiet = 1 | ||
114 | elif option == "-t": | ||
115 | test = 1 | ||
116 | elif option == '-h': | ||
117 | usage() | ||
118 | sys.exit(0) | ||
119 | |||
120 | # Select the input source | ||
121 | if arguments: | ||
122 | try: | ||
123 | fd = open(arguments[0]) | ||
124 | except Exception,ex: | ||
125 | sys.stderr.write("File not found %s\n" %(arguments[0])) | ||
126 | sys.exit(1) | ||
127 | else: | ||
128 | fd = sys.stdin | ||
129 | |||
130 | linenr = 0 | ||
131 | |||
132 | # Read the test patterns | ||
133 | while 1: | ||
134 | |||
135 | linenr = linenr + 1 | ||
136 | line = fd.readline() | ||
137 | if not len(line): | ||
138 | break | ||
139 | |||
140 | line = line.strip() | ||
141 | parts = line.split(":") | ||
142 | |||
143 | if not parts or len(parts) < 1: | ||
144 | continue | ||
145 | |||
146 | if len(parts[0]) == 0: | ||
147 | continue | ||
148 | |||
149 | if parts[0].startswith("#"): | ||
150 | if comments > 1: | ||
151 | progress(line) | ||
152 | continue | ||
153 | |||
154 | if comments == 1: | ||
155 | comments = 2 | ||
156 | |||
157 | progress(line) | ||
158 | |||
159 | cmd = parts[0].strip().lower() | ||
160 | opc = parts[1].strip().lower() | ||
161 | tid = parts[2].strip() | ||
162 | dat = parts[3].strip() | ||
163 | |||
164 | try: | ||
165 | # Test or wait for a status value | ||
166 | if cmd == "t" or cmd == "w": | ||
167 | testop = test_opcodes[opc] | ||
168 | |||
169 | fname = "%s%s%s" %(sysfsprefix, tid, statusfile) | ||
170 | if test: | ||
171 | print fname | ||
172 | continue | ||
173 | |||
174 | while 1: | ||
175 | query = 1 | ||
176 | fsta = open(fname, 'r') | ||
177 | status = fsta.readline().strip() | ||
178 | fsta.close() | ||
179 | stat = status.split(",") | ||
180 | for s in stat: | ||
181 | s = s.strip() | ||
182 | if s.startswith(testop[0]): | ||
183 | # Separate status value | ||
184 | val = s[2:].strip() | ||
185 | query = analyse(val, testop, dat) | ||
186 | break | ||
187 | if query or cmd == "t": | ||
188 | break | ||
189 | |||
190 | progress(" " + status) | ||
191 | |||
192 | if not query: | ||
193 | sys.stderr.write("Test failed in line %d\n" %(linenr)) | ||
194 | sys.exit(1) | ||
195 | |||
196 | # Issue a command to the tester | ||
197 | elif cmd == "c": | ||
198 | cmdnr = cmd_opcodes[opc] | ||
199 | # Build command string and sys filename | ||
200 | cmdstr = "%s:%s" %(cmdnr, dat) | ||
201 | fname = "%s%s%s" %(sysfsprefix, tid, commandfile) | ||
202 | if test: | ||
203 | print fname | ||
204 | continue | ||
205 | fcmd = open(fname, 'w') | ||
206 | fcmd.write(cmdstr) | ||
207 | fcmd.close() | ||
208 | |||
209 | except Exception,ex: | ||
210 | sys.stderr.write(str(ex)) | ||
211 | sys.stderr.write("\nSyntax error in line %d\n" %(linenr)) | ||
212 | if not test: | ||
213 | fd.close() | ||
214 | sys.exit(1) | ||
215 | |||
216 | # Normal exit pass | ||
217 | print "Pass" | ||
218 | sys.exit(0) | ||
diff --git a/scripts/rt-tester/t2-l1-2rt-sameprio.tst b/scripts/rt-tester/t2-l1-2rt-sameprio.tst deleted file mode 100644 index 3710c8b2090d..000000000000 --- a/scripts/rt-tester/t2-l1-2rt-sameprio.tst +++ /dev/null | |||
@@ -1,94 +0,0 @@ | |||
1 | # | ||
2 | # RT-Mutex test | ||
3 | # | ||
4 | # Op: C(ommand)/T(est)/W(ait) | ||
5 | # | opcode | ||
6 | # | | threadid: 0-7 | ||
7 | # | | | opcode argument | ||
8 | # | | | | | ||
9 | # C: lock: 0: 0 | ||
10 | # | ||
11 | # Commands | ||
12 | # | ||
13 | # opcode opcode argument | ||
14 | # schedother nice value | ||
15 | # schedfifo priority | ||
16 | # lock lock nr (0-7) | ||
17 | # locknowait lock nr (0-7) | ||
18 | # lockint lock nr (0-7) | ||
19 | # lockintnowait lock nr (0-7) | ||
20 | # lockcont lock nr (0-7) | ||
21 | # unlock lock nr (0-7) | ||
22 | # signal 0 | ||
23 | # reset 0 | ||
24 | # resetevent 0 | ||
25 | # | ||
26 | # Tests / Wait | ||
27 | # | ||
28 | # opcode opcode argument | ||
29 | # | ||
30 | # prioeq priority | ||
31 | # priolt priority | ||
32 | # priogt priority | ||
33 | # nprioeq normal priority | ||
34 | # npriolt normal priority | ||
35 | # npriogt normal priority | ||
36 | # locked lock nr (0-7) | ||
37 | # blocked lock nr (0-7) | ||
38 | # blockedwake lock nr (0-7) | ||
39 | # unlocked lock nr (0-7) | ||
40 | # opcodeeq command opcode or number | ||
41 | # opcodelt number | ||
42 | # opcodegt number | ||
43 | # eventeq number | ||
44 | # eventgt number | ||
45 | # eventlt number | ||
46 | |||
47 | # | ||
48 | # 2 threads 1 lock | ||
49 | # | ||
50 | C: resetevent: 0: 0 | ||
51 | W: opcodeeq: 0: 0 | ||
52 | |||
53 | # Set schedulers | ||
54 | C: schedfifo: 0: 80 | ||
55 | C: schedfifo: 1: 80 | ||
56 | |||
57 | # T0 lock L0 | ||
58 | C: locknowait: 0: 0 | ||
59 | C: locknowait: 1: 0 | ||
60 | W: locked: 0: 0 | ||
61 | W: blocked: 1: 0 | ||
62 | T: prioeq: 0: 80 | ||
63 | |||
64 | # T0 unlock L0 | ||
65 | C: unlock: 0: 0 | ||
66 | W: locked: 1: 0 | ||
67 | |||
68 | # Verify T0 | ||
69 | W: unlocked: 0: 0 | ||
70 | T: prioeq: 0: 80 | ||
71 | |||
72 | # Unlock | ||
73 | C: unlock: 1: 0 | ||
74 | W: unlocked: 1: 0 | ||
75 | |||
76 | # T1,T0 lock L0 | ||
77 | C: locknowait: 1: 0 | ||
78 | C: locknowait: 0: 0 | ||
79 | W: locked: 1: 0 | ||
80 | W: blocked: 0: 0 | ||
81 | T: prioeq: 1: 80 | ||
82 | |||
83 | # T1 unlock L0 | ||
84 | C: unlock: 1: 0 | ||
85 | W: locked: 0: 0 | ||
86 | |||
87 | # Verify T1 | ||
88 | W: unlocked: 1: 0 | ||
89 | T: prioeq: 1: 80 | ||
90 | |||
91 | # Unlock and exit | ||
92 | C: unlock: 0: 0 | ||
93 | W: unlocked: 0: 0 | ||
94 | |||
diff --git a/scripts/rt-tester/t2-l1-pi.tst b/scripts/rt-tester/t2-l1-pi.tst deleted file mode 100644 index b4cc95975adb..000000000000 --- a/scripts/rt-tester/t2-l1-pi.tst +++ /dev/null | |||
@@ -1,77 +0,0 @@ | |||
1 | # | ||
2 | # RT-Mutex test | ||
3 | # | ||
4 | # Op: C(ommand)/T(est)/W(ait) | ||
5 | # | opcode | ||
6 | # | | threadid: 0-7 | ||
7 | # | | | opcode argument | ||
8 | # | | | | | ||
9 | # C: lock: 0: 0 | ||
10 | # | ||
11 | # Commands | ||
12 | # | ||
13 | # opcode opcode argument | ||
14 | # schedother nice value | ||
15 | # schedfifo priority | ||
16 | # lock lock nr (0-7) | ||
17 | # locknowait lock nr (0-7) | ||
18 | # lockint lock nr (0-7) | ||
19 | # lockintnowait lock nr (0-7) | ||
20 | # lockcont lock nr (0-7) | ||
21 | # unlock lock nr (0-7) | ||
22 | # signal 0 | ||
23 | # reset 0 | ||
24 | # resetevent 0 | ||
25 | # | ||
26 | # Tests / Wait | ||
27 | # | ||
28 | # opcode opcode argument | ||
29 | # | ||
30 | # prioeq priority | ||
31 | # priolt priority | ||
32 | # priogt priority | ||
33 | # nprioeq normal priority | ||
34 | # npriolt normal priority | ||
35 | # npriogt normal priority | ||
36 | # locked lock nr (0-7) | ||
37 | # blocked lock nr (0-7) | ||
38 | # blockedwake lock nr (0-7) | ||
39 | # unlocked lock nr (0-7) | ||
40 | # opcodeeq command opcode or number | ||
41 | # opcodelt number | ||
42 | # opcodegt number | ||
43 | # eventeq number | ||
44 | # eventgt number | ||
45 | # eventlt number | ||
46 | |||
47 | # | ||
48 | # 2 threads 1 lock with priority inversion | ||
49 | # | ||
50 | C: resetevent: 0: 0 | ||
51 | W: opcodeeq: 0: 0 | ||
52 | |||
53 | # Set schedulers | ||
54 | C: schedother: 0: 0 | ||
55 | C: schedfifo: 1: 80 | ||
56 | |||
57 | # T0 lock L0 | ||
58 | C: locknowait: 0: 0 | ||
59 | W: locked: 0: 0 | ||
60 | |||
61 | # T1 lock L0 | ||
62 | C: locknowait: 1: 0 | ||
63 | W: blocked: 1: 0 | ||
64 | T: prioeq: 0: 80 | ||
65 | |||
66 | # T0 unlock L0 | ||
67 | C: unlock: 0: 0 | ||
68 | W: locked: 1: 0 | ||
69 | |||
70 | # Verify T1 | ||
71 | W: unlocked: 0: 0 | ||
72 | T: priolt: 0: 1 | ||
73 | |||
74 | # Unlock and exit | ||
75 | C: unlock: 1: 0 | ||
76 | W: unlocked: 1: 0 | ||
77 | |||
diff --git a/scripts/rt-tester/t2-l1-signal.tst b/scripts/rt-tester/t2-l1-signal.tst deleted file mode 100644 index 1b57376cc1f7..000000000000 --- a/scripts/rt-tester/t2-l1-signal.tst +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | # | ||
2 | # RT-Mutex test | ||
3 | # | ||
4 | # Op: C(ommand)/T(est)/W(ait) | ||
5 | # | opcode | ||
6 | # | | threadid: 0-7 | ||
7 | # | | | opcode argument | ||
8 | # | | | | | ||
9 | # C: lock: 0: 0 | ||
10 | # | ||
11 | # Commands | ||
12 | # | ||
13 | # opcode opcode argument | ||
14 | # schedother nice value | ||
15 | # schedfifo priority | ||
16 | # lock lock nr (0-7) | ||
17 | # locknowait lock nr (0-7) | ||
18 | # lockint lock nr (0-7) | ||
19 | # lockintnowait lock nr (0-7) | ||
20 | # lockcont lock nr (0-7) | ||
21 | # unlock lock nr (0-7) | ||
22 | # signal 0 | ||
23 | # reset 0 | ||
24 | # resetevent 0 | ||
25 | # | ||
26 | # Tests / Wait | ||
27 | # | ||
28 | # opcode opcode argument | ||
29 | # | ||
30 | # prioeq priority | ||
31 | # priolt priority | ||
32 | # priogt priority | ||
33 | # nprioeq normal priority | ||
34 | # npriolt normal priority | ||
35 | # npriogt normal priority | ||
36 | # locked lock nr (0-7) | ||
37 | # blocked lock nr (0-7) | ||
38 | # blockedwake lock nr (0-7) | ||
39 | # unlocked lock nr (0-7) | ||
40 | # opcodeeq command opcode or number | ||
41 | # opcodelt number | ||
42 | # opcodegt number | ||
43 | # eventeq number | ||
44 | # eventgt number | ||
45 | # eventlt number | ||
46 | |||
47 | # | ||
48 | # 2 threads 1 lock with priority inversion | ||
49 | # | ||
50 | C: resetevent: 0: 0 | ||
51 | W: opcodeeq: 0: 0 | ||
52 | |||
53 | # Set schedulers | ||
54 | C: schedother: 0: 0 | ||
55 | C: schedother: 1: 0 | ||
56 | |||
57 | # T0 lock L0 | ||
58 | C: locknowait: 0: 0 | ||
59 | W: locked: 0: 0 | ||
60 | |||
61 | # T1 lock L0 | ||
62 | C: lockintnowait: 1: 0 | ||
63 | W: blocked: 1: 0 | ||
64 | |||
65 | # Interrupt T1 | ||
66 | C: signal: 1: 0 | ||
67 | W: unlocked: 1: 0 | ||
68 | T: opcodeeq: 1: -4 | ||
69 | |||
70 | # Unlock and exit | ||
71 | C: unlock: 0: 0 | ||
72 | W: unlocked: 0: 0 | ||
diff --git a/scripts/rt-tester/t2-l2-2rt-deadlock.tst b/scripts/rt-tester/t2-l2-2rt-deadlock.tst deleted file mode 100644 index 68b10629b6f4..000000000000 --- a/scripts/rt-tester/t2-l2-2rt-deadlock.tst +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | # | ||
2 | # RT-Mutex test | ||
3 | # | ||
4 | # Op: C(ommand)/T(est)/W(ait) | ||
5 | # | opcode | ||
6 | # | | threadid: 0-7 | ||
7 | # | | | opcode argument | ||
8 | # | | | | | ||
9 | # C: lock: 0: 0 | ||
10 | # | ||
11 | # Commands | ||
12 | # | ||
13 | # opcode opcode argument | ||
14 | # schedother nice value | ||
15 | # schedfifo priority | ||
16 | # lock lock nr (0-7) | ||
17 | # locknowait lock nr (0-7) | ||
18 | # lockint lock nr (0-7) | ||
19 | # lockintnowait lock nr (0-7) | ||
20 | # lockcont lock nr (0-7) | ||
21 | # unlock lock nr (0-7) | ||
22 | # signal 0 | ||
23 | # reset 0 | ||
24 | # resetevent 0 | ||
25 | # | ||
26 | # Tests / Wait | ||
27 | # | ||
28 | # opcode opcode argument | ||
29 | # | ||
30 | # prioeq priority | ||
31 | # priolt priority | ||
32 | # priogt priority | ||
33 | # nprioeq normal priority | ||
34 | # npriolt normal priority | ||
35 | # npriogt normal priority | ||
36 | # locked lock nr (0-7) | ||
37 | # blocked lock nr (0-7) | ||
38 | # blockedwake lock nr (0-7) | ||
39 | # unlocked lock nr (0-7) | ||
40 | # opcodeeq command opcode or number | ||
41 | # opcodelt number | ||
42 | # opcodegt number | ||
43 | # eventeq number | ||
44 | # eventgt number | ||
45 | # eventlt number | ||
46 | |||
47 | # | ||
48 | # 2 threads 2 lock | ||
49 | # | ||
50 | C: resetevent: 0: 0 | ||
51 | W: opcodeeq: 0: 0 | ||
52 | |||
53 | # Set schedulers | ||
54 | C: schedfifo: 0: 80 | ||
55 | C: schedfifo: 1: 80 | ||
56 | |||
57 | # T0 lock L0 | ||
58 | C: locknowait: 0: 0 | ||
59 | W: locked: 0: 0 | ||
60 | |||
61 | # T1 lock L1 | ||
62 | C: locknowait: 1: 1 | ||
63 | W: locked: 1: 1 | ||
64 | |||
65 | # T0 lock L1 | ||
66 | C: lockintnowait: 0: 1 | ||
67 | W: blocked: 0: 1 | ||
68 | |||
69 | # T1 lock L0 | ||
70 | C: lockintnowait: 1: 0 | ||
71 | W: blocked: 1: 0 | ||
72 | |||
73 | # Make deadlock go away | ||
74 | C: signal: 1: 0 | ||
75 | W: unlocked: 1: 0 | ||
76 | C: signal: 0: 0 | ||
77 | W: unlocked: 0: 1 | ||
78 | |||
79 | # Unlock and exit | ||
80 | C: unlock: 0: 0 | ||
81 | W: unlocked: 0: 0 | ||
82 | C: unlock: 1: 1 | ||
83 | W: unlocked: 1: 1 | ||
84 | |||
diff --git a/scripts/rt-tester/t3-l1-pi-1rt.tst b/scripts/rt-tester/t3-l1-pi-1rt.tst deleted file mode 100644 index 8e6c8b11ae56..000000000000 --- a/scripts/rt-tester/t3-l1-pi-1rt.tst +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | # | ||
2 | # rt-mutex test | ||
3 | # | ||
4 | # Op: C(ommand)/T(est)/W(ait) | ||
5 | # | opcode | ||
6 | # | | threadid: 0-7 | ||
7 | # | | | opcode argument | ||
8 | # | | | | | ||
9 | # C: lock: 0: 0 | ||
10 | # | ||
11 | # Commands | ||
12 | # | ||
13 | # opcode opcode argument | ||
14 | # schedother nice value | ||
15 | # schedfifo priority | ||
16 | # lock lock nr (0-7) | ||
17 | # locknowait lock nr (0-7) | ||
18 | # lockint lock nr (0-7) | ||
19 | # lockintnowait lock nr (0-7) | ||
20 | # lockcont lock nr (0-7) | ||
21 | # unlock lock nr (0-7) | ||
22 | # signal thread to signal (0-7) | ||
23 | # reset 0 | ||
24 | # resetevent 0 | ||
25 | # | ||
26 | # Tests / Wait | ||
27 | # | ||
28 | # opcode opcode argument | ||
29 | # | ||
30 | # prioeq priority | ||
31 | # priolt priority | ||
32 | # priogt priority | ||
33 | # nprioeq normal priority | ||
34 | # npriolt normal priority | ||
35 | # npriogt normal priority | ||
36 | # locked lock nr (0-7) | ||
37 | # blocked lock nr (0-7) | ||
38 | # blockedwake lock nr (0-7) | ||
39 | # unlocked lock nr (0-7) | ||
40 | # opcodeeq command opcode or number | ||
41 | # opcodelt number | ||
42 | # opcodegt number | ||
43 | # eventeq number | ||
44 | # eventgt number | ||
45 | # eventlt number | ||
46 | |||
47 | # | ||
48 | # 3 threads 1 lock PI | ||
49 | # | ||
50 | C: resetevent: 0: 0 | ||
51 | W: opcodeeq: 0: 0 | ||
52 | |||
53 | # Set schedulers | ||
54 | C: schedother: 0: 0 | ||
55 | C: schedother: 1: 0 | ||
56 | C: schedfifo: 2: 82 | ||
57 | |||
58 | # T0 lock L0 | ||
59 | C: locknowait: 0: 0 | ||
60 | W: locked: 0: 0 | ||
61 | |||
62 | # T1 lock L0 | ||
63 | C: locknowait: 1: 0 | ||
64 | W: blocked: 1: 0 | ||
65 | T: priolt: 0: 1 | ||
66 | |||
67 | # T2 lock L0 | ||
68 | C: locknowait: 2: 0 | ||
69 | W: blocked: 2: 0 | ||
70 | T: prioeq: 0: 82 | ||
71 | |||
72 | # T0 unlock L0 | ||
73 | C: unlock: 0: 0 | ||
74 | |||
75 | # Wait until T2 got the lock | ||
76 | W: locked: 2: 0 | ||
77 | W: unlocked: 0: 0 | ||
78 | T: priolt: 0: 1 | ||
79 | |||
80 | # T2 unlock L0 | ||
81 | C: unlock: 2: 0 | ||
82 | |||
83 | W: unlocked: 2: 0 | ||
84 | W: locked: 1: 0 | ||
85 | |||
86 | C: unlock: 1: 0 | ||
87 | W: unlocked: 1: 0 | ||
diff --git a/scripts/rt-tester/t3-l1-pi-2rt.tst b/scripts/rt-tester/t3-l1-pi-2rt.tst deleted file mode 100644 index 69c2212fc520..000000000000 --- a/scripts/rt-tester/t3-l1-pi-2rt.tst +++ /dev/null | |||
@@ -1,88 +0,0 @@ | |||
1 | # | ||
2 | # rt-mutex test | ||
3 | # | ||
4 | # Op: C(ommand)/T(est)/W(ait) | ||
5 | # | opcode | ||
6 | # | | threadid: 0-7 | ||
7 | # | | | opcode argument | ||
8 | # | | | | | ||
9 | # C: lock: 0: 0 | ||
10 | # | ||
11 | # Commands | ||
12 | # | ||
13 | # opcode opcode argument | ||
14 | # schedother nice value | ||
15 | # schedfifo priority | ||
16 | # lock lock nr (0-7) | ||
17 | # locknowait lock nr (0-7) | ||
18 | # lockint lock nr (0-7) | ||
19 | # lockintnowait lock nr (0-7) | ||
20 | # lockcont lock nr (0-7) | ||
21 | # unlock lock nr (0-7) | ||
22 | # signal thread to signal (0-7) | ||
23 | # reset 0 | ||
24 | # resetevent 0 | ||
25 | # | ||
26 | # Tests / Wait | ||
27 | # | ||
28 | # opcode opcode argument | ||
29 | # | ||
30 | # prioeq priority | ||
31 | # priolt priority | ||
32 | # priogt priority | ||
33 | # nprioeq normal priority | ||
34 | # npriolt normal priority | ||
35 | # npriogt normal priority | ||
36 | # locked lock nr (0-7) | ||
37 | # blocked lock nr (0-7) | ||
38 | # blockedwake lock nr (0-7) | ||
39 | # unlocked lock nr (0-7) | ||
40 | # opcodeeq command opcode or number | ||
41 | # opcodelt number | ||
42 | # opcodegt number | ||
43 | # eventeq number | ||
44 | # eventgt number | ||
45 | # eventlt number | ||
46 | |||
47 | # | ||
48 | # 3 threads 1 lock PI | ||
49 | # | ||
50 | C: resetevent: 0: 0 | ||
51 | W: opcodeeq: 0: 0 | ||
52 | |||
53 | # Set schedulers | ||
54 | C: schedother: 0: 0 | ||
55 | C: schedfifo: 1: 81 | ||
56 | C: schedfifo: 2: 82 | ||
57 | |||
58 | # T0 lock L0 | ||
59 | C: locknowait: 0: 0 | ||
60 | W: locked: 0: 0 | ||
61 | |||
62 | # T1 lock L0 | ||
63 | C: locknowait: 1: 0 | ||
64 | W: blocked: 1: 0 | ||
65 | T: prioeq: 0: 81 | ||
66 | |||
67 | # T2 lock L0 | ||
68 | C: locknowait: 2: 0 | ||
69 | W: blocked: 2: 0 | ||
70 | T: prioeq: 0: 82 | ||
71 | T: prioeq: 1: 81 | ||
72 | |||
73 | # T0 unlock L0 | ||
74 | C: unlock: 0: 0 | ||
75 | |||
76 | # Wait until T2 got the lock | ||
77 | W: locked: 2: 0 | ||
78 | W: unlocked: 0: 0 | ||
79 | T: priolt: 0: 1 | ||
80 | |||
81 | # T2 unlock L0 | ||
82 | C: unlock: 2: 0 | ||
83 | |||
84 | W: unlocked: 2: 0 | ||
85 | W: locked: 1: 0 | ||
86 | |||
87 | C: unlock: 1: 0 | ||
88 | W: unlocked: 1: 0 | ||
diff --git a/scripts/rt-tester/t3-l1-pi-3rt.tst b/scripts/rt-tester/t3-l1-pi-3rt.tst deleted file mode 100644 index 9b0f1eb26a88..000000000000 --- a/scripts/rt-tester/t3-l1-pi-3rt.tst +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | # | ||
2 | # rt-mutex test | ||
3 | # | ||
4 | # Op: C(ommand)/T(est)/W(ait) | ||
5 | # | opcode | ||
6 | # | | threadid: 0-7 | ||
7 | # | | | opcode argument | ||
8 | # | | | | | ||
9 | # C: lock: 0: 0 | ||
10 | # | ||
11 | # Commands | ||
12 | # | ||
13 | # opcode opcode argument | ||
14 | # schedother nice value | ||
15 | # schedfifo priority | ||
16 | # lock lock nr (0-7) | ||
17 | # locknowait lock nr (0-7) | ||
18 | # lockint lock nr (0-7) | ||
19 | # lockintnowait lock nr (0-7) | ||
20 | # lockcont lock nr (0-7) | ||
21 | # unlock lock nr (0-7) | ||
22 | # signal thread to signal (0-7) | ||
23 | # reset 0 | ||
24 | # resetevent 0 | ||
25 | # | ||
26 | # Tests / Wait | ||
27 | # | ||
28 | # opcode opcode argument | ||
29 | # | ||
30 | # prioeq priority | ||
31 | # priolt priority | ||
32 | # priogt priority | ||
33 | # nprioeq normal priority | ||
34 | # npriolt normal priority | ||
35 | # npriogt normal priority | ||
36 | # locked lock nr (0-7) | ||
37 | # blocked lock nr (0-7) | ||
38 | # blockedwake lock nr (0-7) | ||
39 | # unlocked lock nr (0-7) | ||
40 | # opcodeeq command opcode or number | ||
41 | # opcodelt number | ||
42 | # opcodegt number | ||
43 | # eventeq number | ||
44 | # eventgt number | ||
45 | # eventlt number | ||
46 | |||
47 | # | ||
48 | # 3 threads 1 lock PI | ||
49 | # | ||
50 | C: resetevent: 0: 0 | ||
51 | W: opcodeeq: 0: 0 | ||
52 | |||
53 | # Set schedulers | ||
54 | C: schedfifo: 0: 80 | ||
55 | C: schedfifo: 1: 81 | ||
56 | C: schedfifo: 2: 82 | ||
57 | |||
58 | # T0 lock L0 | ||
59 | C: locknowait: 0: 0 | ||
60 | W: locked: 0: 0 | ||
61 | |||
62 | # T1 lock L0 | ||
63 | C: locknowait: 1: 0 | ||
64 | W: blocked: 1: 0 | ||
65 | T: prioeq: 0: 81 | ||
66 | |||
67 | # T2 lock L0 | ||
68 | C: locknowait: 2: 0 | ||
69 | W: blocked: 2: 0 | ||
70 | T: prioeq: 0: 82 | ||
71 | |||
72 | # T0 unlock L0 | ||
73 | C: unlock: 0: 0 | ||
74 | |||
75 | # Wait until T2 got the lock | ||
76 | W: locked: 2: 0 | ||
77 | W: unlocked: 0: 0 | ||
78 | T: prioeq: 0: 80 | ||
79 | |||
80 | # T2 unlock L0 | ||
81 | C: unlock: 2: 0 | ||
82 | |||
83 | W: locked: 1: 0 | ||
84 | W: unlocked: 2: 0 | ||
85 | |||
86 | C: unlock: 1: 0 | ||
87 | W: unlocked: 1: 0 | ||
diff --git a/scripts/rt-tester/t3-l1-pi-signal.tst b/scripts/rt-tester/t3-l1-pi-signal.tst deleted file mode 100644 index 39ec74ab06ee..000000000000 --- a/scripts/rt-tester/t3-l1-pi-signal.tst +++ /dev/null | |||
@@ -1,93 +0,0 @@ | |||
1 | # | ||
2 | # rt-mutex test | ||
3 | # | ||
4 | # Op: C(ommand)/T(est)/W(ait) | ||
5 | # | opcode | ||
6 | # | | threadid: 0-7 | ||
7 | # | | | opcode argument | ||
8 | # | | | | | ||
9 | # C: lock: 0: 0 | ||
10 | # | ||
11 | # Commands | ||
12 | # | ||
13 | # opcode opcode argument | ||
14 | # schedother nice value | ||
15 | # schedfifo priority | ||
16 | # lock lock nr (0-7) | ||
17 | # locknowait lock nr (0-7) | ||
18 | # lockint lock nr (0-7) | ||
19 | # lockintnowait lock nr (0-7) | ||
20 | # lockcont lock nr (0-7) | ||
21 | # unlock lock nr (0-7) | ||
22 | # signal thread to signal (0-7) | ||
23 | # reset 0 | ||
24 | # resetevent 0 | ||
25 | # | ||
26 | # Tests / Wait | ||
27 | # | ||
28 | # opcode opcode argument | ||
29 | # | ||
30 | # prioeq priority | ||
31 | # priolt priority | ||
32 | # priogt priority | ||
33 | # nprioeq normal priority | ||
34 | # npriolt normal priority | ||
35 | # npriogt normal priority | ||
36 | # locked lock nr (0-7) | ||
37 | # blocked lock nr (0-7) | ||
38 | # blockedwake lock nr (0-7) | ||
39 | # unlocked lock nr (0-7) | ||
40 | # opcodeeq command opcode or number | ||
41 | # opcodelt number | ||
42 | # opcodegt number | ||
43 | # eventeq number | ||
44 | # eventgt number | ||
45 | # eventlt number | ||
46 | |||
47 | # Reset event counter | ||
48 | C: resetevent: 0: 0 | ||
49 | W: opcodeeq: 0: 0 | ||
50 | |||
51 | # Set priorities | ||
52 | C: schedother: 0: 0 | ||
53 | C: schedfifo: 1: 80 | ||
54 | C: schedfifo: 2: 81 | ||
55 | |||
56 | # T0 lock L0 | ||
57 | C: lock: 0: 0 | ||
58 | W: locked: 0: 0 | ||
59 | |||
60 | # T1 lock L0, no wait in the wakeup path | ||
61 | C: locknowait: 1: 0 | ||
62 | W: blocked: 1: 0 | ||
63 | T: prioeq: 0: 80 | ||
64 | T: prioeq: 1: 80 | ||
65 | |||
66 | # T2 lock L0 interruptible, no wait in the wakeup path | ||
67 | C: lockintnowait: 2: 0 | ||
68 | W: blocked: 2: 0 | ||
69 | T: prioeq: 0: 81 | ||
70 | T: prioeq: 1: 80 | ||
71 | |||
72 | # Interrupt T2 | ||
73 | C: signal: 2: 2 | ||
74 | W: unlocked: 2: 0 | ||
75 | T: prioeq: 1: 80 | ||
76 | T: prioeq: 0: 80 | ||
77 | |||
78 | T: locked: 0: 0 | ||
79 | T: blocked: 1: 0 | ||
80 | |||
81 | # T0 unlock L0 | ||
82 | C: unlock: 0: 0 | ||
83 | |||
84 | # Wait until T1 has locked L0 and exit | ||
85 | W: locked: 1: 0 | ||
86 | W: unlocked: 0: 0 | ||
87 | T: priolt: 0: 1 | ||
88 | |||
89 | C: unlock: 1: 0 | ||
90 | W: unlocked: 1: 0 | ||
91 | |||
92 | |||
93 | |||
diff --git a/scripts/rt-tester/t3-l1-pi-steal.tst b/scripts/rt-tester/t3-l1-pi-steal.tst deleted file mode 100644 index e03db7e010fa..000000000000 --- a/scripts/rt-tester/t3-l1-pi-steal.tst +++ /dev/null | |||
@@ -1,91 +0,0 @@ | |||
1 | # | ||
2 | # rt-mutex test | ||
3 | # | ||
4 | # Op: C(ommand)/T(est)/W(ait) | ||
5 | # | opcode | ||
6 | # | | threadid: 0-7 | ||
7 | # | | | opcode argument | ||
8 | # | | | | | ||
9 | # C: lock: 0: 0 | ||
10 | # | ||
11 | # Commands | ||
12 | # | ||
13 | # opcode opcode argument | ||
14 | # schedother nice value | ||
15 | # schedfifo priority | ||
16 | # lock lock nr (0-7) | ||
17 | # locknowait lock nr (0-7) | ||
18 | # lockint lock nr (0-7) | ||
19 | # lockintnowait lock nr (0-7) | ||
20 | # lockcont lock nr (0-7) | ||
21 | # unlock lock nr (0-7) | ||
22 | # signal thread to signal (0-7) | ||
23 | # reset 0 | ||
24 | # resetevent 0 | ||
25 | # | ||
26 | # Tests / Wait | ||
27 | # | ||
28 | # opcode opcode argument | ||
29 | # | ||
30 | # prioeq priority | ||
31 | # priolt priority | ||
32 | # priogt priority | ||
33 | # nprioeq normal priority | ||
34 | # npriolt normal priority | ||
35 | # npriogt normal priority | ||
36 | # locked lock nr (0-7) | ||
37 | # blocked lock nr (0-7) | ||
38 | # blockedwake lock nr (0-7) | ||
39 | # unlocked lock nr (0-7) | ||
40 | # opcodeeq command opcode or number | ||
41 | # opcodelt number | ||
42 | # opcodegt number | ||
43 | # eventeq number | ||
44 | # eventgt number | ||
45 | # eventlt number | ||
46 | |||
47 | # | ||
48 | # 3 threads 1 lock PI steal pending ownership | ||
49 | # | ||
50 | C: resetevent: 0: 0 | ||
51 | W: opcodeeq: 0: 0 | ||
52 | |||
53 | # Set schedulers | ||
54 | C: schedother: 0: 0 | ||
55 | C: schedfifo: 1: 80 | ||
56 | C: schedfifo: 2: 81 | ||
57 | |||
58 | # T0 lock L0 | ||
59 | C: lock: 0: 0 | ||
60 | W: locked: 0: 0 | ||
61 | |||
62 | # T1 lock L0 | ||
63 | C: lock: 1: 0 | ||
64 | W: blocked: 1: 0 | ||
65 | T: prioeq: 0: 80 | ||
66 | |||
67 | # T0 unlock L0 | ||
68 | C: unlock: 0: 0 | ||
69 | |||
70 | # Wait until T1 is in the wakeup loop | ||
71 | W: blockedwake: 1: 0 | ||
72 | T: priolt: 0: 1 | ||
73 | |||
74 | # T2 lock L0 | ||
75 | C: lock: 2: 0 | ||
76 | # T1 leave wakeup loop | ||
77 | C: lockcont: 1: 0 | ||
78 | |||
79 | # T2 must have the lock and T1 must be blocked | ||
80 | W: locked: 2: 0 | ||
81 | W: blocked: 1: 0 | ||
82 | |||
83 | # T2 unlock L0 | ||
84 | C: unlock: 2: 0 | ||
85 | |||
86 | # Wait until T1 is in the wakeup loop and let it run | ||
87 | W: blockedwake: 1: 0 | ||
88 | C: lockcont: 1: 0 | ||
89 | W: locked: 1: 0 | ||
90 | C: unlock: 1: 0 | ||
91 | W: unlocked: 1: 0 | ||
diff --git a/scripts/rt-tester/t3-l2-pi.tst b/scripts/rt-tester/t3-l2-pi.tst deleted file mode 100644 index 7b59100d3e48..000000000000 --- a/scripts/rt-tester/t3-l2-pi.tst +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | # | ||
2 | # rt-mutex test | ||
3 | # | ||
4 | # Op: C(ommand)/T(est)/W(ait) | ||
5 | # | opcode | ||
6 | # | | threadid: 0-7 | ||
7 | # | | | opcode argument | ||
8 | # | | | | | ||
9 | # C: lock: 0: 0 | ||
10 | # | ||
11 | # Commands | ||
12 | # | ||
13 | # opcode opcode argument | ||
14 | # schedother nice value | ||
15 | # schedfifo priority | ||
16 | # lock lock nr (0-7) | ||
17 | # locknowait lock nr (0-7) | ||
18 | # lockint lock nr (0-7) | ||
19 | # lockintnowait lock nr (0-7) | ||
20 | # lockcont lock nr (0-7) | ||
21 | # unlock lock nr (0-7) | ||
22 | # signal thread to signal (0-7) | ||
23 | # reset 0 | ||
24 | # resetevent 0 | ||
25 | # | ||
26 | # Tests / Wait | ||
27 | # | ||
28 | # opcode opcode argument | ||
29 | # | ||
30 | # prioeq priority | ||
31 | # priolt priority | ||
32 | # priogt priority | ||
33 | # nprioeq normal priority | ||
34 | # npriolt normal priority | ||
35 | # npriogt normal priority | ||
36 | # locked lock nr (0-7) | ||
37 | # blocked lock nr (0-7) | ||
38 | # blockedwake lock nr (0-7) | ||
39 | # unlocked lock nr (0-7) | ||
40 | # opcodeeq command opcode or number | ||
41 | # opcodelt number | ||
42 | # opcodegt number | ||
43 | # eventeq number | ||
44 | # eventgt number | ||
45 | # eventlt number | ||
46 | |||
47 | # | ||
48 | # 3 threads 2 lock PI | ||
49 | # | ||
50 | C: resetevent: 0: 0 | ||
51 | W: opcodeeq: 0: 0 | ||
52 | |||
53 | # Set schedulers | ||
54 | C: schedother: 0: 0 | ||
55 | C: schedother: 1: 0 | ||
56 | C: schedfifo: 2: 82 | ||
57 | |||
58 | # T0 lock L0 | ||
59 | C: locknowait: 0: 0 | ||
60 | W: locked: 0: 0 | ||
61 | |||
62 | # T1 lock L0 | ||
63 | C: locknowait: 1: 0 | ||
64 | W: blocked: 1: 0 | ||
65 | T: priolt: 0: 1 | ||
66 | |||
67 | # T2 lock L0 | ||
68 | C: locknowait: 2: 0 | ||
69 | W: blocked: 2: 0 | ||
70 | T: prioeq: 0: 82 | ||
71 | |||
72 | # T0 unlock L0 | ||
73 | C: unlock: 0: 0 | ||
74 | |||
75 | # Wait until T2 got the lock | ||
76 | W: locked: 2: 0 | ||
77 | W: unlocked: 0: 0 | ||
78 | T: priolt: 0: 1 | ||
79 | |||
80 | # T2 unlock L0 | ||
81 | C: unlock: 2: 0 | ||
82 | |||
83 | W: unlocked: 2: 0 | ||
84 | W: locked: 1: 0 | ||
85 | |||
86 | C: unlock: 1: 0 | ||
87 | W: unlocked: 1: 0 | ||
diff --git a/scripts/rt-tester/t4-l2-pi-deboost.tst b/scripts/rt-tester/t4-l2-pi-deboost.tst deleted file mode 100644 index 2f0e049d6443..000000000000 --- a/scripts/rt-tester/t4-l2-pi-deboost.tst +++ /dev/null | |||
@@ -1,118 +0,0 @@ | |||
1 | # | ||
2 | # rt-mutex test | ||
3 | # | ||
4 | # Op: C(ommand)/T(est)/W(ait) | ||
5 | # | opcode | ||
6 | # | | threadid: 0-7 | ||
7 | # | | | opcode argument | ||
8 | # | | | | | ||
9 | # C: lock: 0: 0 | ||
10 | # | ||
11 | # Commands | ||
12 | # | ||
13 | # opcode opcode argument | ||
14 | # schedother nice value | ||
15 | # schedfifo priority | ||
16 | # lock lock nr (0-7) | ||
17 | # locknowait lock nr (0-7) | ||
18 | # lockint lock nr (0-7) | ||
19 | # lockintnowait lock nr (0-7) | ||
20 | # lockcont lock nr (0-7) | ||
21 | # unlock lock nr (0-7) | ||
22 | # signal thread to signal (0-7) | ||
23 | # reset 0 | ||
24 | # resetevent 0 | ||
25 | # | ||
26 | # Tests / Wait | ||
27 | # | ||
28 | # opcode opcode argument | ||
29 | # | ||
30 | # prioeq priority | ||
31 | # priolt priority | ||
32 | # priogt priority | ||
33 | # nprioeq normal priority | ||
34 | # npriolt normal priority | ||
35 | # npriogt normal priority | ||
36 | # locked lock nr (0-7) | ||
37 | # blocked lock nr (0-7) | ||
38 | # blockedwake lock nr (0-7) | ||
39 | # unlocked lock nr (0-7) | ||
40 | # opcodeeq command opcode or number | ||
41 | # opcodelt number | ||
42 | # opcodegt number | ||
43 | # eventeq number | ||
44 | # eventgt number | ||
45 | # eventlt number | ||
46 | |||
47 | # | ||
48 | # 4 threads 2 lock PI | ||
49 | # | ||
50 | C: resetevent: 0: 0 | ||
51 | W: opcodeeq: 0: 0 | ||
52 | |||
53 | # Set schedulers | ||
54 | C: schedother: 0: 0 | ||
55 | C: schedother: 1: 0 | ||
56 | C: schedfifo: 2: 82 | ||
57 | C: schedfifo: 3: 83 | ||
58 | |||
59 | # T0 lock L0 | ||
60 | C: locknowait: 0: 0 | ||
61 | W: locked: 0: 0 | ||
62 | |||
63 | # T1 lock L1 | ||
64 | C: locknowait: 1: 1 | ||
65 | W: locked: 1: 1 | ||
66 | |||
67 | # T3 lock L0 | ||
68 | C: lockintnowait: 3: 0 | ||
69 | W: blocked: 3: 0 | ||
70 | T: prioeq: 0: 83 | ||
71 | |||
72 | # T0 lock L1 | ||
73 | C: lock: 0: 1 | ||
74 | W: blocked: 0: 1 | ||
75 | T: prioeq: 1: 83 | ||
76 | |||
77 | # T1 unlock L1 | ||
78 | C: unlock: 1: 1 | ||
79 | |||
80 | # Wait until T0 is in the wakeup code | ||
81 | W: blockedwake: 0: 1 | ||
82 | |||
83 | # Verify that T1 is unboosted | ||
84 | W: unlocked: 1: 1 | ||
85 | T: priolt: 1: 1 | ||
86 | |||
87 | # T2 lock L1 (T0 is boosted and pending owner !) | ||
88 | C: locknowait: 2: 1 | ||
89 | W: blocked: 2: 1 | ||
90 | T: prioeq: 0: 83 | ||
91 | |||
92 | # Interrupt T3 and wait until T3 returned | ||
93 | C: signal: 3: 0 | ||
94 | W: unlocked: 3: 0 | ||
95 | |||
96 | # Verify prio of T0 (still pending owner, | ||
97 | # but T2 is enqueued due to the previous boost by T3 | ||
98 | T: prioeq: 0: 82 | ||
99 | |||
100 | # Let T0 continue | ||
101 | C: lockcont: 0: 1 | ||
102 | W: locked: 0: 1 | ||
103 | |||
104 | # Unlock L1 and let T2 get L1 | ||
105 | C: unlock: 0: 1 | ||
106 | W: locked: 2: 1 | ||
107 | |||
108 | # Verify that T0 is unboosted | ||
109 | W: unlocked: 0: 1 | ||
110 | T: priolt: 0: 1 | ||
111 | |||
112 | # Unlock everything and exit | ||
113 | C: unlock: 2: 1 | ||
114 | W: unlocked: 2: 1 | ||
115 | |||
116 | C: unlock: 0: 0 | ||
117 | W: unlocked: 0: 0 | ||
118 | |||
diff --git a/scripts/rt-tester/t5-l4-pi-boost-deboost-setsched.tst b/scripts/rt-tester/t5-l4-pi-boost-deboost-setsched.tst deleted file mode 100644 index 04f4034ff895..000000000000 --- a/scripts/rt-tester/t5-l4-pi-boost-deboost-setsched.tst +++ /dev/null | |||
@@ -1,178 +0,0 @@ | |||
1 | # | ||
2 | # rt-mutex test | ||
3 | # | ||
4 | # Op: C(ommand)/T(est)/W(ait) | ||
5 | # | opcode | ||
6 | # | | threadid: 0-7 | ||
7 | # | | | opcode argument | ||
8 | # | | | | | ||
9 | # C: lock: 0: 0 | ||
10 | # | ||
11 | # Commands | ||
12 | # | ||
13 | # opcode opcode argument | ||
14 | # schedother nice value | ||
15 | # schedfifo priority | ||
16 | # lock lock nr (0-7) | ||
17 | # locknowait lock nr (0-7) | ||
18 | # lockint lock nr (0-7) | ||
19 | # lockintnowait lock nr (0-7) | ||
20 | # lockcont lock nr (0-7) | ||
21 | # unlock lock nr (0-7) | ||
22 | # signal thread to signal (0-7) | ||
23 | # reset 0 | ||
24 | # resetevent 0 | ||
25 | # | ||
26 | # Tests / Wait | ||
27 | # | ||
28 | # opcode opcode argument | ||
29 | # | ||
30 | # prioeq priority | ||
31 | # priolt priority | ||
32 | # priogt priority | ||
33 | # nprioeq normal priority | ||
34 | # npriolt normal priority | ||
35 | # npriogt normal priority | ||
36 | # locked lock nr (0-7) | ||
37 | # blocked lock nr (0-7) | ||
38 | # blockedwake lock nr (0-7) | ||
39 | # unlocked lock nr (0-7) | ||
40 | # opcodeeq command opcode or number | ||
41 | # opcodelt number | ||
42 | # opcodegt number | ||
43 | # eventeq number | ||
44 | # eventgt number | ||
45 | # eventlt number | ||
46 | |||
47 | # | ||
48 | # 5 threads 4 lock PI - modify priority of blocked threads | ||
49 | # | ||
50 | C: resetevent: 0: 0 | ||
51 | W: opcodeeq: 0: 0 | ||
52 | |||
53 | # Set schedulers | ||
54 | C: schedother: 0: 0 | ||
55 | C: schedfifo: 1: 81 | ||
56 | C: schedfifo: 2: 82 | ||
57 | C: schedfifo: 3: 83 | ||
58 | C: schedfifo: 4: 84 | ||
59 | |||
60 | # T0 lock L0 | ||
61 | C: locknowait: 0: 0 | ||
62 | W: locked: 0: 0 | ||
63 | |||
64 | # T1 lock L1 | ||
65 | C: locknowait: 1: 1 | ||
66 | W: locked: 1: 1 | ||
67 | |||
68 | # T1 lock L0 | ||
69 | C: lockintnowait: 1: 0 | ||
70 | W: blocked: 1: 0 | ||
71 | T: prioeq: 0: 81 | ||
72 | |||
73 | # T2 lock L2 | ||
74 | C: locknowait: 2: 2 | ||
75 | W: locked: 2: 2 | ||
76 | |||
77 | # T2 lock L1 | ||
78 | C: lockintnowait: 2: 1 | ||
79 | W: blocked: 2: 1 | ||
80 | T: prioeq: 0: 82 | ||
81 | T: prioeq: 1: 82 | ||
82 | |||
83 | # T3 lock L3 | ||
84 | C: locknowait: 3: 3 | ||
85 | W: locked: 3: 3 | ||
86 | |||
87 | # T3 lock L2 | ||
88 | C: lockintnowait: 3: 2 | ||
89 | W: blocked: 3: 2 | ||
90 | T: prioeq: 0: 83 | ||
91 | T: prioeq: 1: 83 | ||
92 | T: prioeq: 2: 83 | ||
93 | |||
94 | # T4 lock L3 | ||
95 | C: lockintnowait: 4: 3 | ||
96 | W: blocked: 4: 3 | ||
97 | T: prioeq: 0: 84 | ||
98 | T: prioeq: 1: 84 | ||
99 | T: prioeq: 2: 84 | ||
100 | T: prioeq: 3: 84 | ||
101 | |||
102 | # Reduce prio of T4 | ||
103 | C: schedfifo: 4: 80 | ||
104 | T: prioeq: 0: 83 | ||
105 | T: prioeq: 1: 83 | ||
106 | T: prioeq: 2: 83 | ||
107 | T: prioeq: 3: 83 | ||
108 | T: prioeq: 4: 80 | ||
109 | |||
110 | # Increase prio of T4 | ||
111 | C: schedfifo: 4: 84 | ||
112 | T: prioeq: 0: 84 | ||
113 | T: prioeq: 1: 84 | ||
114 | T: prioeq: 2: 84 | ||
115 | T: prioeq: 3: 84 | ||
116 | T: prioeq: 4: 84 | ||
117 | |||
118 | # Reduce prio of T3 | ||
119 | C: schedfifo: 3: 80 | ||
120 | T: prioeq: 0: 84 | ||
121 | T: prioeq: 1: 84 | ||
122 | T: prioeq: 2: 84 | ||
123 | T: prioeq: 3: 84 | ||
124 | T: prioeq: 4: 84 | ||
125 | |||
126 | # Increase prio of T3 | ||
127 | C: schedfifo: 3: 85 | ||
128 | T: prioeq: 0: 85 | ||
129 | T: prioeq: 1: 85 | ||
130 | T: prioeq: 2: 85 | ||
131 | T: prioeq: 3: 85 | ||
132 | T: prioeq: 4: 84 | ||
133 | |||
134 | # Reduce prio of T3 | ||
135 | C: schedfifo: 3: 83 | ||
136 | T: prioeq: 0: 84 | ||
137 | T: prioeq: 1: 84 | ||
138 | T: prioeq: 2: 84 | ||
139 | T: prioeq: 3: 84 | ||
140 | T: prioeq: 4: 84 | ||
141 | |||
142 | # Signal T4 | ||
143 | C: signal: 4: 0 | ||
144 | W: unlocked: 4: 3 | ||
145 | T: prioeq: 0: 83 | ||
146 | T: prioeq: 1: 83 | ||
147 | T: prioeq: 2: 83 | ||
148 | T: prioeq: 3: 83 | ||
149 | |||
150 | # Signal T3 | ||
151 | C: signal: 3: 0 | ||
152 | W: unlocked: 3: 2 | ||
153 | T: prioeq: 0: 82 | ||
154 | T: prioeq: 1: 82 | ||
155 | T: prioeq: 2: 82 | ||
156 | |||
157 | # Signal T2 | ||
158 | C: signal: 2: 0 | ||
159 | W: unlocked: 2: 1 | ||
160 | T: prioeq: 0: 81 | ||
161 | T: prioeq: 1: 81 | ||
162 | |||
163 | # Signal T1 | ||
164 | C: signal: 1: 0 | ||
165 | W: unlocked: 1: 0 | ||
166 | T: priolt: 0: 1 | ||
167 | |||
168 | # Unlock and exit | ||
169 | C: unlock: 3: 3 | ||
170 | C: unlock: 2: 2 | ||
171 | C: unlock: 1: 1 | ||
172 | C: unlock: 0: 0 | ||
173 | |||
174 | W: unlocked: 3: 3 | ||
175 | W: unlocked: 2: 2 | ||
176 | W: unlocked: 1: 1 | ||
177 | W: unlocked: 0: 0 | ||
178 | |||
diff --git a/scripts/rt-tester/t5-l4-pi-boost-deboost.tst b/scripts/rt-tester/t5-l4-pi-boost-deboost.tst deleted file mode 100644 index a48a6ee29ddc..000000000000 --- a/scripts/rt-tester/t5-l4-pi-boost-deboost.tst +++ /dev/null | |||
@@ -1,138 +0,0 @@ | |||
1 | # | ||
2 | # rt-mutex test | ||
3 | # | ||
4 | # Op: C(ommand)/T(est)/W(ait) | ||
5 | # | opcode | ||
6 | # | | threadid: 0-7 | ||
7 | # | | | opcode argument | ||
8 | # | | | | | ||
9 | # C: lock: 0: 0 | ||
10 | # | ||
11 | # Commands | ||
12 | # | ||
13 | # opcode opcode argument | ||
14 | # schedother nice value | ||
15 | # schedfifo priority | ||
16 | # lock lock nr (0-7) | ||
17 | # locknowait lock nr (0-7) | ||
18 | # lockint lock nr (0-7) | ||
19 | # lockintnowait lock nr (0-7) | ||
20 | # lockcont lock nr (0-7) | ||
21 | # unlock lock nr (0-7) | ||
22 | # signal thread to signal (0-7) | ||
23 | # reset 0 | ||
24 | # resetevent 0 | ||
25 | # | ||
26 | # Tests / Wait | ||
27 | # | ||
28 | # opcode opcode argument | ||
29 | # | ||
30 | # prioeq priority | ||
31 | # priolt priority | ||
32 | # priogt priority | ||
33 | # nprioeq normal priority | ||
34 | # npriolt normal priority | ||
35 | # npriogt normal priority | ||
36 | # locked lock nr (0-7) | ||
37 | # blocked lock nr (0-7) | ||
38 | # blockedwake lock nr (0-7) | ||
39 | # unlocked lock nr (0-7) | ||
40 | # opcodeeq command opcode or number | ||
41 | # opcodelt number | ||
42 | # opcodegt number | ||
43 | # eventeq number | ||
44 | # eventgt number | ||
45 | # eventlt number | ||
46 | |||
47 | # | ||
48 | # 5 threads 4 lock PI | ||
49 | # | ||
50 | C: resetevent: 0: 0 | ||
51 | W: opcodeeq: 0: 0 | ||
52 | |||
53 | # Set schedulers | ||
54 | C: schedother: 0: 0 | ||
55 | C: schedfifo: 1: 81 | ||
56 | C: schedfifo: 2: 82 | ||
57 | C: schedfifo: 3: 83 | ||
58 | C: schedfifo: 4: 84 | ||
59 | |||
60 | # T0 lock L0 | ||
61 | C: locknowait: 0: 0 | ||
62 | W: locked: 0: 0 | ||
63 | |||
64 | # T1 lock L1 | ||
65 | C: locknowait: 1: 1 | ||
66 | W: locked: 1: 1 | ||
67 | |||
68 | # T1 lock L0 | ||
69 | C: lockintnowait: 1: 0 | ||
70 | W: blocked: 1: 0 | ||
71 | T: prioeq: 0: 81 | ||
72 | |||
73 | # T2 lock L2 | ||
74 | C: locknowait: 2: 2 | ||
75 | W: locked: 2: 2 | ||
76 | |||
77 | # T2 lock L1 | ||
78 | C: lockintnowait: 2: 1 | ||
79 | W: blocked: 2: 1 | ||
80 | T: prioeq: 0: 82 | ||
81 | T: prioeq: 1: 82 | ||
82 | |||
83 | # T3 lock L3 | ||
84 | C: locknowait: 3: 3 | ||
85 | W: locked: 3: 3 | ||
86 | |||
87 | # T3 lock L2 | ||
88 | C: lockintnowait: 3: 2 | ||
89 | W: blocked: 3: 2 | ||
90 | T: prioeq: 0: 83 | ||
91 | T: prioeq: 1: 83 | ||
92 | T: prioeq: 2: 83 | ||
93 | |||
94 | # T4 lock L3 | ||
95 | C: lockintnowait: 4: 3 | ||
96 | W: blocked: 4: 3 | ||
97 | T: prioeq: 0: 84 | ||
98 | T: prioeq: 1: 84 | ||
99 | T: prioeq: 2: 84 | ||
100 | T: prioeq: 3: 84 | ||
101 | |||
102 | # Signal T4 | ||
103 | C: signal: 4: 0 | ||
104 | W: unlocked: 4: 3 | ||
105 | T: prioeq: 0: 83 | ||
106 | T: prioeq: 1: 83 | ||
107 | T: prioeq: 2: 83 | ||
108 | T: prioeq: 3: 83 | ||
109 | |||
110 | # Signal T3 | ||
111 | C: signal: 3: 0 | ||
112 | W: unlocked: 3: 2 | ||
113 | T: prioeq: 0: 82 | ||
114 | T: prioeq: 1: 82 | ||
115 | T: prioeq: 2: 82 | ||
116 | |||
117 | # Signal T2 | ||
118 | C: signal: 2: 0 | ||
119 | W: unlocked: 2: 1 | ||
120 | T: prioeq: 0: 81 | ||
121 | T: prioeq: 1: 81 | ||
122 | |||
123 | # Signal T1 | ||
124 | C: signal: 1: 0 | ||
125 | W: unlocked: 1: 0 | ||
126 | T: priolt: 0: 1 | ||
127 | |||
128 | # Unlock and exit | ||
129 | C: unlock: 3: 3 | ||
130 | C: unlock: 2: 2 | ||
131 | C: unlock: 1: 1 | ||
132 | C: unlock: 0: 0 | ||
133 | |||
134 | W: unlocked: 3: 3 | ||
135 | W: unlocked: 2: 2 | ||
136 | W: unlocked: 1: 1 | ||
137 | W: unlocked: 0: 0 | ||
138 | |||
diff --git a/scripts/selinux/mdp/mdp.c b/scripts/selinux/mdp/mdp.c index 62b34ce1f50d..e10beb11b696 100644 --- a/scripts/selinux/mdp/mdp.c +++ b/scripts/selinux/mdp/mdp.c | |||
@@ -98,6 +98,7 @@ int main(int argc, char *argv[]) | |||
98 | 98 | ||
99 | /* types, roles, and allows */ | 99 | /* types, roles, and allows */ |
100 | fprintf(fout, "type base_t;\n"); | 100 | fprintf(fout, "type base_t;\n"); |
101 | fprintf(fout, "role base_r;\n"); | ||
101 | fprintf(fout, "role base_r types { base_t };\n"); | 102 | fprintf(fout, "role base_r types { base_t };\n"); |
102 | for (i = 0; secclass_map[i].name; i++) | 103 | for (i = 0; secclass_map[i].name; i++) |
103 | fprintf(fout, "allow base_t base_t:%s *;\n", | 104 | fprintf(fout, "allow base_t base_t:%s *;\n", |
diff --git a/scripts/sign-file b/scripts/sign-file deleted file mode 100755 index 3906ee1e2f76..000000000000 --- a/scripts/sign-file +++ /dev/null | |||
@@ -1,421 +0,0 @@ | |||
1 | #!/usr/bin/perl -w | ||
2 | # | ||
3 | # Sign a module file using the given key. | ||
4 | # | ||
5 | |||
6 | my $USAGE = | ||
7 | "Usage: scripts/sign-file [-v] <hash algo> <key> <x509> <module> [<dest>]\n" . | ||
8 | " scripts/sign-file [-v] -s <raw sig> <hash algo> <x509> <module> [<dest>]\n"; | ||
9 | |||
10 | use strict; | ||
11 | use FileHandle; | ||
12 | use IPC::Open2; | ||
13 | use Getopt::Std; | ||
14 | |||
15 | my %opts; | ||
16 | getopts('vs:', \%opts) or die $USAGE; | ||
17 | my $verbose = $opts{'v'}; | ||
18 | my $signature_file = $opts{'s'}; | ||
19 | |||
20 | die $USAGE if ($#ARGV > 4); | ||
21 | die $USAGE if (!$signature_file && $#ARGV < 3 || $signature_file && $#ARGV < 2); | ||
22 | |||
23 | my $dgst = shift @ARGV; | ||
24 | my $private_key; | ||
25 | if (!$signature_file) { | ||
26 | $private_key = shift @ARGV; | ||
27 | } | ||
28 | my $x509 = shift @ARGV; | ||
29 | my $module = shift @ARGV; | ||
30 | my ($dest, $keep_orig); | ||
31 | if (@ARGV) { | ||
32 | $dest = $ARGV[0]; | ||
33 | $keep_orig = 1; | ||
34 | } else { | ||
35 | $dest = $module . "~"; | ||
36 | } | ||
37 | |||
38 | die "Can't read private key\n" if (!$signature_file && !-r $private_key); | ||
39 | die "Can't read signature file\n" if ($signature_file && !-r $signature_file); | ||
40 | die "Can't read X.509 certificate\n" unless (-r $x509); | ||
41 | die "Can't read module\n" unless (-r $module); | ||
42 | |||
43 | # | ||
44 | # Function to read the contents of a file into a variable. | ||
45 | # | ||
46 | sub read_file($) | ||
47 | { | ||
48 | my ($file) = @_; | ||
49 | my $contents; | ||
50 | my $len; | ||
51 | |||
52 | open(FD, "<$file") || die $file; | ||
53 | binmode FD; | ||
54 | my @st = stat(FD); | ||
55 | die $file if (!@st); | ||
56 | $len = read(FD, $contents, $st[7]) || die $file; | ||
57 | close(FD) || die $file; | ||
58 | die "$file: Wanted length ", $st[7], ", got ", $len, "\n" | ||
59 | if ($len != $st[7]); | ||
60 | return $contents; | ||
61 | } | ||
62 | |||
63 | ############################################################################### | ||
64 | # | ||
65 | # First of all, we have to parse the X.509 certificate to find certain details | ||
66 | # about it. | ||
67 | # | ||
68 | # We read the DER-encoded X509 certificate and parse it to extract the Subject | ||
69 | # name and Subject Key Identifier. Theis provides the data we need to build | ||
70 | # the certificate identifier. | ||
71 | # | ||
72 | # The signer's name part of the identifier is fabricated from the commonName, | ||
73 | # the organizationName or the emailAddress components of the X.509 subject | ||
74 | # name. | ||
75 | # | ||
76 | # The subject key ID is used to select which of that signer's certificates | ||
77 | # we're intending to use to sign the module. | ||
78 | # | ||
79 | ############################################################################### | ||
80 | my $x509_certificate = read_file($x509); | ||
81 | |||
82 | my $UNIV = 0 << 6; | ||
83 | my $APPL = 1 << 6; | ||
84 | my $CONT = 2 << 6; | ||
85 | my $PRIV = 3 << 6; | ||
86 | |||
87 | my $CONS = 0x20; | ||
88 | |||
89 | my $BOOLEAN = 0x01; | ||
90 | my $INTEGER = 0x02; | ||
91 | my $BIT_STRING = 0x03; | ||
92 | my $OCTET_STRING = 0x04; | ||
93 | my $NULL = 0x05; | ||
94 | my $OBJ_ID = 0x06; | ||
95 | my $UTF8String = 0x0c; | ||
96 | my $SEQUENCE = 0x10; | ||
97 | my $SET = 0x11; | ||
98 | my $UTCTime = 0x17; | ||
99 | my $GeneralizedTime = 0x18; | ||
100 | |||
101 | my %OIDs = ( | ||
102 | pack("CCC", 85, 4, 3) => "commonName", | ||
103 | pack("CCC", 85, 4, 6) => "countryName", | ||
104 | pack("CCC", 85, 4, 10) => "organizationName", | ||
105 | pack("CCC", 85, 4, 11) => "organizationUnitName", | ||
106 | pack("CCCCCCCCC", 42, 134, 72, 134, 247, 13, 1, 1, 1) => "rsaEncryption", | ||
107 | pack("CCCCCCCCC", 42, 134, 72, 134, 247, 13, 1, 1, 5) => "sha1WithRSAEncryption", | ||
108 | pack("CCCCCCCCC", 42, 134, 72, 134, 247, 13, 1, 9, 1) => "emailAddress", | ||
109 | pack("CCC", 85, 29, 35) => "authorityKeyIdentifier", | ||
110 | pack("CCC", 85, 29, 14) => "subjectKeyIdentifier", | ||
111 | pack("CCC", 85, 29, 19) => "basicConstraints" | ||
112 | ); | ||
113 | |||
114 | ############################################################################### | ||
115 | # | ||
116 | # Extract an ASN.1 element from a string and return information about it. | ||
117 | # | ||
118 | ############################################################################### | ||
119 | sub asn1_extract($$@) | ||
120 | { | ||
121 | my ($cursor, $expected_tag, $optional) = @_; | ||
122 | |||
123 | return [ -1 ] | ||
124 | if ($cursor->[1] == 0 && $optional); | ||
125 | |||
126 | die $x509, ": ", $cursor->[0], ": ASN.1 data underrun (elem ", $cursor->[1], ")\n" | ||
127 | if ($cursor->[1] < 2); | ||
128 | |||
129 | my ($tag, $len) = unpack("CC", substr(${$cursor->[2]}, $cursor->[0], 2)); | ||
130 | |||
131 | if ($expected_tag != -1 && $tag != $expected_tag) { | ||
132 | return [ -1 ] | ||
133 | if ($optional); | ||
134 | die $x509, ": ", $cursor->[0], ": ASN.1 unexpected tag (", $tag, | ||
135 | " not ", $expected_tag, ")\n"; | ||
136 | } | ||
137 | |||
138 | $cursor->[0] += 2; | ||
139 | $cursor->[1] -= 2; | ||
140 | |||
141 | die $x509, ": ", $cursor->[0], ": ASN.1 long tag\n" | ||
142 | if (($tag & 0x1f) == 0x1f); | ||
143 | die $x509, ": ", $cursor->[0], ": ASN.1 indefinite length\n" | ||
144 | if ($len == 0x80); | ||
145 | |||
146 | if ($len > 0x80) { | ||
147 | my $l = $len - 0x80; | ||
148 | die $x509, ": ", $cursor->[0], ": ASN.1 data underrun (len len $l)\n" | ||
149 | if ($cursor->[1] < $l); | ||
150 | |||
151 | if ($l == 0x1) { | ||
152 | $len = unpack("C", substr(${$cursor->[2]}, $cursor->[0], 1)); | ||
153 | } elsif ($l == 0x2) { | ||
154 | $len = unpack("n", substr(${$cursor->[2]}, $cursor->[0], 2)); | ||
155 | } elsif ($l == 0x3) { | ||
156 | $len = unpack("C", substr(${$cursor->[2]}, $cursor->[0], 1)) << 16; | ||
157 | $len = unpack("n", substr(${$cursor->[2]}, $cursor->[0] + 1, 2)); | ||
158 | } elsif ($l == 0x4) { | ||
159 | $len = unpack("N", substr(${$cursor->[2]}, $cursor->[0], 4)); | ||
160 | } else { | ||
161 | die $x509, ": ", $cursor->[0], ": ASN.1 element too long (", $l, ")\n"; | ||
162 | } | ||
163 | |||
164 | $cursor->[0] += $l; | ||
165 | $cursor->[1] -= $l; | ||
166 | } | ||
167 | |||
168 | die $x509, ": ", $cursor->[0], ": ASN.1 data underrun (", $len, ")\n" | ||
169 | if ($cursor->[1] < $len); | ||
170 | |||
171 | my $ret = [ $tag, [ $cursor->[0], $len, $cursor->[2] ] ]; | ||
172 | $cursor->[0] += $len; | ||
173 | $cursor->[1] -= $len; | ||
174 | |||
175 | return $ret; | ||
176 | } | ||
177 | |||
178 | ############################################################################### | ||
179 | # | ||
180 | # Retrieve the data referred to by a cursor | ||
181 | # | ||
182 | ############################################################################### | ||
183 | sub asn1_retrieve($) | ||
184 | { | ||
185 | my ($cursor) = @_; | ||
186 | my ($offset, $len, $data) = @$cursor; | ||
187 | return substr($$data, $offset, $len); | ||
188 | } | ||
189 | |||
190 | ############################################################################### | ||
191 | # | ||
192 | # Roughly parse the X.509 certificate | ||
193 | # | ||
194 | ############################################################################### | ||
195 | my $cursor = [ 0, length($x509_certificate), \$x509_certificate ]; | ||
196 | |||
197 | my $cert = asn1_extract($cursor, $UNIV | $CONS | $SEQUENCE); | ||
198 | my $tbs = asn1_extract($cert->[1], $UNIV | $CONS | $SEQUENCE); | ||
199 | my $version = asn1_extract($tbs->[1], $CONT | $CONS | 0, 1); | ||
200 | my $serial_number = asn1_extract($tbs->[1], $UNIV | $INTEGER); | ||
201 | my $sig_type = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE); | ||
202 | my $issuer = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE); | ||
203 | my $validity = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE); | ||
204 | my $subject = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE); | ||
205 | my $key = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE); | ||
206 | my $issuer_uid = asn1_extract($tbs->[1], $CONT | $CONS | 1, 1); | ||
207 | my $subject_uid = asn1_extract($tbs->[1], $CONT | $CONS | 2, 1); | ||
208 | my $extension_list = asn1_extract($tbs->[1], $CONT | $CONS | 3, 1); | ||
209 | |||
210 | my $subject_key_id = (); | ||
211 | my $authority_key_id = (); | ||
212 | |||
213 | # | ||
214 | # Parse the extension list | ||
215 | # | ||
216 | if ($extension_list->[0] != -1) { | ||
217 | my $extensions = asn1_extract($extension_list->[1], $UNIV | $CONS | $SEQUENCE); | ||
218 | |||
219 | while ($extensions->[1]->[1] > 0) { | ||
220 | my $ext = asn1_extract($extensions->[1], $UNIV | $CONS | $SEQUENCE); | ||
221 | my $x_oid = asn1_extract($ext->[1], $UNIV | $OBJ_ID); | ||
222 | my $x_crit = asn1_extract($ext->[1], $UNIV | $BOOLEAN, 1); | ||
223 | my $x_val = asn1_extract($ext->[1], $UNIV | $OCTET_STRING); | ||
224 | |||
225 | my $raw_oid = asn1_retrieve($x_oid->[1]); | ||
226 | next if (!exists($OIDs{$raw_oid})); | ||
227 | my $x_type = $OIDs{$raw_oid}; | ||
228 | |||
229 | my $raw_value = asn1_retrieve($x_val->[1]); | ||
230 | |||
231 | if ($x_type eq "subjectKeyIdentifier") { | ||
232 | my $vcursor = [ 0, length($raw_value), \$raw_value ]; | ||
233 | |||
234 | $subject_key_id = asn1_extract($vcursor, $UNIV | $OCTET_STRING); | ||
235 | } | ||
236 | } | ||
237 | } | ||
238 | |||
239 | ############################################################################### | ||
240 | # | ||
241 | # Determine what we're going to use as the signer's name. In order of | ||
242 | # preference, take one of: commonName, organizationName or emailAddress. | ||
243 | # | ||
244 | ############################################################################### | ||
245 | my $org = ""; | ||
246 | my $cn = ""; | ||
247 | my $email = ""; | ||
248 | |||
249 | while ($subject->[1]->[1] > 0) { | ||
250 | my $rdn = asn1_extract($subject->[1], $UNIV | $CONS | $SET); | ||
251 | my $attr = asn1_extract($rdn->[1], $UNIV | $CONS | $SEQUENCE); | ||
252 | my $n_oid = asn1_extract($attr->[1], $UNIV | $OBJ_ID); | ||
253 | my $n_val = asn1_extract($attr->[1], -1); | ||
254 | |||
255 | my $raw_oid = asn1_retrieve($n_oid->[1]); | ||
256 | next if (!exists($OIDs{$raw_oid})); | ||
257 | my $n_type = $OIDs{$raw_oid}; | ||
258 | |||
259 | my $raw_value = asn1_retrieve($n_val->[1]); | ||
260 | |||
261 | if ($n_type eq "organizationName") { | ||
262 | $org = $raw_value; | ||
263 | } elsif ($n_type eq "commonName") { | ||
264 | $cn = $raw_value; | ||
265 | } elsif ($n_type eq "emailAddress") { | ||
266 | $email = $raw_value; | ||
267 | } | ||
268 | } | ||
269 | |||
270 | my $signers_name = $email; | ||
271 | |||
272 | if ($org && $cn) { | ||
273 | # Don't use the organizationName if the commonName repeats it | ||
274 | if (length($org) <= length($cn) && | ||
275 | substr($cn, 0, length($org)) eq $org) { | ||
276 | $signers_name = $cn; | ||
277 | goto got_id_name; | ||
278 | } | ||
279 | |||
280 | # Or a signifcant chunk of it | ||
281 | if (length($org) >= 7 && | ||
282 | length($cn) >= 7 && | ||
283 | substr($cn, 0, 7) eq substr($org, 0, 7)) { | ||
284 | $signers_name = $cn; | ||
285 | goto got_id_name; | ||
286 | } | ||
287 | |||
288 | $signers_name = $org . ": " . $cn; | ||
289 | } elsif ($org) { | ||
290 | $signers_name = $org; | ||
291 | } elsif ($cn) { | ||
292 | $signers_name = $cn; | ||
293 | } | ||
294 | |||
295 | got_id_name: | ||
296 | |||
297 | die $x509, ": ", "X.509: Couldn't find the Subject Key Identifier extension\n" | ||
298 | if (!$subject_key_id); | ||
299 | |||
300 | my $key_identifier = asn1_retrieve($subject_key_id->[1]); | ||
301 | |||
302 | ############################################################################### | ||
303 | # | ||
304 | # Create and attach the module signature | ||
305 | # | ||
306 | ############################################################################### | ||
307 | |||
308 | # | ||
309 | # Signature parameters | ||
310 | # | ||
311 | my $algo = 1; # Public-key crypto algorithm: RSA | ||
312 | my $hash = 0; # Digest algorithm | ||
313 | my $id_type = 1; # Identifier type: X.509 | ||
314 | |||
315 | # | ||
316 | # Digest the data | ||
317 | # | ||
318 | my $prologue; | ||
319 | if ($dgst eq "sha1") { | ||
320 | $prologue = pack("C*", | ||
321 | 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, | ||
322 | 0x2B, 0x0E, 0x03, 0x02, 0x1A, | ||
323 | 0x05, 0x00, 0x04, 0x14); | ||
324 | $hash = 2; | ||
325 | } elsif ($dgst eq "sha224") { | ||
326 | $prologue = pack("C*", | ||
327 | 0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, | ||
328 | 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, | ||
329 | 0x05, 0x00, 0x04, 0x1C); | ||
330 | $hash = 7; | ||
331 | } elsif ($dgst eq "sha256") { | ||
332 | $prologue = pack("C*", | ||
333 | 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, | ||
334 | 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, | ||
335 | 0x05, 0x00, 0x04, 0x20); | ||
336 | $hash = 4; | ||
337 | } elsif ($dgst eq "sha384") { | ||
338 | $prologue = pack("C*", | ||
339 | 0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, | ||
340 | 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, | ||
341 | 0x05, 0x00, 0x04, 0x30); | ||
342 | $hash = 5; | ||
343 | } elsif ($dgst eq "sha512") { | ||
344 | $prologue = pack("C*", | ||
345 | 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, | ||
346 | 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, | ||
347 | 0x05, 0x00, 0x04, 0x40); | ||
348 | $hash = 6; | ||
349 | } else { | ||
350 | die "Unknown hash algorithm: $dgst\n"; | ||
351 | } | ||
352 | |||
353 | my $signature; | ||
354 | if ($signature_file) { | ||
355 | $signature = read_file($signature_file); | ||
356 | } else { | ||
357 | # | ||
358 | # Generate the digest and read from openssl's stdout | ||
359 | # | ||
360 | my $digest; | ||
361 | $digest = readpipe("openssl dgst -$dgst -binary $module") || die "openssl dgst"; | ||
362 | |||
363 | # | ||
364 | # Generate the binary signature, which will be just the integer that | ||
365 | # comprises the signature with no metadata attached. | ||
366 | # | ||
367 | my $pid; | ||
368 | $pid = open2(*read_from, *write_to, | ||
369 | "openssl rsautl -sign -inkey $private_key -keyform PEM") || | ||
370 | die "openssl rsautl"; | ||
371 | binmode write_to; | ||
372 | print write_to $prologue . $digest || die "pipe to openssl rsautl"; | ||
373 | close(write_to) || die "pipe to openssl rsautl"; | ||
374 | |||
375 | binmode read_from; | ||
376 | read(read_from, $signature, 4096) || die "pipe from openssl rsautl"; | ||
377 | close(read_from) || die "pipe from openssl rsautl"; | ||
378 | waitpid($pid, 0) || die; | ||
379 | die "openssl rsautl died: $?" if ($? >> 8); | ||
380 | } | ||
381 | $signature = pack("n", length($signature)) . $signature, | ||
382 | |||
383 | # | ||
384 | # Build the signed binary | ||
385 | # | ||
386 | my $unsigned_module = read_file($module); | ||
387 | |||
388 | my $magic_number = "~Module signature appended~\n"; | ||
389 | |||
390 | my $info = pack("CCCCCxxxN", | ||
391 | $algo, $hash, $id_type, | ||
392 | length($signers_name), | ||
393 | length($key_identifier), | ||
394 | length($signature)); | ||
395 | |||
396 | if ($verbose) { | ||
397 | print "Size of unsigned module: ", length($unsigned_module), "\n"; | ||
398 | print "Size of signer's name : ", length($signers_name), "\n"; | ||
399 | print "Size of key identifier : ", length($key_identifier), "\n"; | ||
400 | print "Size of signature : ", length($signature), "\n"; | ||
401 | print "Size of information : ", length($info), "\n"; | ||
402 | print "Size of magic number : ", length($magic_number), "\n"; | ||
403 | print "Signer's name : '", $signers_name, "'\n"; | ||
404 | print "Digest : $dgst\n"; | ||
405 | } | ||
406 | |||
407 | open(FD, ">$dest") || die $dest; | ||
408 | binmode FD; | ||
409 | print FD | ||
410 | $unsigned_module, | ||
411 | $signers_name, | ||
412 | $key_identifier, | ||
413 | $signature, | ||
414 | $info, | ||
415 | $magic_number | ||
416 | ; | ||
417 | close FD || die $dest; | ||
418 | |||
419 | if (!$keep_orig) { | ||
420 | rename($dest, $module) || die $module; | ||
421 | } | ||
diff --git a/scripts/sign-file.c b/scripts/sign-file.c new file mode 100755 index 000000000000..058bba3103e2 --- /dev/null +++ b/scripts/sign-file.c | |||
@@ -0,0 +1,260 @@ | |||
1 | /* Sign a module file using the given key. | ||
2 | * | ||
3 | * Copyright (C) 2014 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public Licence | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the Licence, or (at your option) any later version. | ||
10 | */ | ||
11 | #define _GNU_SOURCE | ||
12 | #include <stdio.h> | ||
13 | #include <stdlib.h> | ||
14 | #include <stdint.h> | ||
15 | #include <stdbool.h> | ||
16 | #include <string.h> | ||
17 | #include <getopt.h> | ||
18 | #include <err.h> | ||
19 | #include <arpa/inet.h> | ||
20 | #include <openssl/bio.h> | ||
21 | #include <openssl/evp.h> | ||
22 | #include <openssl/pem.h> | ||
23 | #include <openssl/cms.h> | ||
24 | #include <openssl/err.h> | ||
25 | #include <openssl/engine.h> | ||
26 | |||
27 | struct module_signature { | ||
28 | uint8_t algo; /* Public-key crypto algorithm [0] */ | ||
29 | uint8_t hash; /* Digest algorithm [0] */ | ||
30 | uint8_t id_type; /* Key identifier type [PKEY_ID_PKCS7] */ | ||
31 | uint8_t signer_len; /* Length of signer's name [0] */ | ||
32 | uint8_t key_id_len; /* Length of key identifier [0] */ | ||
33 | uint8_t __pad[3]; | ||
34 | uint32_t sig_len; /* Length of signature data */ | ||
35 | }; | ||
36 | |||
37 | #define PKEY_ID_PKCS7 2 | ||
38 | |||
39 | static char magic_number[] = "~Module signature appended~\n"; | ||
40 | |||
41 | static __attribute__((noreturn)) | ||
42 | void format(void) | ||
43 | { | ||
44 | fprintf(stderr, | ||
45 | "Usage: scripts/sign-file [-dp] <hash algo> <key> <x509> <module> [<dest>]\n"); | ||
46 | exit(2); | ||
47 | } | ||
48 | |||
49 | static void display_openssl_errors(int l) | ||
50 | { | ||
51 | const char *file; | ||
52 | char buf[120]; | ||
53 | int e, line; | ||
54 | |||
55 | if (ERR_peek_error() == 0) | ||
56 | return; | ||
57 | fprintf(stderr, "At main.c:%d:\n", l); | ||
58 | |||
59 | while ((e = ERR_get_error_line(&file, &line))) { | ||
60 | ERR_error_string(e, buf); | ||
61 | fprintf(stderr, "- SSL %s: %s:%d\n", buf, file, line); | ||
62 | } | ||
63 | } | ||
64 | |||
65 | static void drain_openssl_errors(void) | ||
66 | { | ||
67 | const char *file; | ||
68 | int line; | ||
69 | |||
70 | if (ERR_peek_error() == 0) | ||
71 | return; | ||
72 | while (ERR_get_error_line(&file, &line)) {} | ||
73 | } | ||
74 | |||
75 | #define ERR(cond, fmt, ...) \ | ||
76 | do { \ | ||
77 | bool __cond = (cond); \ | ||
78 | display_openssl_errors(__LINE__); \ | ||
79 | if (__cond) { \ | ||
80 | err(1, fmt, ## __VA_ARGS__); \ | ||
81 | } \ | ||
82 | } while(0) | ||
83 | |||
84 | static const char *key_pass; | ||
85 | |||
86 | static int pem_pw_cb(char *buf, int len, int w, void *v) | ||
87 | { | ||
88 | int pwlen; | ||
89 | |||
90 | if (!key_pass) | ||
91 | return -1; | ||
92 | |||
93 | pwlen = strlen(key_pass); | ||
94 | if (pwlen >= len) | ||
95 | return -1; | ||
96 | |||
97 | strcpy(buf, key_pass); | ||
98 | |||
99 | /* If it's wrong, don't keep trying it. */ | ||
100 | key_pass = NULL; | ||
101 | |||
102 | return pwlen; | ||
103 | } | ||
104 | |||
105 | int main(int argc, char **argv) | ||
106 | { | ||
107 | struct module_signature sig_info = { .id_type = PKEY_ID_PKCS7 }; | ||
108 | char *hash_algo = NULL; | ||
109 | char *private_key_name, *x509_name, *module_name, *dest_name; | ||
110 | bool save_cms = false, replace_orig; | ||
111 | bool sign_only = false; | ||
112 | unsigned char buf[4096]; | ||
113 | unsigned long module_size, cms_size; | ||
114 | unsigned int use_keyid = 0, use_signed_attrs = CMS_NOATTR; | ||
115 | const EVP_MD *digest_algo; | ||
116 | EVP_PKEY *private_key; | ||
117 | CMS_ContentInfo *cms; | ||
118 | X509 *x509; | ||
119 | BIO *b, *bd = NULL, *bm; | ||
120 | int opt, n; | ||
121 | |||
122 | OpenSSL_add_all_algorithms(); | ||
123 | ERR_load_crypto_strings(); | ||
124 | ERR_clear_error(); | ||
125 | |||
126 | key_pass = getenv("KBUILD_SIGN_PIN"); | ||
127 | |||
128 | do { | ||
129 | opt = getopt(argc, argv, "dpk"); | ||
130 | switch (opt) { | ||
131 | case 'p': save_cms = true; break; | ||
132 | case 'd': sign_only = true; save_cms = true; break; | ||
133 | case 'k': use_keyid = CMS_USE_KEYID; break; | ||
134 | case -1: break; | ||
135 | default: format(); | ||
136 | } | ||
137 | } while (opt != -1); | ||
138 | |||
139 | argc -= optind; | ||
140 | argv += optind; | ||
141 | if (argc < 4 || argc > 5) | ||
142 | format(); | ||
143 | |||
144 | hash_algo = argv[0]; | ||
145 | private_key_name = argv[1]; | ||
146 | x509_name = argv[2]; | ||
147 | module_name = argv[3]; | ||
148 | if (argc == 5) { | ||
149 | dest_name = argv[4]; | ||
150 | replace_orig = false; | ||
151 | } else { | ||
152 | ERR(asprintf(&dest_name, "%s.~signed~", module_name) < 0, | ||
153 | "asprintf"); | ||
154 | replace_orig = true; | ||
155 | } | ||
156 | |||
157 | /* Read the private key and the X.509 cert the PKCS#7 message | ||
158 | * will point to. | ||
159 | */ | ||
160 | if (!strncmp(private_key_name, "pkcs11:", 7)) { | ||
161 | ENGINE *e; | ||
162 | |||
163 | ENGINE_load_builtin_engines(); | ||
164 | drain_openssl_errors(); | ||
165 | e = ENGINE_by_id("pkcs11"); | ||
166 | ERR(!e, "Load PKCS#11 ENGINE"); | ||
167 | if (ENGINE_init(e)) | ||
168 | drain_openssl_errors(); | ||
169 | else | ||
170 | ERR(1, "ENGINE_init"); | ||
171 | if (key_pass) | ||
172 | ERR(!ENGINE_ctrl_cmd_string(e, "PIN", key_pass, 0), "Set PKCS#11 PIN"); | ||
173 | private_key = ENGINE_load_private_key(e, private_key_name, NULL, | ||
174 | NULL); | ||
175 | ERR(!private_key, "%s", private_key_name); | ||
176 | } else { | ||
177 | b = BIO_new_file(private_key_name, "rb"); | ||
178 | ERR(!b, "%s", private_key_name); | ||
179 | private_key = PEM_read_bio_PrivateKey(b, NULL, pem_pw_cb, NULL); | ||
180 | ERR(!private_key, "%s", private_key_name); | ||
181 | BIO_free(b); | ||
182 | } | ||
183 | |||
184 | b = BIO_new_file(x509_name, "rb"); | ||
185 | ERR(!b, "%s", x509_name); | ||
186 | x509 = d2i_X509_bio(b, NULL); /* Binary encoded X.509 */ | ||
187 | if (!x509) { | ||
188 | ERR(BIO_reset(b) != 1, "%s", x509_name); | ||
189 | x509 = PEM_read_bio_X509(b, NULL, NULL, NULL); /* PEM encoded X.509 */ | ||
190 | if (x509) | ||
191 | drain_openssl_errors(); | ||
192 | } | ||
193 | BIO_free(b); | ||
194 | ERR(!x509, "%s", x509_name); | ||
195 | |||
196 | /* Open the destination file now so that we can shovel the module data | ||
197 | * across as we read it. | ||
198 | */ | ||
199 | if (!sign_only) { | ||
200 | bd = BIO_new_file(dest_name, "wb"); | ||
201 | ERR(!bd, "%s", dest_name); | ||
202 | } | ||
203 | |||
204 | /* Digest the module data. */ | ||
205 | OpenSSL_add_all_digests(); | ||
206 | display_openssl_errors(__LINE__); | ||
207 | digest_algo = EVP_get_digestbyname(hash_algo); | ||
208 | ERR(!digest_algo, "EVP_get_digestbyname"); | ||
209 | |||
210 | bm = BIO_new_file(module_name, "rb"); | ||
211 | ERR(!bm, "%s", module_name); | ||
212 | |||
213 | /* Load the CMS message from the digest buffer. */ | ||
214 | cms = CMS_sign(NULL, NULL, NULL, NULL, | ||
215 | CMS_NOCERTS | CMS_PARTIAL | CMS_BINARY | CMS_DETACHED | CMS_STREAM); | ||
216 | ERR(!cms, "CMS_sign"); | ||
217 | |||
218 | ERR(!CMS_add1_signer(cms, x509, private_key, digest_algo, | ||
219 | CMS_NOCERTS | CMS_BINARY | CMS_NOSMIMECAP | | ||
220 | use_keyid | use_signed_attrs), | ||
221 | "CMS_sign_add_signer"); | ||
222 | ERR(CMS_final(cms, bm, NULL, CMS_NOCERTS | CMS_BINARY) < 0, | ||
223 | "CMS_final"); | ||
224 | |||
225 | if (save_cms) { | ||
226 | char *cms_name; | ||
227 | |||
228 | ERR(asprintf(&cms_name, "%s.p7s", module_name) < 0, "asprintf"); | ||
229 | b = BIO_new_file(cms_name, "wb"); | ||
230 | ERR(!b, "%s", cms_name); | ||
231 | ERR(i2d_CMS_bio_stream(b, cms, NULL, 0) < 0, "%s", cms_name); | ||
232 | BIO_free(b); | ||
233 | } | ||
234 | |||
235 | if (sign_only) | ||
236 | return 0; | ||
237 | |||
238 | /* Append the marker and the PKCS#7 message to the destination file */ | ||
239 | ERR(BIO_reset(bm) < 0, "%s", module_name); | ||
240 | while ((n = BIO_read(bm, buf, sizeof(buf))), | ||
241 | n > 0) { | ||
242 | ERR(BIO_write(bd, buf, n) < 0, "%s", dest_name); | ||
243 | } | ||
244 | ERR(n < 0, "%s", module_name); | ||
245 | module_size = BIO_number_written(bd); | ||
246 | |||
247 | ERR(i2d_CMS_bio_stream(bd, cms, NULL, 0) < 0, "%s", dest_name); | ||
248 | cms_size = BIO_number_written(bd) - module_size; | ||
249 | sig_info.sig_len = htonl(cms_size); | ||
250 | ERR(BIO_write(bd, &sig_info, sizeof(sig_info)) < 0, "%s", dest_name); | ||
251 | ERR(BIO_write(bd, magic_number, sizeof(magic_number) - 1) < 0, "%s", dest_name); | ||
252 | |||
253 | ERR(BIO_free(bd) < 0, "%s", dest_name); | ||
254 | |||
255 | /* Finally, if we're signing in place, replace the original. */ | ||
256 | if (replace_orig) | ||
257 | ERR(rename(dest_name, module_name) < 0, "%s", dest_name); | ||
258 | |||
259 | return 0; | ||
260 | } | ||
diff --git a/scripts/spelling.txt b/scripts/spelling.txt index bb8e4d0a1911..946caf3bd694 100644 --- a/scripts/spelling.txt +++ b/scripts/spelling.txt | |||
@@ -32,6 +32,7 @@ accoring||according | |||
32 | accout||account | 32 | accout||account |
33 | accquire||acquire | 33 | accquire||acquire |
34 | accquired||acquired | 34 | accquired||acquired |
35 | accross||across | ||
35 | acessable||accessible | 36 | acessable||accessible |
36 | acess||access | 37 | acess||access |
37 | achitecture||architecture | 38 | achitecture||architecture |
@@ -100,8 +101,10 @@ appropiate||appropriate | |||
100 | appropriatly||appropriately | 101 | appropriatly||appropriately |
101 | approriate||appropriate | 102 | approriate||appropriate |
102 | approriately||appropriately | 103 | approriately||appropriately |
104 | apropriate||appropriate | ||
103 | aquainted||acquainted | 105 | aquainted||acquainted |
104 | aquired||acquired | 106 | aquired||acquired |
107 | aquisition||acquisition | ||
105 | arbitary||arbitrary | 108 | arbitary||arbitrary |
106 | architechture||architecture | 109 | architechture||architecture |
107 | arguement||argument | 110 | arguement||argument |
@@ -111,6 +114,8 @@ arne't||aren't | |||
111 | arraival||arrival | 114 | arraival||arrival |
112 | artifical||artificial | 115 | artifical||artificial |
113 | artillary||artillery | 116 | artillary||artillery |
117 | asign||assign | ||
118 | assertation||assertion | ||
114 | assiged||assigned | 119 | assiged||assigned |
115 | assigment||assignment | 120 | assigment||assignment |
116 | assigments||assignments | 121 | assigments||assignments |
@@ -136,6 +141,7 @@ automatize||automate | |||
136 | automatized||automated | 141 | automatized||automated |
137 | automatizes||automates | 142 | automatizes||automates |
138 | autonymous||autonomous | 143 | autonymous||autonomous |
144 | auxillary||auxiliary | ||
139 | auxilliary||auxiliary | 145 | auxilliary||auxiliary |
140 | avaiable||available | 146 | avaiable||available |
141 | avaible||available | 147 | avaible||available |
@@ -187,6 +193,7 @@ capatibilities||capabilities | |||
187 | carefuly||carefully | 193 | carefuly||carefully |
188 | cariage||carriage | 194 | cariage||carriage |
189 | catagory||category | 195 | catagory||category |
196 | cehck||check | ||
190 | challange||challenge | 197 | challange||challenge |
191 | challanges||challenges | 198 | challanges||challenges |
192 | chanell||channel | 199 | chanell||channel |
@@ -199,6 +206,8 @@ charactor||character | |||
199 | charater||character | 206 | charater||character |
200 | charaters||characters | 207 | charaters||characters |
201 | charcter||character | 208 | charcter||character |
209 | chcek||check | ||
210 | chck||check | ||
202 | checksuming||checksumming | 211 | checksuming||checksumming |
203 | childern||children | 212 | childern||children |
204 | childs||children | 213 | childs||children |
@@ -231,6 +240,8 @@ compatability||compatibility | |||
231 | compatable||compatible | 240 | compatable||compatible |
232 | compatibiliy||compatibility | 241 | compatibiliy||compatibility |
233 | compatibilty||compatibility | 242 | compatibilty||compatibility |
243 | compatiblity||compatibility | ||
244 | competion||completion | ||
234 | compilant||compliant | 245 | compilant||compliant |
235 | compleatly||completely | 246 | compleatly||completely |
236 | completly||completely | 247 | completly||completely |
@@ -291,6 +302,7 @@ defferred||deferred | |||
291 | definate||definite | 302 | definate||definite |
292 | definately||definitely | 303 | definately||definitely |
293 | defintion||definition | 304 | defintion||definition |
305 | defintions||definitions | ||
294 | defualt||default | 306 | defualt||default |
295 | defult||default | 307 | defult||default |
296 | deivce||device | 308 | deivce||device |
@@ -306,6 +318,7 @@ depreacted||deprecated | |||
306 | depreacte||deprecate | 318 | depreacte||deprecate |
307 | desactivate||deactivate | 319 | desactivate||deactivate |
308 | desciptors||descriptors | 320 | desciptors||descriptors |
321 | descripton||description | ||
309 | descrition||description | 322 | descrition||description |
310 | descritptor||descriptor | 323 | descritptor||descriptor |
311 | desctiptor||descriptor | 324 | desctiptor||descriptor |
@@ -327,6 +340,7 @@ devided||divided | |||
327 | deviece||device | 340 | deviece||device |
328 | diable||disable | 341 | diable||disable |
329 | dictionnary||dictionary | 342 | dictionnary||dictionary |
343 | didnt||didn't | ||
330 | diferent||different | 344 | diferent||different |
331 | differrence||difference | 345 | differrence||difference |
332 | difinition||definition | 346 | difinition||definition |
@@ -344,6 +358,7 @@ docuentation||documentation | |||
344 | documantation||documentation | 358 | documantation||documentation |
345 | documentaion||documentation | 359 | documentaion||documentation |
346 | documment||document | 360 | documment||document |
361 | doesnt||doesn't | ||
347 | dorp||drop | 362 | dorp||drop |
348 | dosen||doesn | 363 | dosen||doesn |
349 | downlad||download | 364 | downlad||download |
@@ -450,11 +465,13 @@ grahical||graphical | |||
450 | grahpical||graphical | 465 | grahpical||graphical |
451 | grapic||graphic | 466 | grapic||graphic |
452 | guage||gauge | 467 | guage||gauge |
468 | guarenteed||guaranteed | ||
453 | guarentee||guarantee | 469 | guarentee||guarantee |
454 | halfs||halves | 470 | halfs||halves |
455 | hander||handler | 471 | hander||handler |
456 | handfull||handful | 472 | handfull||handful |
457 | hanled||handled | 473 | hanled||handled |
474 | happend||happened | ||
458 | harware||hardware | 475 | harware||hardware |
459 | heirarchically||hierarchically | 476 | heirarchically||hierarchically |
460 | helpfull||helpful | 477 | helpfull||helpful |
@@ -512,6 +529,7 @@ initialzed||initialized | |||
512 | initilization||initialization | 529 | initilization||initialization |
513 | initilize||initialize | 530 | initilize||initialize |
514 | inofficial||unofficial | 531 | inofficial||unofficial |
532 | insititute||institute | ||
515 | instal||install | 533 | instal||install |
516 | inteface||interface | 534 | inteface||interface |
517 | integreated||integrated | 535 | integreated||integrated |
@@ -546,6 +564,7 @@ invididual||individual | |||
546 | invokation||invocation | 564 | invokation||invocation |
547 | invokations||invocations | 565 | invokations||invocations |
548 | irrelevent||irrelevant | 566 | irrelevent||irrelevant |
567 | isnt||isn't | ||
549 | isssue||issue | 568 | isssue||issue |
550 | itslef||itself | 569 | itslef||itself |
551 | jave||java | 570 | jave||java |
@@ -558,6 +577,7 @@ langauage||language | |||
558 | langauge||language | 577 | langauge||language |
559 | langugage||language | 578 | langugage||language |
560 | lauch||launch | 579 | lauch||launch |
580 | layed||laid | ||
561 | leightweight||lightweight | 581 | leightweight||lightweight |
562 | lengh||length | 582 | lengh||length |
563 | lenght||length | 583 | lenght||length |
@@ -714,6 +734,7 @@ preceeding||preceding | |||
714 | preceed||precede | 734 | preceed||precede |
715 | precendence||precedence | 735 | precendence||precedence |
716 | precission||precision | 736 | precission||precision |
737 | preemptable||preemptible | ||
717 | prefered||preferred | 738 | prefered||preferred |
718 | prefferably||preferably | 739 | prefferably||preferably |
719 | premption||preemption | 740 | premption||preemption |
@@ -744,6 +765,7 @@ programers||programmers | |||
744 | programm||program | 765 | programm||program |
745 | programms||programs | 766 | programms||programs |
746 | progresss||progress | 767 | progresss||progress |
768 | promiscous||promiscuous | ||
747 | promps||prompts | 769 | promps||prompts |
748 | pronnounced||pronounced | 770 | pronnounced||pronounced |
749 | prononciation||pronunciation | 771 | prononciation||pronunciation |
@@ -817,6 +839,7 @@ reseting||resetting | |||
817 | resizeable||resizable | 839 | resizeable||resizable |
818 | resouces||resources | 840 | resouces||resources |
819 | resoures||resources | 841 | resoures||resources |
842 | responce||response | ||
820 | ressizes||resizes | 843 | ressizes||resizes |
821 | ressource||resource | 844 | ressource||resource |
822 | ressources||resources | 845 | ressources||resources |
@@ -869,6 +892,7 @@ setts||sets | |||
869 | settting||setting | 892 | settting||setting |
870 | shotdown||shutdown | 893 | shotdown||shutdown |
871 | shoud||should | 894 | shoud||should |
895 | shouldnt||shouldn't | ||
872 | shoule||should | 896 | shoule||should |
873 | shrinked||shrunk | 897 | shrinked||shrunk |
874 | siginificantly||significantly | 898 | siginificantly||significantly |
@@ -913,9 +937,11 @@ straming||streaming | |||
913 | struc||struct | 937 | struc||struct |
914 | structres||structures | 938 | structres||structures |
915 | stuct||struct | 939 | stuct||struct |
940 | stucture||structure | ||
916 | sturcture||structure | 941 | sturcture||structure |
917 | subdirectoires||subdirectories | 942 | subdirectoires||subdirectories |
918 | suble||subtle | 943 | suble||subtle |
944 | substract||subtract | ||
919 | succesfully||successfully | 945 | succesfully||successfully |
920 | succesful||successful | 946 | succesful||successful |
921 | successfull||successful | 947 | successfull||successful |
@@ -987,6 +1013,7 @@ unexpectd||unexpected | |||
987 | unexpeted||unexpected | 1013 | unexpeted||unexpected |
988 | unfortunatelly||unfortunately | 1014 | unfortunatelly||unfortunately |
989 | unifiy||unify | 1015 | unifiy||unify |
1016 | unintialized||uninitialized | ||
990 | unknonw||unknown | 1017 | unknonw||unknown |
991 | unknow||unknown | 1018 | unknow||unknown |
992 | unkown||unknown | 1019 | unkown||unknown |
@@ -1027,7 +1054,9 @@ virtiual||virtual | |||
1027 | visiters||visitors | 1054 | visiters||visitors |
1028 | vitual||virtual | 1055 | vitual||virtual |
1029 | wating||waiting | 1056 | wating||waiting |
1057 | wether||whether | ||
1030 | whataver||whatever | 1058 | whataver||whatever |
1059 | whcih||which | ||
1031 | whenver||whenever | 1060 | whenver||whenever |
1032 | wheter||whether | 1061 | wheter||whether |
1033 | whe||when | 1062 | whe||when |
diff --git a/scripts/stackdelta b/scripts/stackdelta new file mode 100755 index 000000000000..48eabf2f48f8 --- /dev/null +++ b/scripts/stackdelta | |||
@@ -0,0 +1,59 @@ | |||
1 | #!/usr/bin/perl | ||
2 | |||
3 | # Read two files produced by the stackusage script, and show the | ||
4 | # delta between them. | ||
5 | # | ||
6 | # Currently, only shows changes for functions listed in both files. We | ||
7 | # could add an option to show also functions which have vanished or | ||
8 | # appeared (which would often be due to gcc making other inlining | ||
9 | # decisions). | ||
10 | # | ||
11 | # Another possible option would be a minimum absolute value for the | ||
12 | # delta. | ||
13 | # | ||
14 | # A third possibility is for sorting by delta, but that can be | ||
15 | # achieved by piping to sort -k5,5g. | ||
16 | |||
17 | sub read_stack_usage_file { | ||
18 | my %su; | ||
19 | my $f = shift; | ||
20 | open(my $fh, '<', $f) | ||
21 | or die "cannot open $f: $!"; | ||
22 | while (<$fh>) { | ||
23 | chomp; | ||
24 | my ($file, $func, $size, $type) = split; | ||
25 | # Old versions of gcc (at least 4.7) have an annoying quirk in | ||
26 | # that a (static) function whose name has been changed into | ||
27 | # for example ext4_find_unwritten_pgoff.isra.11 will show up | ||
28 | # in the .su file with a name of just "11". Since such a | ||
29 | # numeric suffix is likely to change across different | ||
30 | # commits/compilers/.configs or whatever else we're trying to | ||
31 | # tweak, we can't really track those functions, so we just | ||
32 | # silently skip them. | ||
33 | # | ||
34 | # Newer gcc (at least 5.0) report the full name, so again, | ||
35 | # since the suffix is likely to change, we strip it. | ||
36 | next if $func =~ m/^[0-9]+$/; | ||
37 | $func =~ s/\..*$//; | ||
38 | # Line numbers are likely to change; strip those. | ||
39 | $file =~ s/:[0-9]+$//; | ||
40 | $su{"${file}\t${func}"} = {size => $size, type => $type}; | ||
41 | } | ||
42 | close($fh); | ||
43 | return \%su; | ||
44 | } | ||
45 | |||
46 | @ARGV == 2 | ||
47 | or die "usage: $0 <old> <new>"; | ||
48 | |||
49 | my $old = read_stack_usage_file($ARGV[0]); | ||
50 | my $new = read_stack_usage_file($ARGV[1]); | ||
51 | my @common = sort grep {exists $new->{$_}} keys %$old; | ||
52 | for (@common) { | ||
53 | my $x = $old->{$_}{size}; | ||
54 | my $y = $new->{$_}{size}; | ||
55 | my $delta = $y - $x; | ||
56 | if ($delta) { | ||
57 | printf "%s\t%d\t%d\t%+d\n", $_, $x, $y, $delta; | ||
58 | } | ||
59 | } | ||
diff --git a/scripts/stackusage b/scripts/stackusage new file mode 100755 index 000000000000..8cf26640ef8a --- /dev/null +++ b/scripts/stackusage | |||
@@ -0,0 +1,33 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | outfile="" | ||
4 | now=`date +%s` | ||
5 | |||
6 | while [ $# -gt 0 ] | ||
7 | do | ||
8 | case "$1" in | ||
9 | -o) | ||
10 | outfile="$2" | ||
11 | shift 2;; | ||
12 | -h) | ||
13 | echo "usage: $0 [-o outfile] <make options/args>" | ||
14 | exit 0;; | ||
15 | *) break;; | ||
16 | esac | ||
17 | done | ||
18 | |||
19 | if [ -z "$outfile" ] | ||
20 | then | ||
21 | outfile=`mktemp --tmpdir stackusage.$$.XXXX` | ||
22 | fi | ||
23 | |||
24 | KCFLAGS="${KCFLAGS} -fstack-usage" make "$@" | ||
25 | |||
26 | # Prepend directory name to file names, remove column information, | ||
27 | # make file:line/function/size/type properly tab-separated. | ||
28 | find . -name '*.su' -newermt "@${now}" -print | \ | ||
29 | xargs perl -MFile::Basename -pe \ | ||
30 | '$d = dirname($ARGV); s#([^:]+:[0-9]+):[0-9]+:#$d/$1\t#;' | \ | ||
31 | sort -k3,3nr > "${outfile}" | ||
32 | |||
33 | echo "$0: output written to ${outfile}" | ||
diff --git a/scripts/tags.sh b/scripts/tags.sh index c0a932dff329..8e5aee6d9da2 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh | |||
@@ -170,7 +170,9 @@ exuberant() | |||
170 | --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \ | 170 | --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \ |
171 | --regex-c='/^COMPAT_SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/compat_sys_\1/' \ | 171 | --regex-c='/^COMPAT_SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/compat_sys_\1/' \ |
172 | --regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \ | 172 | --regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \ |
173 | --regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1_rcuidle/' \ | ||
173 | --regex-c++='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1/' \ | 174 | --regex-c++='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1/' \ |
175 | --regex-c++='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1_rcuidle/' \ | ||
174 | --regex-c++='/PAGEFLAG\(([^,)]*).*/Page\1/' \ | 176 | --regex-c++='/PAGEFLAG\(([^,)]*).*/Page\1/' \ |
175 | --regex-c++='/PAGEFLAG\(([^,)]*).*/SetPage\1/' \ | 177 | --regex-c++='/PAGEFLAG\(([^,)]*).*/SetPage\1/' \ |
176 | --regex-c++='/PAGEFLAG\(([^,)]*).*/ClearPage\1/' \ | 178 | --regex-c++='/PAGEFLAG\(([^,)]*).*/ClearPage\1/' \ |
@@ -233,7 +235,9 @@ emacs() | |||
233 | --regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/' \ | 235 | --regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/' \ |
234 | --regex='/^COMPAT_SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/compat_sys_\1/' \ | 236 | --regex='/^COMPAT_SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/compat_sys_\1/' \ |
235 | --regex='/^TRACE_EVENT(\([^,)]*\).*/trace_\1/' \ | 237 | --regex='/^TRACE_EVENT(\([^,)]*\).*/trace_\1/' \ |
238 | --regex='/^TRACE_EVENT(\([^,)]*\).*/trace_\1_rcuidle/' \ | ||
236 | --regex='/^DEFINE_EVENT([^,)]*, *\([^,)]*\).*/trace_\1/' \ | 239 | --regex='/^DEFINE_EVENT([^,)]*, *\([^,)]*\).*/trace_\1/' \ |
240 | --regex='/^DEFINE_EVENT([^,)]*, *\([^,)]*\).*/trace_\1_rcuidle/' \ | ||
237 | --regex='/PAGEFLAG(\([^,)]*\).*/Page\1/' \ | 241 | --regex='/PAGEFLAG(\([^,)]*\).*/Page\1/' \ |
238 | --regex='/PAGEFLAG(\([^,)]*\).*/SetPage\1/' \ | 242 | --regex='/PAGEFLAG(\([^,)]*\).*/SetPage\1/' \ |
239 | --regex='/PAGEFLAG(\([^,)]*\).*/ClearPage\1/' \ | 243 | --regex='/PAGEFLAG(\([^,)]*\).*/ClearPage\1/' \ |